mirror of
https://github.com/zeldaret/tmc
synced 2026-08-18 13:43:31 -04:00
Merge playerUtils
Merge all player utils files, split asm into functions and decompile a bunch of functions.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "structures.h"
|
||||
#include "room.h"
|
||||
#include "common.h"
|
||||
|
||||
bool32 sub_0805EC04(Entity* this) {
|
||||
u32 i = 1;
|
||||
@@ -48,3 +50,41 @@ void sub_0805ED14(u32 param_1) {
|
||||
gPlayerState.field_0x98 = 0;
|
||||
gPlayerState.field_0x9a = 0;
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/code_0805EC04/sub_0805ED30.inc", void sub_0805ED30())
|
||||
|
||||
u32 sub_0805EE04(u32 param_1) {
|
||||
u32 result = (s32) - (param_1 & 0x200) >> 0x1f & 0x1000;
|
||||
if ((param_1 & 0x100) != 0) {
|
||||
result |= 0x20;
|
||||
result |= 0x8000;
|
||||
result |= 0x80;
|
||||
}
|
||||
if ((param_1 & 1) != 0) {
|
||||
result |= 0x8;
|
||||
result |= 0x41;
|
||||
}
|
||||
if ((param_1 & 2) != 0) {
|
||||
result |= 0x10;
|
||||
result |= 0x2;
|
||||
}
|
||||
if ((param_1 & 0x10) != 0) {
|
||||
result |= 0x100;
|
||||
}
|
||||
if ((param_1 & 0x20) != 0) {
|
||||
result |= 0x200;
|
||||
}
|
||||
if ((param_1 & 0x40) != 0) {
|
||||
result |= 0x400;
|
||||
}
|
||||
if ((param_1 & 0x80) != 0) {
|
||||
result |= 0x800;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void sub_0805EE88(void) {
|
||||
if ((gRoomTransition.field_0x2c[3] != 0) && ((gRoomTransition.frameCount & 3) == 0)) {
|
||||
LoadPaletteGroup((((u32)gRoomTransition.frameCount & 0xc) >> 2) + 0x2f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,287 +0,0 @@
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "save.h"
|
||||
|
||||
typedef struct {
|
||||
u8 unk0[4];
|
||||
u16 unk4;
|
||||
u8 unk6[6];
|
||||
} struct_0811BE48;
|
||||
|
||||
typedef struct {
|
||||
u8 field_0x0;
|
||||
u8 field_0x1;
|
||||
} UnkItemStruct;
|
||||
|
||||
void* sub_08077C54(UnkItemStruct* unk);
|
||||
Entity* CreatePlayerBomb(ItemBehavior*, u32);
|
||||
extern Entity* sub_0805E744();
|
||||
|
||||
extern struct_0811BE48 gUnk_0811BE48[];
|
||||
|
||||
void sub_08077B98(UnkItemStruct* unk) {
|
||||
if ((gPlayerState.item == NULL) || (gPlayerState.item->id != 1)) {
|
||||
gPlayerState.item = sub_08077C54(unk);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08077BB8(ItemBehavior* beh) {
|
||||
UnkItemStruct* unk = (UnkItemStruct*)beh; // @nocheckin
|
||||
Entity* temp = sub_08077C54(unk);
|
||||
if (temp != NULL) {
|
||||
temp->flags = ENT_PERSIST;
|
||||
}
|
||||
gPlayerState.item = temp;
|
||||
}
|
||||
|
||||
Entity* sub_08077BD4(ItemBehavior* beh) {
|
||||
if (sub_08077C94(beh, gUnk_0811BE48[beh->behaviorID].unk0[3]) != 0) {
|
||||
return NULL;
|
||||
} else {
|
||||
return CreatePlayerBomb(beh, gUnk_0811BE48[beh->behaviorID].unk0[3]);
|
||||
}
|
||||
}
|
||||
|
||||
Entity* sub_08077C0C(ItemBehavior* beh, u32 arg1) {
|
||||
u8 bVar1;
|
||||
Entity* pEVar3;
|
||||
|
||||
bVar1 = gUnk_0811BE48[arg1].unk0[3];
|
||||
|
||||
if (sub_08077C94(beh, bVar1) != 0) {
|
||||
return NULL;
|
||||
} else {
|
||||
return CreatePlayerBomb(beh, bVar1);
|
||||
}
|
||||
}
|
||||
|
||||
Entity* CreatePlayerBomb(ItemBehavior* beh, u32 subtype) {
|
||||
Entity* pEVar1;
|
||||
|
||||
pEVar1 = CreatePlayerItem(subtype, 0, 0, beh->behaviorID);
|
||||
if (pEVar1 != NULL) {
|
||||
*(ItemBehavior**)&pEVar1->parent = beh;
|
||||
}
|
||||
return pEVar1;
|
||||
}
|
||||
|
||||
void* sub_08077C54(UnkItemStruct* unk) {
|
||||
Entity* item;
|
||||
|
||||
item = sub_0805E744();
|
||||
if (item != NULL) {
|
||||
item->id = gUnk_0811BE48[unk->field_0x1].unk0[3];
|
||||
item->kind = PLAYER_ITEM;
|
||||
item->flags = 0xa0;
|
||||
item->parent = (Entity*)unk;
|
||||
item->field_0x68.HALF.LO = unk->field_0x1;
|
||||
AppendEntityToList(item, 2);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
Entity* sub_08077C94(ItemBehavior* arg0, u32 arg1) {
|
||||
Entity* iVar1;
|
||||
|
||||
iVar1 = FindEntityByID(PLAYER_ITEM, gUnk_0811BE48[arg1].unk0[3], 2);
|
||||
if (iVar1 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return iVar1;
|
||||
}
|
||||
|
||||
Entity* CreatePlayerItem(u32 subtype, u32 form, u32 parameter, u32 unk) {
|
||||
Entity* ent;
|
||||
|
||||
ent = GetEmptyEntity();
|
||||
if (ent != NULL) {
|
||||
ent->flags = ENT_COLLIDE;
|
||||
ent->kind = PLAYER_ITEM;
|
||||
ent->id = subtype;
|
||||
ent->type = form;
|
||||
ent->type2 = parameter;
|
||||
ent->field_0x68.HALF.LO = unk;
|
||||
AppendEntityToList(ent, 2);
|
||||
}
|
||||
return ent;
|
||||
}
|
||||
|
||||
Entity* sub_08077CF8(u32 subtype, u32 form, u32 parameter, u32 unk) {
|
||||
Entity* ent;
|
||||
|
||||
ent = sub_0805E744();
|
||||
if (ent != NULL) {
|
||||
ent->flags = ENT_COLLIDE;
|
||||
ent->kind = PLAYER_ITEM;
|
||||
ent->id = subtype;
|
||||
ent->type = form;
|
||||
ent->type2 = parameter;
|
||||
ent->field_0x68.HALF.LO = unk;
|
||||
AppendEntityToList(ent, 2);
|
||||
}
|
||||
return ent;
|
||||
}
|
||||
|
||||
void sub_08077D38(ItemBehavior* beh, u32 arg2) {
|
||||
u32 r6;
|
||||
struct_0811BE48* ptr;
|
||||
|
||||
gPlayerState.field_0xa |= 8 >> arg2;
|
||||
gPlayerState.keepFacing |= 8 >> arg2;
|
||||
beh->field_0x5[5] = gPlayerEntity.animationState;
|
||||
if (beh->stateID == 0) {
|
||||
beh->stateID++;
|
||||
}
|
||||
|
||||
ptr = &gUnk_0811BE48[beh->behaviorID];
|
||||
if (ptr->unk4) {
|
||||
if ((gPlayerState.flags & PL_NO_CAP)) {
|
||||
switch (beh->behaviorID) {
|
||||
case 0x1b:
|
||||
r6 = 0x948;
|
||||
break;
|
||||
case 1:
|
||||
r6 = 0x408;
|
||||
break;
|
||||
case 0xd:
|
||||
r6 = 0x40c;
|
||||
break;
|
||||
}
|
||||
sub_08077DF4(beh, r6);
|
||||
} else {
|
||||
sub_08077DF4(beh, ptr->unk4);
|
||||
}
|
||||
}
|
||||
|
||||
beh->field_0xf = ptr->unk6[0];
|
||||
if (ptr->unk6[1]) {
|
||||
gPlayerState.field_0x3[1] |= (8 >> arg2) | ((8 >> arg2) << 4);
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
u8 b0 : 4;
|
||||
u8 b1 : 4;
|
||||
} PACKED Unk_bitfield;
|
||||
|
||||
typedef struct {
|
||||
u8 unk[16];
|
||||
} Unk_struct;
|
||||
|
||||
void sub_08077DF4(ItemBehavior* beh, u32 arg1) {
|
||||
Entity* ent = (Entity*)beh; // @nocheckin
|
||||
*(u16*)&ent->flags = arg1;
|
||||
if ((arg1 & 0xff) > 0xb8) {
|
||||
arg1 += ent->type >> 1;
|
||||
}
|
||||
gPlayerEntity.spriteIndex = (short)(arg1 >> 8);
|
||||
InitAnimationForceUpdate(&gPlayerEntity, (u8)arg1);
|
||||
sub_08077E54(beh);
|
||||
}
|
||||
|
||||
void UpdateItemAnim(ItemBehavior* beh) {
|
||||
UpdateAnimationSingleFrame(&gPlayerEntity);
|
||||
sub_08077E54(beh);
|
||||
}
|
||||
|
||||
void sub_08077E3C(ItemBehavior* ent, u32 idx) {
|
||||
sub_080042BA(&gPlayerEntity, idx);
|
||||
sub_08077E54(ent);
|
||||
}
|
||||
|
||||
void sub_08077E54(ItemBehavior* beh) {
|
||||
Entity* ent = (Entity*)beh; // @nocheckin
|
||||
ent->action = gPlayerEntity.animIndex;
|
||||
*(u8*)&ent->spriteIndex = gPlayerEntity.frameIndex;
|
||||
ent->subAction = gPlayerEntity.frameDuration;
|
||||
ent->actionDelay = gPlayerEntity.frame;
|
||||
}
|
||||
|
||||
void sub_08077E78(ItemBehavior* arg0, u32 bits) {
|
||||
u32 not ;
|
||||
|
||||
if (bits == 0) {
|
||||
if (gPlayerState.item != NULL) {
|
||||
((Unk_bitfield*)gPlayerState.item)[0x11].b0 = 6;
|
||||
gPlayerState.item = NULL;
|
||||
} else {
|
||||
gPlayerState.item = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
not = (8 >> bits);
|
||||
gPlayerState.field_0x3[1] &= ~((u8)((8 >> bits) << 4) | not );
|
||||
not = ~not ;
|
||||
gPlayerState.field_0xa &= not ;
|
||||
gPlayerState.keepFacing &= not ;
|
||||
MemClear(arg0, 0x1c);
|
||||
}
|
||||
|
||||
u32 sub_08077EC8(ItemBehavior* beh) {
|
||||
Unk_struct* arg0 = (Unk_struct*)beh; // @nocheckin
|
||||
|
||||
if ((gPlayerState.sword_state & 8) != 0) {
|
||||
sub_08077DF4(beh, 0x170);
|
||||
arg0->unk[7] = 0x28;
|
||||
arg0->unk[4] = 7;
|
||||
arg0->unk[15] = 6;
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_08077EFC(ItemBehavior* arg0) {
|
||||
return sub_08077F24(arg0, (u16)gPlayerState.field_0x90);
|
||||
}
|
||||
|
||||
bool32 sub_08077F10(ItemBehavior* arg0) {
|
||||
return sub_08077F24(arg0, (u16)gPlayerState.field_0x92);
|
||||
}
|
||||
|
||||
bool32 sub_08077F24(ItemBehavior* beh, u32 arg1) {
|
||||
u32 val;
|
||||
Stats* stats = &gSave.stats;
|
||||
u32 id = beh->behaviorID;
|
||||
if (stats->itemButtons[SLOT_A] == id) {
|
||||
val = 1;
|
||||
} else if (stats->itemButtons[SLOT_B] == id) {
|
||||
val = 2;
|
||||
} else {
|
||||
val = 0;
|
||||
}
|
||||
|
||||
return (val & arg1) ? 1 : 0;
|
||||
}
|
||||
|
||||
void sub_08077F50(ItemBehavior* beh, u32 arg1) {
|
||||
sub_08079184();
|
||||
sub_08077E78(beh, arg1);
|
||||
}
|
||||
|
||||
u32 sub_08077F64(ItemBehavior* arg0, u32 unk) {
|
||||
u32 temp;
|
||||
if (gPlayerState.heldObject == 0) {
|
||||
sub_08077F50(arg0, unk);
|
||||
temp = 0;
|
||||
} else {
|
||||
temp = 1;
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
void sub_08077F84(void) {
|
||||
Entity* obj;
|
||||
|
||||
if (((gPlayerEntity.collisionLayer & 2) == 0) &&
|
||||
GetTileTypeByPos(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 0xc, 2) - 0x343U < 4) {
|
||||
sub_0807AA80(&gPlayerEntity);
|
||||
gPlayerState.jump_status |= 8;
|
||||
obj = CreateObject(OBJECT_44, 0, 0);
|
||||
if (obj != NULL) {
|
||||
obj->x = gPlayerEntity.x;
|
||||
obj->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0xc;
|
||||
gPlayerEntity.y.HALF.HI -= 0xc;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "kinstone.h"
|
||||
|
||||
void sub_08078778(Entity* ent) {
|
||||
sub_0807887C(ent, 1, 0);
|
||||
}
|
||||
|
||||
void sub_08078784(Entity* ent, u32 arg1) {
|
||||
sub_0807887C(ent, 1, arg1);
|
||||
}
|
||||
|
||||
void sub_08078790(Entity* ent, u32 arg1) {
|
||||
sub_0807887C(ent, 2, arg1);
|
||||
}
|
||||
|
||||
void sub_0807879C(Entity* ent) {
|
||||
sub_0807887C(ent, 7, 0);
|
||||
}
|
||||
|
||||
void sub_080787A8(Entity* ent, u32 arg1) {
|
||||
sub_0807887C(ent, 7, arg1);
|
||||
}
|
||||
|
||||
void sub_080787B4(Entity* ent) {
|
||||
sub_0807887C(ent, 9, 0);
|
||||
}
|
||||
|
||||
void sub_080787C0(Entity* ent) {
|
||||
sub_0807887C(ent, 10, 0);
|
||||
}
|
||||
|
||||
void sub_080787CC(Entity* ent) {
|
||||
sub_0807887C(ent, 5, 0);
|
||||
}
|
||||
|
||||
s32 sub_080787D8(Entity* ent) {
|
||||
s32 iVar1;
|
||||
|
||||
iVar1 = sub_0807887C(ent, 8, 0);
|
||||
if (iVar1 >= 0) {
|
||||
gUnk_03003DF0[iVar1].unk[10] = 0xbe;
|
||||
}
|
||||
return iVar1;
|
||||
}
|
||||
|
||||
s32 sub_08078800(Entity* ent) {
|
||||
s32 iVar1;
|
||||
|
||||
iVar1 = sub_0807887C(ent, 6, 0);
|
||||
if (iVar1 >= 0) {
|
||||
gUnk_03003DF0[iVar1].unk[10] = 0xbe;
|
||||
}
|
||||
return iVar1;
|
||||
}
|
||||
|
||||
s32 sub_08078828(Entity* ent) {
|
||||
s32 iVar1;
|
||||
|
||||
iVar1 = sub_0807887C(ent, 3, 0);
|
||||
if (iVar1 >= 0) {
|
||||
gUnk_03003DF0[iVar1].unk[10] = 0xbe;
|
||||
}
|
||||
return iVar1;
|
||||
}
|
||||
|
||||
void sub_08078850(Entity* arg0, u32 arg1, u32 arg2, void* arg3) {
|
||||
s32 iVar1;
|
||||
|
||||
iVar1 = sub_08078904();
|
||||
if (iVar1 >= 0) {
|
||||
gUnk_03003DF0[iVar1].unk[8] = arg1;
|
||||
gUnk_03003DF0[iVar1].unk[10] = arg2;
|
||||
*((u32*)&gUnk_03003DF0[iVar1].unk4 + 1) = (u32)arg3;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -431,7 +431,7 @@ void sub_0801DFB4(Entity* entity, u32 a2, u32 a3, u32 a4) {
|
||||
gFuseInfo._8 = a3;
|
||||
gFuseInfo._a = a4;
|
||||
gFuseInfo.ent = entity;
|
||||
gFuseInfo._3 = gUnk_03003DF0[0].unk[2];
|
||||
gFuseInfo._3 = gUnk_03003DF0.unk_2;
|
||||
if (entity != NULL) {
|
||||
gFuseInfo._4 = entity->updatePriority;
|
||||
entity->updatePriority = 2;
|
||||
|
||||
+1
-4
@@ -13,14 +13,11 @@ const u8 gSpriteSortBelowTable[];
|
||||
const u8 gUnk_08114F58[];
|
||||
const u8 gUnk_08114F38[];
|
||||
|
||||
extern u32 gSpritePtrs[];
|
||||
|
||||
extern u16 gExtraFrameOffsets[];
|
||||
extern s8 gUnk_08126EE4[];
|
||||
extern const u16 gUnk_080046A4[];
|
||||
extern const u16 gUnk_080047F6[];
|
||||
|
||||
void sub_080027EA(Entity*, u32, u32);
|
||||
u32 sub_0806F58C(Entity*, Entity*);
|
||||
u32 sub_0806FCA0(Entity*, Entity*);
|
||||
void UnloadHitbox(Entity*);
|
||||
@@ -662,7 +659,7 @@ bool32 sub_0807007C(struct_gUnk_020000C0* this, u32 param_2) {
|
||||
if (ptr1->unk_01 == 0xff)
|
||||
return 0;
|
||||
|
||||
spritePtr = &gSpritePtrs[ptr1->unk_02 * 4];
|
||||
spritePtr = &((u32*)gSpritePtrs)[ptr1->unk_02 * 4];
|
||||
ptr2 = (u8*)(spritePtr[1]);
|
||||
if (ptr2 == 0)
|
||||
return 0;
|
||||
|
||||
@@ -254,7 +254,7 @@ void sub_08031C58(Entity* this) {
|
||||
|
||||
void sub_08031D70(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay == '\0') {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 7;
|
||||
COLLISION_OFF(this);
|
||||
this->actionDelay = 5;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "common.h"
|
||||
#include "flags.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -48,6 +50,41 @@ bool32 sub_080305BC(ArmosEntity*);
|
||||
void sub_080307D4(ArmosEntity*);
|
||||
void sub_08030590(ArmosEntity*);
|
||||
|
||||
void ClearArmosData(void) {
|
||||
MemClear(&gRoomTransition.armos_data, sizeof(gRoomTransition.armos_data));
|
||||
gRoomTransition.armos_data.field_0xae = 0xff;
|
||||
}
|
||||
|
||||
void sub_080300C4(void) {
|
||||
if (gRoomTransition.armos_data.field_0xae == 0xff) {
|
||||
gRoomTransition.armos_data.field_0xac = 0;
|
||||
MemClear(&gRoomTransition.armos_data.data, sizeof(gRoomTransition.armos_data.data));
|
||||
}
|
||||
}
|
||||
void sub_080300E8(void) {
|
||||
if (gRoomTransition.armos_data.field_0xae != 0xff) {
|
||||
const u16* ptr = &gRoomTransition.armos_data.data[gRoomTransition.armos_data.field_0xae * 2];
|
||||
gPlayerEntity.x.HALF.HI = ptr[0];
|
||||
gPlayerEntity.y.HALF.HI = ptr[1] + 0xc;
|
||||
gRoomTransition.armos_data.field_0xae = 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08030118(u32 param_1) {
|
||||
if (((s32)(u32)gRoomTransition.armos_data.field_0xac >> (param_1)&1) != 0) {
|
||||
SetLocalFlagByBank(0x300, param_1 + 0x67);
|
||||
} else {
|
||||
ClearLocalFlagByBank(0x300, param_1 + 0x67);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08030150(ArmosEntity* this) {
|
||||
gRoomTransition.armos_data.field_0xac =
|
||||
(gRoomTransition.armos_data.field_0xac & ~(1 << this->unk_80)) | (this->unk_84 << this->unk_80);
|
||||
gRoomTransition.armos_data.data[(u32)this->unk_80 * 2] = super->x.HALF.HI;
|
||||
gRoomTransition.armos_data.data[(u32)this->unk_80 * 2 + 1] = super->y.HALF.HI;
|
||||
}
|
||||
|
||||
void Armos(ArmosEntity* this) {
|
||||
EnemyFunctionHandler(super, (EntityActionArray)&gUnk_080CE124);
|
||||
SetChildOffset(super, 0, 1, -0x10);
|
||||
|
||||
+21
-21
@@ -39,7 +39,7 @@ struct SalesOffering {
|
||||
u16 price;
|
||||
u16 field_0x4;
|
||||
u16 field_0x6;
|
||||
u8 field_0x8;
|
||||
u8 offeredItem; /**< @see Item */
|
||||
u8 field_0x9;
|
||||
u16 field_0xa;
|
||||
};
|
||||
@@ -261,7 +261,7 @@ void sub_08028CE8(Entity* this) {
|
||||
subtype = gUnk_080CC9C0[Random() & 7];
|
||||
}
|
||||
|
||||
CreateItemEntity(offer->field_0x8, subtype, 0);
|
||||
CreateItemEntity(offer->offeredItem, subtype, 0);
|
||||
|
||||
this->action = 6;
|
||||
this->actionDelay = 4;
|
||||
@@ -272,12 +272,12 @@ void sub_08028CE8(Entity* this) {
|
||||
#endif
|
||||
return;
|
||||
case 1:
|
||||
CreateItemEntity(offer->field_0x8, offer->field_0x9, 0);
|
||||
CreateItemEntity(offer->offeredItem, offer->field_0x9, 0);
|
||||
this->actionDelay = 4;
|
||||
sub_0802922C(this);
|
||||
return;
|
||||
case 2:
|
||||
CreateItemEntity(offer->field_0x8, offer->field_0x9, 0);
|
||||
CreateItemEntity(offer->offeredItem, offer->field_0x9, 0);
|
||||
this->actionDelay = 8;
|
||||
sub_0802922C(this);
|
||||
return;
|
||||
@@ -466,18 +466,18 @@ void sub_080290FC(Entity* this) {
|
||||
bool32 sub_0802915C(Entity* this) {
|
||||
const struct SalesOffering* offer = (const struct SalesOffering*)this->field_0x7c.WORD;
|
||||
|
||||
switch (offer->field_0x8) {
|
||||
case 0x44:
|
||||
if (GetInventoryValue(0x44) == 0)
|
||||
switch (offer->offeredItem) {
|
||||
case ITEM_GRIP_RING:
|
||||
if (GetInventoryValue(ITEM_GRIP_RING) == 0)
|
||||
return TRUE;
|
||||
break;
|
||||
case 0x1c:
|
||||
case ITEM_BOTTLE1:
|
||||
if (CheckGlobalFlag(AKINDO_BOTTLE_SELL) == 0)
|
||||
return TRUE;
|
||||
break;
|
||||
case 0x5c:
|
||||
case 0x6c:
|
||||
case 0x6f:
|
||||
case ITEM_KINSTONE:
|
||||
case ITEM_BOMBS10:
|
||||
case ITEM_ARROWS30:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@@ -487,13 +487,13 @@ bool32 sub_08029198(const struct SalesOffering* offer) {
|
||||
u32 tmp;
|
||||
|
||||
if ((offer->field_0x0 & 0xfc) != 0xc) {
|
||||
switch (offer->field_0x8) {
|
||||
case 0x1c:
|
||||
switch (offer->offeredItem) {
|
||||
case ITEM_BOTTLE1:
|
||||
tmp = CheckGlobalFlag(AKINDO_BOTTLE_SELL);
|
||||
break;
|
||||
case 0x9:
|
||||
case 0x44:
|
||||
tmp = GetInventoryValue(offer->field_0x8);
|
||||
case ITEM_BOW:
|
||||
case ITEM_GRIP_RING:
|
||||
tmp = GetInventoryValue(offer->offeredItem);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
@@ -512,12 +512,12 @@ bool32 sub_08029198(const struct SalesOffering* offer) {
|
||||
bool32 sub_080291DC(Entity* this) {
|
||||
const struct SalesOffering* offer = (const struct SalesOffering*)this->field_0x7c.WORD;
|
||||
|
||||
switch (offer->field_0x8) {
|
||||
case 0x6c:
|
||||
switch (offer->offeredItem) {
|
||||
case ITEM_BOMBS10:
|
||||
if (gBombBagSizes[gSave.stats.bombBagType] <= gSave.stats.bombCount)
|
||||
return TRUE;
|
||||
break;
|
||||
case 0x6f:
|
||||
case ITEM_ARROWS30:
|
||||
if (gQuiverSizes[gSave.stats.quiverType] <= gSave.stats.arrowCount)
|
||||
return TRUE;
|
||||
break;
|
||||
@@ -532,8 +532,8 @@ NONMATCH("asm/non_matching/businessScrub/sub_0802922C.inc", void sub_0802922C(En
|
||||
this->action = 6;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
|
||||
switch (offer->field_0x8) {
|
||||
case 0x1c:
|
||||
switch (offer->offeredItem) {
|
||||
case ITEM_BOTTLE1:
|
||||
SetGlobalFlag(AKINDO_BOTTLE_SELL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "common.h"
|
||||
#include "functions.h"
|
||||
|
||||
void ClearArmosData(void) {
|
||||
MemClear(&gRoomTransition.armos_data, sizeof(gRoomTransition.armos_data));
|
||||
gRoomTransition.armos_data.field_0xae = 0xff;
|
||||
}
|
||||
|
||||
void sub_080300C4(void) {
|
||||
if (gRoomTransition.armos_data.field_0xae == 0xff) {
|
||||
gRoomTransition.armos_data.field_0xac = 0;
|
||||
MemClear(&gRoomTransition.armos_data.data, sizeof(gRoomTransition.armos_data.data));
|
||||
}
|
||||
}
|
||||
+12
-10
@@ -233,20 +233,21 @@ END_NONMATCH
|
||||
|
||||
void sub_080281A0(Entity* this) {
|
||||
this->field_0xf = 0x19;
|
||||
if (sub_080281E0(0xe)) {
|
||||
this->field_0x80.HALF.LO = 0xe;
|
||||
if (sub_080281E0(ITEM_MIRROR_SHIELD)) {
|
||||
this->field_0x80.HALF.LO = ITEM_MIRROR_SHIELD;
|
||||
MessageFromTarget(0x578);
|
||||
} else if (sub_080281E0(0xd)) {
|
||||
this->field_0x80.HALF.LO = 0xd;
|
||||
} else if (sub_080281E0(ITEM_SHIELD)) {
|
||||
this->field_0x80.HALF.LO = ITEM_SHIELD;
|
||||
MessageFromTarget(0x578);
|
||||
} else {
|
||||
ModHealth(-1);
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_080281E0(u32 param_1) {
|
||||
/** Can steal item */
|
||||
bool32 sub_080281E0(u32 item) {
|
||||
bool32 ret = FALSE;
|
||||
if (GetInventoryValue(param_1) == 1) {
|
||||
if (GetInventoryValue(item) == 1) {
|
||||
if (ItemIsShield(gSave.stats.itemButtons[SLOT_A])) {
|
||||
gSave.stats.itemButtons[SLOT_A] = 0;
|
||||
}
|
||||
@@ -255,18 +256,19 @@ bool32 sub_080281E0(u32 param_1) {
|
||||
gSave.stats.itemButtons[SLOT_B] = 0;
|
||||
}
|
||||
|
||||
sub_0807CAA0(param_1, 0);
|
||||
SetInventoryValue(item, 0);
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void sub_08028224(u32 param_1) {
|
||||
/** Return stolen item */
|
||||
void sub_08028224(u32 item) {
|
||||
#ifdef EU
|
||||
CreateItemEntity(param_1, 0, 1);
|
||||
CreateItemEntity(item, 0, 1);
|
||||
#else
|
||||
sub_080A7C18(param_1, 0, 1);
|
||||
sub_080A7C18(item, 0, 1);
|
||||
#endif
|
||||
MessageFromTarget(0x579);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void RockChuchu_OnCollision(Entity* this) {
|
||||
case 0x18:
|
||||
case 0x19:
|
||||
case 0x1a:
|
||||
if ((gPlayerState.field_0xac & 8) == 0)
|
||||
if ((gPlayerState.skills & SKILL_ROCK_BREAKER) == 0)
|
||||
break;
|
||||
case 0x16:
|
||||
case 0x1c:
|
||||
|
||||
@@ -252,7 +252,7 @@ NONMATCH("asm/non_matching/spearMoblin/sub_08028604.inc", void sub_08028604(Enti
|
||||
} else {
|
||||
u32 iVar3 = sub_08049EE4(this);
|
||||
u32 uVar1;
|
||||
if (this->field_0x82.HALF.HI == '\0') {
|
||||
if (this->field_0x82.HALF.HI == 0) {
|
||||
uVar1 = gUnk_080CC7C0[Random() & 0xf];
|
||||
} else {
|
||||
uVar1 = gUnk_080CC7C0[Random() & 7];
|
||||
|
||||
@@ -371,7 +371,7 @@ void sub_08033E1C(SpinyBeetleEntity* this) {
|
||||
}
|
||||
|
||||
void SpinyBeetle_SetHitType(SpinyBeetleEntity* this) {
|
||||
if ((gPlayerState.field_0xac & 8)) {
|
||||
if ((gPlayerState.skills & SKILL_ROCK_BREAKER)) {
|
||||
super->hitType = 0x95;
|
||||
} else {
|
||||
super->hitType = 0x63;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "global.h"
|
||||
#include "enemy.h"
|
||||
#include "object.h"
|
||||
#include "item.h"
|
||||
|
||||
static bool32 ShouldSpawnTreeItem(Entity*);
|
||||
|
||||
@@ -42,7 +43,7 @@ void TreeItem(Entity* this) {
|
||||
if (this->field_0x68.HALF.LO > FAIRY_INDEX) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->field_0x68.HALF.LO < FAIRY_INDEX && GetInventoryValue(0x67 /*KinstoneBag*/) == 0) {
|
||||
if (this->field_0x68.HALF.LO < FAIRY_INDEX && GetInventoryValue(ITEM_KINSTONE_BAG) == 0) {
|
||||
this->field_0x68.HALF.LO = FAIRY_INDEX;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1078,7 +1078,7 @@ void sub_080409B0(Entity* this) {
|
||||
InitScreenShake(0xc, 1);
|
||||
SoundReq(SFX_BOSS_HIT);
|
||||
}
|
||||
if ((this->bitfield == 0x8a) && (gPlayerState.field_0xa0[0] == 5)) {
|
||||
if ((this->bitfield == 0x8a) && (gPlayerState.chargeState.action == 5)) {
|
||||
this->health = 0xc0;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -14,6 +14,7 @@
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "subtask.h"
|
||||
#include "item.h"
|
||||
|
||||
// copy, erase, start
|
||||
#define NUM_FILE_OPERATIONS 3
|
||||
@@ -485,7 +486,7 @@ void sub_08050A64(u32 idx) {
|
||||
gOamCmd._8 = 0x400;
|
||||
|
||||
// Draw the save file's obtained elements.
|
||||
if (GetInventoryValue(0x40)) {
|
||||
if (GetInventoryValue(ITEM_EARTH_ELEMENT)) {
|
||||
gOamCmd.x = 0xA2;
|
||||
gOamCmd.y = 0x36;
|
||||
#ifdef EU
|
||||
@@ -494,7 +495,7 @@ void sub_08050A64(u32 idx) {
|
||||
DrawDirect(0x145, 0x24);
|
||||
#endif
|
||||
}
|
||||
if (GetInventoryValue(0x41)) {
|
||||
if (GetInventoryValue(ITEM_FIRE_ELEMENT)) {
|
||||
gOamCmd.x = 0x96;
|
||||
gOamCmd.y = 0x3D;
|
||||
#ifdef EU
|
||||
@@ -503,7 +504,7 @@ void sub_08050A64(u32 idx) {
|
||||
DrawDirect(0x145, 0x22);
|
||||
#endif
|
||||
}
|
||||
if (GetInventoryValue(0x42)) {
|
||||
if (GetInventoryValue(ITEM_WATER_ELEMENT)) {
|
||||
gOamCmd.x = 0xAE;
|
||||
gOamCmd.y = 0x3D;
|
||||
#ifdef EU
|
||||
@@ -512,7 +513,7 @@ void sub_08050A64(u32 idx) {
|
||||
DrawDirect(0x145, 0x23);
|
||||
#endif
|
||||
}
|
||||
if (GetInventoryValue(0x43)) {
|
||||
if (GetInventoryValue(ITEM_WIND_ELEMENT)) {
|
||||
gOamCmd.x = 0xA2;
|
||||
gOamCmd.y = 0x44;
|
||||
#ifdef EU
|
||||
|
||||
+4
-3
@@ -2,6 +2,7 @@
|
||||
#include "room.h"
|
||||
#include "flags.h"
|
||||
#include "area.h"
|
||||
#include "save.h"
|
||||
|
||||
const u16 gLocalFlagBanks[] = {
|
||||
FLAG_BANK_G, FLAG_BANK_0, FLAG_BANK_1, FLAG_BANK_2, FLAG_BANK_3, FLAG_BANK_4, FLAG_BANK_5,
|
||||
@@ -40,7 +41,7 @@ u32 CheckRoomFlag(u32 flag) {
|
||||
}
|
||||
|
||||
u32 CheckLocalFlagsByBank(u32 offset, u32 flag, u32 length) {
|
||||
return CheckBits(&gGlobalFlags, offset + flag, length);
|
||||
return CheckBits(gSave.flags, offset + flag, length);
|
||||
}
|
||||
|
||||
u32 CheckLocalFlags(u32 flag, u32 length) {
|
||||
@@ -57,7 +58,7 @@ u32 CheckRoomFlags(u32 flag, u32 length) {
|
||||
|
||||
void SetLocalFlagByBank(u32 offset, u32 flag) {
|
||||
if (flag != 0) {
|
||||
WriteBit(&gGlobalFlags, offset + flag);
|
||||
WriteBit(gSave.flags, offset + flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ void SetRoomFlag(u32 flag) {
|
||||
}
|
||||
|
||||
void ClearLocalFlagByBank(u32 offset, u32 flag) {
|
||||
ClearBit(&gGlobalFlags, offset + flag);
|
||||
ClearBit(gSave.flags, offset + flag);
|
||||
}
|
||||
|
||||
void ClearLocalFlag(u32 flag) {
|
||||
|
||||
+2
-21
@@ -14,29 +14,10 @@ extern u8 gUnk_03003DE0;
|
||||
extern u8 gUnk_03000C30;
|
||||
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern u8 gUnk_03003DF0[];
|
||||
extern Entity gUnk_03003BE0;
|
||||
extern Entity* gPlayerClones[3];
|
||||
extern u16 gUnk_080B2CD8[];
|
||||
|
||||
extern void sub_080ADD70(void);
|
||||
extern void sub_0801C25C(void);
|
||||
extern void UpdateDisplayControls(void);
|
||||
extern void LoadResources(void);
|
||||
extern void HandlePlayerLife(Entity*);
|
||||
extern void DoPlayerAction(Entity*);
|
||||
extern void sub_080171F0(void);
|
||||
extern void sub_08078FB0(Entity*);
|
||||
extern void sub_0807A050(void);
|
||||
extern u32 sub_08079B24(void);
|
||||
extern void sub_08079708(Entity*);
|
||||
extern void CreateSparkle(Entity*);
|
||||
extern void sub_080028E0(Entity*);
|
||||
extern void sub_08078180(void);
|
||||
extern void sub_0807B0C8(void);
|
||||
extern void sub_0807A8D8(Entity*);
|
||||
extern void sub_08077FEC(u32);
|
||||
|
||||
void gIntrMain(void);
|
||||
|
||||
struct {
|
||||
@@ -256,12 +237,12 @@ void HandlePlayerLife(Entity* this) {
|
||||
gPlayerState.flags &= ~(0x2000000 | PL_FALLING);
|
||||
if (gPlayerState.flags & PL_BURNING)
|
||||
ResetPlayer();
|
||||
if ((gPlayerState.flags & PL_CLONING) && !gPlayerState.field_0xa0[0])
|
||||
if ((gPlayerState.flags & PL_CLONING) && gPlayerState.chargeState.action == 0)
|
||||
DeleteClones();
|
||||
if (sub_08079B24() == 0)
|
||||
sub_08079708(this);
|
||||
|
||||
gUnk_03003DF0[0] = 0;
|
||||
gUnk_03003DF0.unk_0 = 0;
|
||||
if (gPlayerState.field_0x27[0] != 0)
|
||||
gPlayerState.field_0x27[0]--;
|
||||
|
||||
|
||||
+1
-2
@@ -3,12 +3,11 @@
|
||||
#include "sound.h"
|
||||
#include "functions.h"
|
||||
#include "playeritem.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BD98[])(ItemBehavior*, u32);
|
||||
|
||||
extern Entity* CreatePlayerBomb();
|
||||
extern s8 gUnk_0811BDAC[];
|
||||
extern void ModBombs(s32);
|
||||
|
||||
void ItemBomb(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BD98[this->stateID](this, arg1);
|
||||
|
||||
+1
-3
@@ -4,8 +4,6 @@
|
||||
|
||||
extern void (*const gUnk_0811BD80[])(ItemBehavior*, u32);
|
||||
|
||||
extern void sub_08077E3C(ItemBehavior*, u32);
|
||||
|
||||
void ItemBow(ItemBehavior* this, u32 arg1) {
|
||||
gUnk_0811BD80[this->stateID](this, arg1);
|
||||
}
|
||||
@@ -78,7 +76,7 @@ void sub_08075F38(ItemBehavior* this, u32 arg1) {
|
||||
|
||||
void sub_08075F84(ItemBehavior* this, u32 arg1) {
|
||||
if (((gPlayerState.field_0x3[1] & 0x80) == 0) && (gPlayerState.field_0x1f[2] != 0)) {
|
||||
if (GetInventoryValue(0x70) == 1) {
|
||||
if (GetInventoryValue(ITEM_ARROW_BUTTERFLY) == 1) {
|
||||
sub_08077E3C(this, 5);
|
||||
} else {
|
||||
UpdateItemAnim(this);
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#include "functions.h"
|
||||
|
||||
void (*const ItemGustJar_StateFunctions[])(ItemBehavior* beh, u32);
|
||||
extern u32 sub_0807A894(Entity*);
|
||||
extern void UpdatePlayerMovement(void);
|
||||
|
||||
void ItemGustJar(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerState.framestate = PL_STATE_GUSTJAR;
|
||||
|
||||
@@ -24,9 +24,9 @@ void sub_08075A0C(ItemBehavior* this, u32 arg1) {
|
||||
itemSlot = IsItemEquipped(this->behaviorID);
|
||||
if (gPlayerState.heldObject != 0 || gPlayerState.queued_action == PLAYER_ROLL || gPlayerState.jump_status != 0 ||
|
||||
gPlayerState.item != NULL || (gPlayerState.flags & PL_MINISH) != 0) {
|
||||
ForceEquipItem(0xf, itemSlot);
|
||||
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
|
||||
gPlayerState.flags &= ~PL_USE_LANTERN;
|
||||
ForceEquipItem(0xf, itemSlot);
|
||||
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
|
||||
sub_08077E78(this, arg1);
|
||||
} else {
|
||||
this->field_0x5[4] |= 0x80;
|
||||
@@ -77,7 +77,7 @@ void sub_08075B54(ItemBehavior* this, u32 arg1) {
|
||||
if ((gPlayerState.flags & (PL_CAPTURED | PL_DISABLE_ITEMS)) == 0) {
|
||||
itemSlot = IsItemEquipped(this->behaviorID);
|
||||
if (!(((sub_08077F10(this) == 0) && (itemSlot < 2)) || (gPlayerState.jump_status != 0))) {
|
||||
ForceEquipItem(0xf, itemSlot);
|
||||
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
|
||||
gPlayerState.flags &= ~PL_USE_LANTERN;
|
||||
sub_08077E78(this, arg1);
|
||||
SoundReq(SFX_ITEM_LANTERN_OFF);
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "item.h"
|
||||
|
||||
// TODO include correct headers?
|
||||
extern void UpdateItemAnim(ItemBehavior*);
|
||||
extern void CreatePlayerBomb(ItemBehavior*, u32);
|
||||
extern void sub_08077E78(ItemBehavior*, u32);
|
||||
extern void sub_08077BB8(ItemBehavior*);
|
||||
extern void sub_0806F948(Entity*);
|
||||
extern void sub_08077D38(ItemBehavior*, u32);
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BDE0[])(ItemBehavior* beh, u32);
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
void sub_08076964(ItemBehavior*, u32);
|
||||
void sub_080768F8(ItemBehavior*, u32);
|
||||
void sub_08076A88(ItemBehavior*, u32);
|
||||
extern bool32 sub_0807A158();
|
||||
extern Entity* CreatePlayerBomb(ItemBehavior*, u32);
|
||||
|
||||
extern u16 gUnk_0800275C[];
|
||||
extern u8 gUnk_0811BE38[];
|
||||
@@ -103,7 +101,8 @@ void sub_08076964(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerState.dash_state = 0x40;
|
||||
gPlayerState.field_0xa &= ~(8 >> arg1);
|
||||
this->stateID++;
|
||||
if (sub_0807A158() && (gPlayerState.flags & PL_MINISH) == 0 && (gPlayerState.field_0xac & 4) != 0) {
|
||||
if (HasSwordEquipped() && (gPlayerState.flags & PL_MINISH) == 0 &&
|
||||
(gPlayerState.skills & SKILL_DASH_ATTACK) != 0) {
|
||||
gPlayerState.field_0xab = 3;
|
||||
sub_08077DF4(this, 0x298);
|
||||
bombEntity = CreatePlayerBomb(this, 0xc);
|
||||
@@ -145,7 +144,7 @@ void sub_08076A88(ItemBehavior* this, u32 arg1) {
|
||||
uVar2 = gUnk_0800275C[(gPlayerEntity.animationState & 0xe) * 4];
|
||||
if (uVar2 == (gPlayerEntity.collisions & uVar2)) {
|
||||
if (this->field_0x5[3] != 0) {
|
||||
gPlayerEntity.action = 6;
|
||||
gPlayerEntity.action = PLAYER_BOUNCE;
|
||||
gPlayerEntity.subAction = 0;
|
||||
COLLISION_OFF(&gPlayerEntity);
|
||||
gPlayerState.field_0x38 = 0;
|
||||
|
||||
@@ -2,15 +2,7 @@
|
||||
#include "entity.h"
|
||||
#include "item.h"
|
||||
#include "sound.h"
|
||||
|
||||
// TODO include correct headers?
|
||||
extern void sub_08077E78(ItemBehavior*, u32);
|
||||
extern void SoundReq(u32);
|
||||
extern void UpdateItemAnim(ItemBehavior*);
|
||||
extern u32 sub_08077EFC(ItemBehavior*);
|
||||
extern void sub_08077BB8(ItemBehavior*);
|
||||
extern void sub_08077D38(ItemBehavior*, u32);
|
||||
extern void sub_0806F948(Entity*);
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0811BDE8[])(ItemBehavior* beh, u32);
|
||||
|
||||
|
||||
+11
-17
@@ -5,19 +5,12 @@
|
||||
#include "playeritem.h"
|
||||
|
||||
extern void (*const gUnk_0811BD44[])(ItemBehavior*, u32);
|
||||
extern void sub_08077B98(ItemBehavior*);
|
||||
extern void UpdatePlayerMovement(void);
|
||||
extern u32 sub_0807B014();
|
||||
extern Entity* CreatePlayerBomb(ItemBehavior*, u32);
|
||||
extern bool32 sub_08077F10(ItemBehavior*);
|
||||
|
||||
void sub_080759B8(ItemBehavior*, u32);
|
||||
void sub_080754B8(ItemBehavior*, u32);
|
||||
void sub_08075898(ItemBehavior*, u32);
|
||||
void sub_08075580(ItemBehavior*, u32);
|
||||
|
||||
extern u32 sub_08077EC8(ItemBehavior*);
|
||||
|
||||
void sub_08075694(ItemBehavior* this, u32 arg1);
|
||||
|
||||
void ItemSword(ItemBehavior* this, u32 arg1) {
|
||||
@@ -38,7 +31,7 @@ void sub_08075338(ItemBehavior* this, u32 arg1) {
|
||||
if (gPlayerState.jump_status) {
|
||||
if ((gPlayerState.jump_status & 7) != 3) {
|
||||
if ((gPlayerState.jump_status & 0x78) == 0 && (u32)gPlayerEntity.zVelocity <= 0x17fff &&
|
||||
(gPlayerState.field_0xac & 0x40) && gPlayerEntity.z.WORD) {
|
||||
(gPlayerState.skills & SKILL_DOWN_THRUST) && gPlayerEntity.z.WORD) {
|
||||
gPlayerState.jump_status |= 0x20;
|
||||
gPlayerState.field_0xab = 7;
|
||||
gPlayerState.field_0x3[1] |= (8 >> arg1) | ((8 >> arg1) << 4);
|
||||
@@ -58,13 +51,14 @@ void sub_08075338(ItemBehavior* this, u32 arg1) {
|
||||
}
|
||||
|
||||
if (gPlayerState.flags & PL_ROLLING) {
|
||||
if ((gPlayerState.field_0xac & 2) == 0) {
|
||||
if ((gPlayerState.skills & SKILL_ROLL_ATTACK) == 0) {
|
||||
if (gPlayerState.item == NULL)
|
||||
return;
|
||||
DeleteEntity(gPlayerState.item);
|
||||
gPlayerState.item = NULL;
|
||||
return;
|
||||
}
|
||||
// Do the roll attack.
|
||||
|
||||
sub_08077D38(this, arg1);
|
||||
sub_08077B98(this);
|
||||
@@ -123,7 +117,7 @@ void sub_080754B8(ItemBehavior* this, u32 arg1) {
|
||||
}
|
||||
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
if (((gPlayerState.flags & 0x80) != 0) || ((gPlayerState.field_0xac & 1) == 0)) {
|
||||
if (((gPlayerState.flags & 0x80) != 0) || ((gPlayerState.skills & SKILL_SPIN_ATTACK) == 0)) {
|
||||
sub_080759B8(this, arg1);
|
||||
} else {
|
||||
sub_08075580(this, arg1);
|
||||
@@ -141,8 +135,8 @@ void sub_08075580(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerState.item->hurtType = 0xd;
|
||||
this->field_0xf = 0;
|
||||
this->stateID = 2;
|
||||
if ((gPlayerState.field_0xac & 0x200) != 0) {
|
||||
this->field_0x5[2] = 0x28;
|
||||
if ((gPlayerState.skills & SKILL_FAST_SPIN) != 0) {
|
||||
this->field_0x5[2] = 0x28; // TODO spin speed?
|
||||
} else {
|
||||
this->field_0x5[2] = 0x50;
|
||||
}
|
||||
@@ -197,8 +191,8 @@ void sub_08075694(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerEntity.hurtType = 0x1e;
|
||||
gPlayerState.sword_state |= 0x40;
|
||||
gPlayerState.sword_state &= 0xdf;
|
||||
if ((gPlayerState.field_0xa0[0] == 0x04) && ((gPlayerState.flags & PL_CLONING) == 0)) {
|
||||
gPlayerState.field_0xa0[0] = 0x01;
|
||||
if ((gPlayerState.chargeState.action == 4) && ((gPlayerState.flags & PL_CLONING) == 0)) {
|
||||
gPlayerState.chargeState.action = 1;
|
||||
DeleteClones();
|
||||
}
|
||||
SoundReq(SFX_PLY_VO2);
|
||||
@@ -223,7 +217,7 @@ void sub_08075738(ItemBehavior* this, u32 arg1) {
|
||||
gPlayerEntity.speed = 0x180;
|
||||
if ((this->field_0x5[9] & 0x80) != 0) {
|
||||
bVar6 = 10;
|
||||
if ((gPlayerState.field_0xac & 0x800) != 0) {
|
||||
if ((gPlayerState.skills & SKILL_LONG_SPIN) != 0) {
|
||||
bVar6 = 0xf;
|
||||
}
|
||||
|
||||
@@ -233,7 +227,7 @@ void sub_08075738(ItemBehavior* this, u32 arg1) {
|
||||
}
|
||||
} else {
|
||||
if (((((gPlayerEntity.frameSpriteSettings & 1) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
|
||||
((gPlayerState.field_0xac & 0x100) != 0))) {
|
||||
((gPlayerState.skills & SKILL_FOURSWORD) != 0))) {
|
||||
Entity* bombEnt = CreatePlayerBomb(this, 0x14);
|
||||
if (bombEnt) {
|
||||
bombEnt->animationState = (gPlayerEntity.animationState & 6) | 0x80;
|
||||
@@ -241,7 +235,7 @@ void sub_08075738(ItemBehavior* this, u32 arg1) {
|
||||
}
|
||||
|
||||
if ((((gPlayerEntity.frameSpriteSettings & 2) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
|
||||
(((gPlayerState.field_0xac & 0x20) != 0 && (--this->field_0x5[2] != 0)))) {
|
||||
(((gPlayerState.skills & SKILL_GREAT_SPIN) != 0 && (--this->field_0x5[2] != 0)))) {
|
||||
gPlayerState.sword_state |= 0x10;
|
||||
gPlayerState.field_0xab = 6;
|
||||
this->field_0x5[6] = gPlayerEntity.animationState << 2;
|
||||
|
||||
@@ -404,7 +404,7 @@ void sub_080594DC(ManagerF* this) {
|
||||
this->manager.action = 1;
|
||||
// fall through
|
||||
case 1:
|
||||
if (!GetInventoryValue(6))
|
||||
if (!GetInventoryValue(ITEM_FOURSWORD))
|
||||
return;
|
||||
if (CheckLocalFlagByBank(0x8c0, 0x85))
|
||||
return;
|
||||
|
||||
@@ -587,8 +587,8 @@ u32 sub_080A4418(u32 param_1, u32 param_2) {
|
||||
}
|
||||
|
||||
void KinstoneMenu_080A4468(void) {
|
||||
gUnk_03003DF0[0].unk[2] = 0;
|
||||
gUnk_03003DF0[0].unk2[3] = 0;
|
||||
gUnk_03003DF0.unk_2 = 0;
|
||||
gUnk_03003DF0.unk_4[3] = 0;
|
||||
sub_0801E6C8(gFuseInfo._3);
|
||||
sub_0801E798(gKinstoneMenu.unk2a);
|
||||
}
|
||||
|
||||
+3
-3
@@ -247,14 +247,14 @@ NONMATCH("asm/non_matching/textbox/MsgInit.inc", /*static*/ u32 MsgInit(void)) {
|
||||
|
||||
for (i = 0; i < FILENAME_LENGTH; ++i) {
|
||||
char c = gSave.name[i];
|
||||
if (c == '\0')
|
||||
if (c == 0)
|
||||
break;
|
||||
*dest++ = c;
|
||||
}
|
||||
|
||||
dest[0] = 2;
|
||||
dest[1] = 0xf; // White text color
|
||||
dest[2] = '\0';
|
||||
dest[2] = 0;
|
||||
sub_08056FBC(&gTextRender);
|
||||
gTextRender.curToken._c = &gUnk_08107BE0;
|
||||
gTextRender._50.unk8 = gTextGfxBuffer;
|
||||
@@ -477,7 +477,7 @@ NONMATCH("asm/non_matching/textbox/RunTextCommand.inc", /*static*/ u16 RunTextCo
|
||||
if (gMessage.unk == 0) {
|
||||
gMessage.unk = 0x80;
|
||||
}
|
||||
this->curToken.extended = '\0';
|
||||
this->curToken.extended = 0;
|
||||
if (chr >> 8 == 7) {
|
||||
this->_90 = this->_8f | 0x80;
|
||||
PaletteChange(this, 0);
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ void sub_08063314(Entity* this) {
|
||||
if (((++this->field_0xf & 0xF) == 0) && (offset = sub_080633C8(this), this->animIndex != offset)) {
|
||||
InitializeAnimation(this, offset);
|
||||
}
|
||||
if (this->interactType != '\0') {
|
||||
if (this->interactType != 0) {
|
||||
MessageFromTarget(this->actionDelay + 0xA01);
|
||||
this->action++;
|
||||
}
|
||||
|
||||
+5
-4
@@ -2,6 +2,7 @@
|
||||
#include "functions.h"
|
||||
#include "screen.h"
|
||||
#include "hitbox.h"
|
||||
#include "item.h"
|
||||
|
||||
extern void (*gUnk_081140D4[])(Entity*);
|
||||
|
||||
@@ -315,11 +316,11 @@ void sub_0806D5D4(void) {
|
||||
u32 itemSlot;
|
||||
|
||||
InitBiggoronTimer();
|
||||
itemSlot = IsItemEquipped(0xd);
|
||||
itemSlot = IsItemEquipped(ITEM_SHIELD);
|
||||
if (itemSlot != 2) {
|
||||
gSave.stats.itemButtons[itemSlot] = 0;
|
||||
}
|
||||
sub_0807CAA0(0xd, 0);
|
||||
SetInventoryValue(ITEM_SHIELD, 0);
|
||||
}
|
||||
|
||||
void sub_0806D600(Entity* this, ScriptExecutionContext* context) {
|
||||
@@ -327,8 +328,8 @@ void sub_0806D600(Entity* this, ScriptExecutionContext* context) {
|
||||
}
|
||||
|
||||
void sub_0806D620(void) {
|
||||
sub_0807CAA0(0xd, 0);
|
||||
sub_080A7C18(0xe, 0, 0);
|
||||
SetInventoryValue(ITEM_SHIELD, 0);
|
||||
sub_080A7C18(ITEM_MIRROR_SHIELD, 0, 0);
|
||||
}
|
||||
|
||||
void sub_0806D638(Entity* this) {
|
||||
|
||||
+19
-23
@@ -9,6 +9,7 @@
|
||||
#include "npc.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "item.h"
|
||||
|
||||
extern void (*gUnk_081115C0[])(Entity*);
|
||||
extern void (*gUnk_081115D0[])(Entity*);
|
||||
@@ -123,7 +124,7 @@ void sub_08068b2c(Entity* this) {
|
||||
|
||||
if (this->interactType == '\x02') {
|
||||
this->action = 2;
|
||||
this->interactType = '\0';
|
||||
this->interactType = 0;
|
||||
uVar1 = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
|
||||
InitAnimationForceUpdate(this, uVar1);
|
||||
sub_0806F118(this);
|
||||
@@ -175,11 +176,11 @@ static void sub_08068BEC(Entity* this, u32 unused) {
|
||||
void sub_08068C28(Entity* this) {
|
||||
this->actionDelay = gUnk_08111623[this->type];
|
||||
if (this->type == 1) {
|
||||
if (GetInventoryValue(0x48)) { // spin attack
|
||||
if (!GetInventoryValue(0x4b)) { // rock breaker
|
||||
if (GetInventoryValue(ITEM_SKILL_SPIN_ATTACK)) {
|
||||
if (!GetInventoryValue(ITEM_SKILL_ROCK_BREAKER)) {
|
||||
this->actionDelay = 1;
|
||||
} else {
|
||||
if (!GetInventoryValue(0x4a)) { // dash attack
|
||||
if (!GetInventoryValue(ITEM_SKILL_DASH_ATTACK)) {
|
||||
this->actionDelay = 2;
|
||||
} else {
|
||||
this->actionDelay = 3;
|
||||
@@ -205,19 +206,19 @@ void sub_08068CA0(Entity* this, ScriptExecutionContext* context) {
|
||||
bVar1 = this->type;
|
||||
if (bVar1 == 1) {
|
||||
context->condition = bVar1;
|
||||
uVar2 = GetInventoryValue(0x48); // spin attack
|
||||
uVar2 = GetInventoryValue(ITEM_SKILL_SPIN_ATTACK);
|
||||
if (uVar2 == 0) {
|
||||
context->condition = 0;
|
||||
}
|
||||
uVar2 = GetInventoryValue(0x4b); // rock breaker
|
||||
uVar2 = GetInventoryValue(ITEM_SKILL_ROCK_BREAKER);
|
||||
if (uVar2 == 0) {
|
||||
context->condition = 0;
|
||||
}
|
||||
uVar2 = GetInventoryValue(0x4a); // dash attack
|
||||
uVar2 = GetInventoryValue(ITEM_SKILL_DASH_ATTACK);
|
||||
if (uVar2 == 0) {
|
||||
context->condition = 0;
|
||||
}
|
||||
uVar2 = GetInventoryValue(0x4e); // down thrust
|
||||
uVar2 = GetInventoryValue(ITEM_SKILL_DOWN_THRUST);
|
||||
if (uVar2 != 0) {
|
||||
return;
|
||||
}
|
||||
@@ -262,34 +263,28 @@ void sub_08068CFC(Entity* this, ScriptExecutionContext* context) {
|
||||
return;
|
||||
goto switchD_08068d12_caseD_0;
|
||||
case 7:
|
||||
uVar2 = GetInventoryValue(0x48); // spin attack
|
||||
if (uVar2 == 0) {
|
||||
if (GetInventoryValue(ITEM_SKILL_SPIN_ATTACK) == 0) {
|
||||
return;
|
||||
}
|
||||
uVar2 = GetInventoryValue(0x49); // roll attack
|
||||
if (uVar2 == 0) {
|
||||
if (GetInventoryValue(ITEM_SKILL_ROLL_ATTACK) == 0) {
|
||||
return;
|
||||
}
|
||||
uVar2 = GetInventoryValue(0x4a); // dash attack
|
||||
if (uVar2 == 0) {
|
||||
if (GetInventoryValue(ITEM_SKILL_DASH_ATTACK) == 0) {
|
||||
return;
|
||||
}
|
||||
uVar2 = GetInventoryValue(0x4b); // rock breaker
|
||||
if (uVar2 == 0) {
|
||||
if (GetInventoryValue(ITEM_SKILL_ROCK_BREAKER) == 0) {
|
||||
return;
|
||||
}
|
||||
uVar2 = GetInventoryValue(0x4c); // sword beam
|
||||
if (uVar2 == 0) {
|
||||
if (GetInventoryValue(ITEM_SKILL_SWORD_BEAM) == 0) {
|
||||
return;
|
||||
}
|
||||
uVar2 = GetInventoryValue(0x4e); // down thrust
|
||||
if (uVar2 == 0) {
|
||||
if (GetInventoryValue(ITEM_SKILL_DOWN_THRUST) == 0) {
|
||||
return;
|
||||
}
|
||||
itemID = 0x4f; // peril beam
|
||||
itemID = ITEM_SKILL_PERIL_BEAM;
|
||||
break;
|
||||
case 10:
|
||||
itemID = 0x4d; // great spin
|
||||
itemID = ITEM_SKILL_GREAT_SPIN;
|
||||
}
|
||||
uVar2 = GetInventoryValue(itemID);
|
||||
LABEL1:
|
||||
@@ -341,8 +336,9 @@ void sub_08068E78(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08068E90(Entity* this) {
|
||||
// Learn a skill.
|
||||
PlayerState* s = &gPlayerState;
|
||||
*(u16*)&s->field_0xac = (1 << (gUnk_08111740[this->actionDelay] - 1)) | *(u16*)&s->field_0xac;
|
||||
*(u16*)&s->skills = (1 << (gUnk_08111740[this->actionDelay] - 1)) | *(u16*)&s->skills;
|
||||
}
|
||||
|
||||
void sub_08068EB4(void) {
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
extern SpriteLoadData gUnk_08110CA8[];
|
||||
|
||||
@@ -68,7 +69,7 @@ void sub_080672B0(Entity* this, ScriptExecutionContext* context) {
|
||||
void sub_080672C8(Entity* this) {
|
||||
u32 dialog = 0;
|
||||
u32 tmp;
|
||||
if (GetInventoryValue(0x11) == 0) {
|
||||
if (GetInventoryValue(ITEM_GUST_JAR) == 0) {
|
||||
if (CheckGlobalFlag(TABIDACHI)) {
|
||||
dialog = 1;
|
||||
}
|
||||
|
||||
+3
-2
@@ -5,6 +5,7 @@
|
||||
#include "flags.h"
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u16 gUnk_08113344[];
|
||||
extern u16 gUnk_0811334A[];
|
||||
@@ -61,7 +62,7 @@ void sub_0806BE84(Entity* this, ScriptExecutionContext* context) {
|
||||
context->condition = 1;
|
||||
}
|
||||
// Graveyard key
|
||||
if (GetInventoryValue(0x3C) >= 2) {
|
||||
if (GetInventoryValue(ITEM_QST_GRAVEYARD_KEY) >= 2) {
|
||||
msgIndex = 2;
|
||||
}
|
||||
MessageNoOverlap(gUnk_08113344[msgIndex], this);
|
||||
@@ -73,7 +74,7 @@ void sub_0806BEC8(Entity* this, ScriptExecutionContext* context) {
|
||||
|
||||
msgIndex = 0;
|
||||
context->condition = 0;
|
||||
hasGraveyardKey = GetInventoryValue(0x3C);
|
||||
hasGraveyardKey = GetInventoryValue(ITEM_QST_GRAVEYARD_KEY);
|
||||
if (hasGraveyardKey == 1) {
|
||||
msgIndex = 1;
|
||||
context->condition = 1;
|
||||
|
||||
+6
-4
@@ -1,6 +1,7 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
extern void (*gUnk_08111D88[])(Entity*);
|
||||
void sub_08069FE8(Entity*);
|
||||
@@ -65,7 +66,8 @@ void sub_08069B44(Entity* this) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_0807DD50(this);
|
||||
}
|
||||
if (((this->type == 0) && ((gPlayerState.flags & PL_MINISH) == 0)) && (GetInventoryValue(0x36) != 2)) {
|
||||
if (((this->type == 0) && ((gPlayerState.flags & PL_MINISH) == 0)) &&
|
||||
(GetInventoryValue(ITEM_QST_DOGFOOD) != 2)) {
|
||||
this->action = 4;
|
||||
}
|
||||
#if defined(JP) || defined(EU) || defined(DEMO_JP)
|
||||
@@ -204,7 +206,7 @@ void sub_08069E50(Entity* this) {
|
||||
if (this->animIndex != this->field_0x6a.HALF.HI + this->animationState) {
|
||||
InitAnimationForceUpdate(this, this->field_0x6a.HALF.HI + this->animationState);
|
||||
}
|
||||
if (GetInventoryValue(0x36) == 2) {
|
||||
if (GetInventoryValue(ITEM_QST_DOGFOOD) == 2) {
|
||||
this->action = 7;
|
||||
InitAnimationForceUpdate(this, 0x29);
|
||||
sub_080788E0(this);
|
||||
@@ -216,7 +218,7 @@ void sub_08069E50(Entity* this) {
|
||||
void sub_08069ECC(Entity* this) {
|
||||
if (UpdateFuseInteraction(this) != 0) {
|
||||
#ifdef EU
|
||||
if (GetInventoryValue(0x36) != 2) {
|
||||
if (GetInventoryValue(ITEM_QST_DOGFOOD) != 2) {
|
||||
this->action = 5;
|
||||
} else {
|
||||
this->action = 1;
|
||||
@@ -340,7 +342,7 @@ void sub_0806A144(Entity* this) {
|
||||
s32 dialog = 4;
|
||||
if (gPlayerState.flags & PL_MINISH) {
|
||||
dialog = 3;
|
||||
if (GetInventoryValue(0x46) == 0 && CheckGlobalFlag(MIZUKAKI_START)) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0 && CheckGlobalFlag(MIZUKAKI_START)) {
|
||||
if (CheckLocalFlag(0x85) == 0) {
|
||||
dialog = 1;
|
||||
} else {
|
||||
|
||||
+5
-3
@@ -1,5 +1,7 @@
|
||||
#include "npc.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u32 gUnk_081133B4;
|
||||
|
||||
void sub_0806BFD8(Entity* this);
|
||||
@@ -56,8 +58,8 @@ void sub_0806C038(Entity* this) {
|
||||
if (index != 0) {
|
||||
index = 0;
|
||||
}
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
if (GetInventoryValue(0x3a) == 0) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0) {
|
||||
if (GetInventoryValue(ITEM_QST_BOOK2) == 0) {
|
||||
index = 6;
|
||||
if (CheckLocalFlag(LEFT_TALK) == 0) {
|
||||
index = 5;
|
||||
@@ -65,7 +67,7 @@ void sub_0806C038(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
index = 7;
|
||||
if (GetInventoryValue(0x3a) > 1) {
|
||||
if (GetInventoryValue(ITEM_QST_BOOK2) > 1) {
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-14
@@ -2,10 +2,7 @@
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "playeritem.h"
|
||||
|
||||
extern void sub_080600F0(Entity*);
|
||||
extern void sub_08060158(Entity*);
|
||||
extern void ModBombs(s32);
|
||||
#include "item.h"
|
||||
|
||||
extern SpriteLoadData gUnk_0810A348;
|
||||
extern u8* gUnk_08109D18[];
|
||||
@@ -150,18 +147,15 @@ void sub_08060208(Entity* this) {
|
||||
void sub_0806021C(Entity* this) {
|
||||
u32 uVar2 = 0;
|
||||
|
||||
// jabber nut
|
||||
if (GetInventoryValue(0x5B)) {
|
||||
if (GetInventoryValue(ITEM_JABBERNUT)) {
|
||||
uVar2 = 1;
|
||||
}
|
||||
|
||||
// earth element
|
||||
if (GetInventoryValue(0x40)) {
|
||||
if (GetInventoryValue(ITEM_EARTH_ELEMENT)) {
|
||||
uVar2 = 2;
|
||||
}
|
||||
|
||||
// mole mitts
|
||||
if (GetInventoryValue(0x13)) {
|
||||
if (GetInventoryValue(ITEM_MOLE_MITTS)) {
|
||||
uVar2 = 3;
|
||||
}
|
||||
ShowNPCDialogue(this, gUnk_08109DC8 + this->type2 * 0x4 + uVar2);
|
||||
@@ -174,8 +168,7 @@ void sub_0806025C(Entity* this) {
|
||||
void sub_08060270(Entity* this) {
|
||||
u32 index;
|
||||
|
||||
// flippers
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0) {
|
||||
index = 1;
|
||||
if (CheckGlobalFlag(MIZUKAKI_START) == 0) {
|
||||
index = 0;
|
||||
@@ -194,8 +187,7 @@ void sub_08060270(Entity* this) {
|
||||
void sub_080602BC(Entity* this) {
|
||||
u32 index;
|
||||
|
||||
// spin attack
|
||||
if (GetInventoryValue(0x48) != 0) {
|
||||
if (GetInventoryValue(ITEM_SKILL_SPIN_ATTACK) != 0) {
|
||||
index = (Random() & 1) + 2;
|
||||
} else {
|
||||
if (gSave.stats.bombCount < gBombBagSizes[gSave.stats.bombBagType]) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "script.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u16 gUnk_081104F8[];
|
||||
|
||||
@@ -81,9 +82,9 @@ void sub_0806673C(Entity* this) {
|
||||
u32 index;
|
||||
if (CheckGlobalFlag(2) == 0) {
|
||||
index = 0;
|
||||
} else if (GetInventoryValue(2) == 0) {
|
||||
} else if (GetInventoryValue(ITEM_GREEN_SWORD) == 0) {
|
||||
index = 1;
|
||||
} else if (GetInventoryValue(3) == 0) {
|
||||
} else if (GetInventoryValue(ITEM_RED_SWORD) == 0) {
|
||||
index = 2;
|
||||
} else {
|
||||
index = 3;
|
||||
|
||||
+2
-2
@@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u16 gUnk_08112D48[];
|
||||
|
||||
@@ -37,8 +38,7 @@ void sub_0806B260(Entity* this, ScriptExecutionContext* context) {
|
||||
u32 index;
|
||||
|
||||
context->condition = 0;
|
||||
// flippers
|
||||
if (!GetInventoryValue(0x46)) {
|
||||
if (!GetInventoryValue(ITEM_FLIPPERS)) {
|
||||
if (CheckGlobalFlag(MIZUKAKI_START)) {
|
||||
index = 2;
|
||||
context->condition = 1;
|
||||
|
||||
+14
-14
@@ -4,6 +4,7 @@
|
||||
#include "flags.h"
|
||||
#include "message.h"
|
||||
#include "sound.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u16 gUnk_08113078[];
|
||||
|
||||
@@ -15,33 +16,32 @@ ASM_FUNC("asm/non_matching/librarians/sub_0806BA34.inc",
|
||||
void sub_0806BA34(Entity* this, ScriptExecutionContext* context))
|
||||
|
||||
void sub_0806BB1C(Entity* this, ScriptExecutionContext* context) {
|
||||
s32 tmp;
|
||||
|
||||
tmp = 0xffffffff;
|
||||
if (GetInventoryValue(0x39) == 1) {
|
||||
tmp = 0x39;
|
||||
} else if (GetInventoryValue(0x3a) == 1) {
|
||||
tmp = 0x3a;
|
||||
s32 item = 0xffffffff;
|
||||
if (GetInventoryValue(ITEM_QST_BOOK1) == 1) {
|
||||
item = ITEM_QST_BOOK1;
|
||||
} else if (GetInventoryValue(ITEM_QST_BOOK2) == 1) {
|
||||
item = ITEM_QST_BOOK2;
|
||||
} else {
|
||||
if (GetInventoryValue(0x3b) == 1) {
|
||||
tmp = 0x3b;
|
||||
if (GetInventoryValue(ITEM_QST_BOOK3) == 1) {
|
||||
item = ITEM_QST_BOOK3;
|
||||
}
|
||||
if (tmp < 1) {
|
||||
if (item < 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (context->intVariable == 0) {
|
||||
sub_08095BE0(this, tmp);
|
||||
sub_08095BE0(this, item);
|
||||
InitializeAnimation(this, 0xc);
|
||||
SoundReq(SFX_TASK_COMPLETE);
|
||||
} else {
|
||||
sub_0807CAA0(tmp, 2);
|
||||
SetInventoryValue(item, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0806BB7C(Entity* this, ScriptExecutionContext* context) {
|
||||
context->condition = 0;
|
||||
if ((GetInventoryValue(0x39) == 2) && (GetInventoryValue(0x3a) == 2) && (GetInventoryValue(0x3b) == 2)) {
|
||||
if ((GetInventoryValue(ITEM_QST_BOOK1) == 2) && (GetInventoryValue(ITEM_QST_BOOK2) == 2) &&
|
||||
(GetInventoryValue(ITEM_QST_BOOK3) == 2)) {
|
||||
SetLocalFlag(0x73);
|
||||
context->condition = 1;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ void sub_0806BB7C(Entity* this, ScriptExecutionContext* context) {
|
||||
void sub_0806BBB0(Entity* this) {
|
||||
u32 tmp;
|
||||
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0) {
|
||||
if (CheckGlobalFlag(0x29)) {
|
||||
tmp = 1;
|
||||
} else {
|
||||
|
||||
+8
-7
@@ -2,6 +2,7 @@
|
||||
#include "functions.h"
|
||||
#include "flags.h"
|
||||
#include "message.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u16 gUnk_0810C34C[];
|
||||
|
||||
@@ -16,25 +17,25 @@ void Marcy(Entity* this) {
|
||||
|
||||
void sub_08062D18(Entity* this, ScriptExecutionContext* context) {
|
||||
u8 tmp = 0;
|
||||
if ((GetInventoryValue(0x4f) != 0) && (CheckLocalFlag(0x26) == 0)) {
|
||||
if ((GetInventoryValue(ITEM_SKILL_PERIL_BEAM) != 0) && (CheckLocalFlag(0x26) == 0)) {
|
||||
tmp = 7;
|
||||
}
|
||||
if ((GetInventoryValue(0x4e) != 0) && (CheckLocalFlag(0x25) == 0)) {
|
||||
if ((GetInventoryValue(ITEM_SKILL_DOWN_THRUST) != 0) && (CheckLocalFlag(0x25) == 0)) {
|
||||
tmp = 6;
|
||||
}
|
||||
if ((GetInventoryValue(0x4d) != 0) && (CheckLocalFlag(0x24) == 0)) {
|
||||
if ((GetInventoryValue(ITEM_SKILL_GREAT_SPIN) != 0) && (CheckLocalFlag(0x24) == 0)) {
|
||||
tmp = 5;
|
||||
}
|
||||
if ((GetInventoryValue(0x4c) != 0) && (CheckLocalFlag(0x23) == 0)) {
|
||||
if ((GetInventoryValue(ITEM_SKILL_SWORD_BEAM) != 0) && (CheckLocalFlag(0x23) == 0)) {
|
||||
tmp = 4;
|
||||
}
|
||||
if ((GetInventoryValue(0x4b) != 0) && (CheckLocalFlag(0x22) == 0)) {
|
||||
if ((GetInventoryValue(ITEM_SKILL_ROCK_BREAKER) != 0) && (CheckLocalFlag(0x22) == 0)) {
|
||||
tmp = 3;
|
||||
}
|
||||
if ((GetInventoryValue(0x4a) != 0) && (CheckLocalFlag(0x21) == 0)) {
|
||||
if ((GetInventoryValue(ITEM_SKILL_DASH_ATTACK) != 0) && (CheckLocalFlag(0x21) == 0)) {
|
||||
tmp = 2;
|
||||
}
|
||||
if ((GetInventoryValue(0x49) != 0) && (CheckLocalFlag(0x20) == 0)) {
|
||||
if ((GetInventoryValue(ITEM_SKILL_ROLL_ATTACK) != 0) && (CheckLocalFlag(0x20) == 0)) {
|
||||
tmp = 1;
|
||||
}
|
||||
this->type2 = tmp;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "flags.h"
|
||||
#include "npc.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u32 gUnk_08113F44;
|
||||
extern Dialog gUnk_08113F48[];
|
||||
@@ -50,8 +51,7 @@ void sub_0806CE80(Entity* this) {
|
||||
u32 v2;
|
||||
v = gSave.global_progress;
|
||||
if (v == 5) {
|
||||
// flippers
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0) {
|
||||
if (CheckLocalFlag(0x70) != 0) {
|
||||
v2 = CheckLocalFlag(MIZUKAKI_HINT3_MAYOR);
|
||||
if (v2 == 0) {
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
#include "npc.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
|
||||
extern void sub_08068780(Entity*);
|
||||
|
||||
@@ -134,8 +135,8 @@ void sub_08068910(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08068964(Entity* this) {
|
||||
sub_080A7C18(53, 0, 3);
|
||||
sub_0807CAA0(53, 2);
|
||||
sub_080A7C18(ITEM_QST_BROKEN_SWORD, 0, 3);
|
||||
SetInventoryValue(ITEM_QST_BROKEN_SWORD, 2);
|
||||
}
|
||||
|
||||
void Melari_Fusion(Entity* this) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "flags.h"
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
extern void (*const gUnk_08110644[])(Entity*);
|
||||
void sub_08066864(Entity*);
|
||||
@@ -83,9 +84,9 @@ void sub_08066904(Entity* this) {
|
||||
u32 index;
|
||||
if (CheckGlobalFlag(2) == 0) {
|
||||
index = 0;
|
||||
} else if (GetInventoryValue(2) == 0) {
|
||||
} else if (GetInventoryValue(ITEM_GREEN_SWORD) == 0) {
|
||||
index = 1;
|
||||
} else if (GetInventoryValue(3) == 0) {
|
||||
} else if (GetInventoryValue(ITEM_RED_SWORD) == 0) {
|
||||
index = 2;
|
||||
} else {
|
||||
index = 3;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "message.h"
|
||||
#include "flags.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
const u8 gUnk_08111284[][0x20] = {
|
||||
{ 0x8, 0x1, 0x9, 0x1, 0xa, 0x1, 0xb, 0x83, 0xc, 0x83, 0xd, 0x83, 0xe, 0x83, 0xf, 0x80,
|
||||
@@ -226,10 +227,10 @@ void sub_08068190(Entity* this) {
|
||||
if (CheckLocalFlag(0x7e)) {
|
||||
uVar2 = 1;
|
||||
}
|
||||
if (GetInventoryValue(0x41) != 0) {
|
||||
if (GetInventoryValue(ITEM_FIRE_ELEMENT) != 0) {
|
||||
uVar2 = 2;
|
||||
}
|
||||
if (GetInventoryValue(2) != 0) {
|
||||
if (GetInventoryValue(ITEM_GREEN_SWORD) != 0) {
|
||||
uVar2 = 3;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@
|
||||
#include "flags.h"
|
||||
#include "message.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
extern SpriteLoadData gUnk_08110C00;
|
||||
extern u16 gUnk_08110C0C[];
|
||||
@@ -51,7 +52,7 @@ void sub_080670B4(Entity* this) {
|
||||
u32 uVar2;
|
||||
|
||||
uVar2 = 0;
|
||||
if (GetInventoryValue(0x11) == 0) {
|
||||
if (GetInventoryValue(ITEM_GUST_JAR) == 0) {
|
||||
if (CheckGlobalFlag(TABIDACHI)) {
|
||||
uVar2 = 1;
|
||||
}
|
||||
|
||||
+12
-11
@@ -8,6 +8,7 @@
|
||||
#include "npc.h"
|
||||
#include "game.h"
|
||||
#include "hitbox.h"
|
||||
#include "item.h"
|
||||
|
||||
typedef struct {
|
||||
u32 unk_00;
|
||||
@@ -155,30 +156,30 @@ u32 sub_0806DBF4(u32 param_1) {
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
param_1 = 1;
|
||||
if (GetInventoryValue(2) != 0) {
|
||||
param_1 = 2;
|
||||
param_1 = ITEM_SMITH_SWORD;
|
||||
if (GetInventoryValue(ITEM_GREEN_SWORD) != 0) {
|
||||
param_1 = ITEM_GREEN_SWORD;
|
||||
}
|
||||
if (GetInventoryValue(3) != 0) {
|
||||
param_1 = 3;
|
||||
if (GetInventoryValue(ITEM_RED_SWORD) != 0) {
|
||||
param_1 = ITEM_RED_SWORD;
|
||||
}
|
||||
if (GetInventoryValue(4) != 0) {
|
||||
param_1 = 4;
|
||||
if (GetInventoryValue(ITEM_BLUE_SWORD) != 0) {
|
||||
param_1 = ITEM_BLUE_SWORD;
|
||||
}
|
||||
if (GetInventoryValue(6) != 0) {
|
||||
param_1 = 6;
|
||||
if (GetInventoryValue(ITEM_FOURSWORD) != 0) {
|
||||
param_1 = ITEM_FOURSWORD;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return param_1;
|
||||
}
|
||||
|
||||
void sub_0806DC3C(Entity* this) {
|
||||
void NPC4E_SaveEquippedItems(Entity* this) {
|
||||
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) {
|
||||
void NPC4E_RestoreEquippedItems(Entity* this) {
|
||||
ForceEquipItem(sub_0806DBF4(this->field_0x68.HALF.LO), 0);
|
||||
ForceEquipItem(sub_0806DBF4(this->field_0x68.HALF.HI), 1);
|
||||
}
|
||||
|
||||
+10
-8
@@ -1,5 +1,6 @@
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
#include "item.h"
|
||||
|
||||
extern Hitbox gUnk_0810C428;
|
||||
|
||||
@@ -23,11 +24,12 @@ void Pita(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Reset the players baked goods? */
|
||||
void sub_08062EB8(void) {
|
||||
sub_0807CAA0(0x68, 0);
|
||||
sub_0807CAA0(0x69, 0);
|
||||
sub_0807CAA0(0x6a, 0);
|
||||
sub_0807CAA0(0x6b, 0);
|
||||
SetInventoryValue(ITEM_BRIOCHE, 0);
|
||||
SetInventoryValue(ITEM_CROISSANT, 0);
|
||||
SetInventoryValue(ITEM_PIE, 0);
|
||||
SetInventoryValue(ITEM_CAKE, 0);
|
||||
}
|
||||
|
||||
bool32 sub_08062EDC(Entity* this, ScriptExecutionContext* context) {
|
||||
@@ -35,16 +37,16 @@ bool32 sub_08062EDC(Entity* this, ScriptExecutionContext* context) {
|
||||
u32 tmp2;
|
||||
|
||||
//! @bug: tmp is uninitialized, in practice player must have an item here
|
||||
if (GetInventoryValue(0x68) != 0) {
|
||||
if (GetInventoryValue(ITEM_BRIOCHE) != 0) {
|
||||
tmp = 0;
|
||||
}
|
||||
if (GetInventoryValue(0x69) != 0) {
|
||||
if (GetInventoryValue(ITEM_CROISSANT) != 0) {
|
||||
tmp = 1;
|
||||
}
|
||||
if (GetInventoryValue(0x6a) != 0) {
|
||||
if (GetInventoryValue(ITEM_PIE) != 0) {
|
||||
tmp = 2;
|
||||
}
|
||||
if (GetInventoryValue(0x6b) != 0) {
|
||||
if (GetInventoryValue(ITEM_CAKE) != 0) {
|
||||
tmp = 3;
|
||||
}
|
||||
if (CheckLocalFlag(SHOP03_PAN_1ST) == 0) {
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
#include "object.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u16 gUnk_0810FA54[];
|
||||
|
||||
@@ -93,7 +94,7 @@ void sub_08064CC0(Entity* this) {
|
||||
void sub_08064CD8(Entity* this) {
|
||||
u32 flag;
|
||||
u32 tmp = 2;
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0) {
|
||||
if (CheckLocalFlag(0x73)) {
|
||||
tmp = 1;
|
||||
} else {
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
#include "npc.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
|
||||
extern void (*gUnk_0810FEC4[])(Entity* this);
|
||||
extern void (*gUnk_0810FEBC[])(Entity* this);
|
||||
@@ -102,7 +103,7 @@ void sub_080656D4(Entity* this) {
|
||||
goto label;
|
||||
} else {
|
||||
if (this->interactType != 0) {
|
||||
if (GetInventoryValue(0x37) != 0) { // keyLonLon
|
||||
if (GetInventoryValue(ITEM_QST_LONLON_KEY) != 0) {
|
||||
StartCutscene(this, (u16*)&script_TalonGotKey);
|
||||
goto label2;
|
||||
} else {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "entity.h"
|
||||
#include "npc.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
|
||||
extern u32 sub_080002C0(u32, u32, u32);
|
||||
extern void sub_0806ACC4(Entity*);
|
||||
@@ -250,7 +251,7 @@ void sub_0806B004(Entity* this, ScriptExecutionContext* context) {
|
||||
|
||||
if (CheckGlobalFlag(MIZUKAKI_START)) {
|
||||
if (CheckLocalFlag(0x73)) {
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0) {
|
||||
idx = 3;
|
||||
if (CheckLocalFlag(KHOUSE51_00) == 0) {
|
||||
idx = 2;
|
||||
@@ -283,7 +284,7 @@ void sub_0806B064(Entity* this) {
|
||||
void sub_0806B098(Entity* this) {
|
||||
int idx = 2;
|
||||
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0) {
|
||||
idx = 1;
|
||||
if (CheckGlobalFlag(MIZUKAKI_START)) {
|
||||
if (!CheckGlobalFlag(MIZUKAKI_HARIFALL)) {
|
||||
@@ -308,7 +309,7 @@ void sub_0806B0E0(Entity* this) {
|
||||
void sub_0806B134(Entity* this) {
|
||||
int idx;
|
||||
|
||||
if (GetInventoryValue(0x45)) {
|
||||
if (GetInventoryValue(ITEM_POWER_BRACELETS)) {
|
||||
idx = 2;
|
||||
if (CheckLocalFlag(KHOUSE42_00) == 0) {
|
||||
idx = 1;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "npc.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
|
||||
typedef struct {
|
||||
u8 frame1;
|
||||
@@ -252,7 +253,7 @@ void sub_0806200C(Entity* this) {
|
||||
if ((CheckGlobalFlag(MIZUKAKI_START) != 0) && (CheckLocalFlag(0x6b))) {
|
||||
|
||||
// hyrule bestiary
|
||||
if (GetInventoryValue(0x39) == 2) {
|
||||
if (GetInventoryValue(ITEM_QST_BOOK1) == 2) {
|
||||
index = 2;
|
||||
} else {
|
||||
index = 1;
|
||||
|
||||
@@ -50,7 +50,7 @@ void sub_0806C7D4(Entity* this) {
|
||||
|
||||
if (this->interactType == '\x02') {
|
||||
this->action = 3;
|
||||
this->interactType = '\0';
|
||||
this->interactType = 0;
|
||||
sub_0806F118(this);
|
||||
} else {
|
||||
sub_0807DD94(this, NULL);
|
||||
|
||||
@@ -67,8 +67,8 @@ void sub_08098DC4(Entity* this) {
|
||||
gPlayerEntity.collisionLayer = 1;
|
||||
SortEntityAbove(this, &gPlayerEntity);
|
||||
gPlayerState.queued_action = PLAYER_PARACHUTE;
|
||||
gPlayerState.field_0x34[4] = 1;
|
||||
gPlayerState.field_0x34[5] = this->type2;
|
||||
gPlayerState.field_0x38 = 1;
|
||||
gPlayerState.field_0x39 = this->type2;
|
||||
this->action = 4;
|
||||
if (this->type2 == 1) {
|
||||
SetGlobalFlag(TATSUMAKI);
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ void Book(Entity* this) {
|
||||
void sub_0809B3C4(Entity* this) {
|
||||
u32 obtained;
|
||||
|
||||
obtained = GetInventoryValue(this->type + 0x39);
|
||||
obtained = GetInventoryValue(this->type + ITEM_QST_BOOK1);
|
||||
if (this->type2 != 3) {
|
||||
if (obtained) {
|
||||
DeleteThisEntity();
|
||||
@@ -188,7 +188,7 @@ void sub_0809B5EC(Entity* this) {
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
if (GetInventoryValue(this->type + 0x39) == 2) {
|
||||
if (GetInventoryValue(this->type + ITEM_QST_BOOK1) == 2) {
|
||||
this->subAction = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ void sub_08081BE0(Entity* this) {
|
||||
if (!sub_08081D28(this)) {
|
||||
this->action = 4;
|
||||
this->field_0xf = 1;
|
||||
if ((gPlayerState.heldObject == 2) || (!(gPlayerState.field_0x34[1] & 0x80))) {
|
||||
if ((gPlayerState.heldObject == 2) || (!(gPlayerState.field_0x35 & 0x80))) {
|
||||
this->actionDelay = 0x18;
|
||||
} else {
|
||||
this->actionDelay = 0x8;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ extern void (*gUnk_081247AC[])(Entity*);
|
||||
extern void* gUnk_080DD750;
|
||||
extern u8 gUnk_081247C0[];
|
||||
extern u16 gUnk_081247C8[];
|
||||
extern u32 gUnk_081247D0;
|
||||
extern u16 gUnk_081247D0;
|
||||
|
||||
void Cloud(Entity* this) {
|
||||
gUnk_08124798[this->type](this);
|
||||
|
||||
@@ -159,7 +159,7 @@ void sub_080819B4(ItemForSaleEntity* this) {
|
||||
void sub_08081A5C(ItemForSaleEntity* this) {
|
||||
u32 tmp = sub_080787D8(super);
|
||||
if (super->actionDelay == 1) {
|
||||
gUnk_03003DF0[tmp].unk4[2] = 0;
|
||||
gUnk_03003DF0.array[tmp].unk_2 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ void Object43_Init(Object43Entity* this) {
|
||||
super->actionDelay = 0x28;
|
||||
} else {
|
||||
super->spriteSettings.draw = 1;
|
||||
if ((gPlayerState.field_0xac & 0x200) != 0) {
|
||||
if ((gPlayerState.skills & SKILL_FAST_SPIN) != 0) {
|
||||
super->actionDelay = 0x28;
|
||||
} else {
|
||||
super->actionDelay = 0x50;
|
||||
@@ -102,7 +102,7 @@ void Object43_Action1(Object43Entity* this) {
|
||||
if (super->actionDelay != 0) {
|
||||
super->actionDelay--;
|
||||
tmp2 = 3;
|
||||
if ((super->type2 == 0) && ((gPlayerState.field_0xac & 0x200) == 0)) {
|
||||
if ((super->type2 == 0) && ((gPlayerState.skills & SKILL_FAST_SPIN) == 0)) {
|
||||
tmp2 = 7;
|
||||
}
|
||||
if ((super->actionDelay & tmp2) == 0) {
|
||||
|
||||
@@ -402,7 +402,7 @@ void sub_08094FA8(Object6AEntity* this) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (GetInventoryValue(54) == 2) {
|
||||
if (GetInventoryValue(ITEM_QST_DOGFOOD) == 2) {
|
||||
super->action = 3;
|
||||
super->spriteSettings.draw = 1;
|
||||
}
|
||||
@@ -437,7 +437,7 @@ void sub_08095088(Object6AEntity* this) {
|
||||
|
||||
switch (super->action) {
|
||||
case 0:
|
||||
if (GetInventoryValue(91))
|
||||
if (GetInventoryValue(ITEM_JABBERNUT))
|
||||
DeleteThisEntity();
|
||||
super->action = 1;
|
||||
super->spritePriority.b0 = 7;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "object.h"
|
||||
#include "item.h"
|
||||
|
||||
void sub_08099ECC(Entity*);
|
||||
extern void sub_0805B390(u32);
|
||||
@@ -14,7 +15,7 @@ void sub_08099DD0(Entity* this) {
|
||||
this->spriteRendering.b3 = 3;
|
||||
this->spritePriority.b0 = 7;
|
||||
this->subAction = 0;
|
||||
if (GetInventoryValue(0x46)) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS)) {
|
||||
this->action = 4;
|
||||
this->frameIndex = 0;
|
||||
} else {
|
||||
@@ -68,6 +69,6 @@ void sub_08099ECC(Entity* this) {
|
||||
this->subAction = 1;
|
||||
CopyPosition(this, &gPlayerEntity);
|
||||
gPlayerState.queued_action = PLAYER_FALL;
|
||||
gPlayerState.field_0x34[4] = 0;
|
||||
gPlayerState.field_0x38 = 0;
|
||||
gPlayerState.flags |= PL_FLAGS8000;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) {
|
||||
case 0x18:
|
||||
case 0x19:
|
||||
case 0x1a:
|
||||
if (super->type == 0 || (gPlayerState.field_0xac & 8) != 0) {
|
||||
if (super->type == 0 || (gPlayerState.skills & SKILL_ROCK_BREAKER) != 0) {
|
||||
sub_080989C0(this);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
#include "functions.h"
|
||||
#include "effects.h"
|
||||
|
||||
extern void sub_0809E96C(Entity*);
|
||||
extern void CreateSparkle(Entity*);
|
||||
extern u32 sub_0809E9A0(void);
|
||||
extern void sub_0809E918(Entity*);
|
||||
extern void CreateMinishEntrance(u32 tile);
|
||||
|
||||
extern void (*const gUnk_08124354[])(Entity*);
|
||||
|
||||
extern s16 gUnk_08124364[];
|
||||
|
||||
+5
-6
@@ -271,7 +271,6 @@ extern void sub_08079258(void);
|
||||
extern void EnablePlayerDraw(Entity*);
|
||||
extern u32 sub_08079B24(void);
|
||||
extern void sub_08079708(Entity*);
|
||||
extern Entity* CreatePlayerBomb(Entity*, u32);
|
||||
extern u32 sub_0806F854(Entity*, s32, s32);
|
||||
extern u32 UpdatePlayerCollision(void);
|
||||
extern void sub_08079744(Entity*);
|
||||
@@ -1640,7 +1639,7 @@ static void sub_08071DD0(Entity* this) {
|
||||
}
|
||||
|
||||
static void sub_08071E04(Entity* this) {
|
||||
if ((this->z.WORD != 0) && (gPlayerState.field_0x14 == '\0')) {
|
||||
if ((this->z.WORD != 0) && (gPlayerState.field_0x14 == 0)) {
|
||||
UpdateFloorType();
|
||||
if (gPlayerState.floor_type == SURFACE_PIT) {
|
||||
gPlayerState.field_0x11 = 7;
|
||||
@@ -1689,7 +1688,7 @@ static void PlayerEmptyBottleInit(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
ResetPlayer();
|
||||
ent = CreatePlayerBomb(this, 0xe);
|
||||
ent = CreatePlayerBomb((ItemBehavior*)this, 0xe);
|
||||
if (ent != NULL) {
|
||||
ent->field_0x68.HALF.LO = gPlayerState.field_0x38;
|
||||
this->subAction++;
|
||||
@@ -1702,7 +1701,7 @@ static void PlayerEmptyBottleInit(Entity* this) {
|
||||
break;
|
||||
default:
|
||||
gPlayerState.animation = 0x610;
|
||||
sub_0807CAA0(gPlayerState.field_0x38, 2);
|
||||
SetInventoryValue(gPlayerState.field_0x38, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3472,7 +3471,7 @@ void SurfaceAction_14(Entity* this) {
|
||||
}
|
||||
|
||||
void SurfaceAction_CloneTile(Entity* this) {
|
||||
if (gPlayerState.field_0xa0[0] == 4) {
|
||||
if (gPlayerState.chargeState.action == 4) {
|
||||
u32 item, n, i;
|
||||
if (ItemIsSword(gSave.stats.itemButtons[SLOT_A])) {
|
||||
item = gSave.stats.itemButtons[SLOT_A];
|
||||
@@ -3533,7 +3532,7 @@ void SurfaceAction_16(Entity* this) {
|
||||
}
|
||||
|
||||
void SurfaceAction_Ice(Entity* this) {
|
||||
if (!sub_080741C4() && ((gPlayerState.field_0x34[1] & 0x80) == 0 || this->knockbackDuration != 0)) {
|
||||
if (!sub_080741C4() && ((gPlayerState.field_0x35 & 0x80) == 0 || this->knockbackDuration != 0)) {
|
||||
ResetPlayerVelocity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "sound.h"
|
||||
#include "functions.h"
|
||||
#include "asm.h"
|
||||
#include "item.h"
|
||||
|
||||
void sub_0801B804(Entity*);
|
||||
Entity* sub_0801B864(Entity*);
|
||||
@@ -206,7 +207,7 @@ void sub_0801B804(Entity* this) {
|
||||
u32 itemSlot;
|
||||
u32 uVar1;
|
||||
|
||||
itemSlot = IsItemEquipped(0xc);
|
||||
itemSlot = IsItemEquipped(ITEM_MAGIC_BOOMERANG);
|
||||
switch (itemSlot) {
|
||||
case 0:
|
||||
uVar1 = 1;
|
||||
|
||||
@@ -78,7 +78,7 @@ void sub_0801B938(Entity* this) {
|
||||
|
||||
this->hitbox = (Hitbox*)&gUnk_080B7850[this->animationState >> 1];
|
||||
ptr = &gUnk_080B7848[(this->animationState >> 1) * 2];
|
||||
sub_08008782(this, -(gPlayerState.field_0xac & 8) != 0, ptr[0], ptr[1]);
|
||||
sub_08008782(this, -(gPlayerState.skills & SKILL_ROCK_BREAKER) != 0, ptr[0], ptr[1]);
|
||||
sub_08078E84(this, &gPlayerEntity);
|
||||
}
|
||||
|
||||
|
||||
+1873
File diff suppressed because it is too large
Load Diff
@@ -1,38 +0,0 @@
|
||||
#include "player.h"
|
||||
#include "functions.h"
|
||||
|
||||
void ResetPlayer() {
|
||||
u32 index = 0;
|
||||
ItemBehavior* ptr = gUnk_03000B80;
|
||||
do {
|
||||
sub_08077E78(ptr, index);
|
||||
ptr++;
|
||||
index++;
|
||||
} while (index <= 2);
|
||||
|
||||
gPlayerState.field_0x3c[1] = 0;
|
||||
gPlayerState.field_0x1c = 0;
|
||||
gPlayerState.field_0x1f[2] = 0;
|
||||
gPlayerState.field_0x0[1] = 0;
|
||||
gPlayerState.field_0xe = 0;
|
||||
gPlayerState.dash_state = 0;
|
||||
gPlayerState.sword_state = 0;
|
||||
gPlayerState.field_0x3[0] = 0;
|
||||
gPlayerState.heldObject = 0;
|
||||
gPlayerState.flags &= ~(PL_ROLLING | PL_SWORD_THRUST);
|
||||
|
||||
gPlayerEntity.field_0x70.WORD = 0;
|
||||
|
||||
if ((gPlayerState.jump_status & 0xc0) == 0) {
|
||||
gPlayerState.jump_status = 0;
|
||||
}
|
||||
|
||||
switch (gPlayerState.framestate) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4: {
|
||||
gPlayerState.framestate = PL_STATE_IDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
-20
@@ -169,7 +169,7 @@ u32 sub_unk3_CrenelMinishPaths_MelarisMine(void) {
|
||||
void sub_StateChange_CrenelMinishPaths_MelarisMine(void) {
|
||||
sub_080580B0(0x22);
|
||||
// white sword
|
||||
if (GetInventoryValue(0x2))
|
||||
if (GetInventoryValue(ITEM_GREEN_SWORD))
|
||||
SetGlobalFlag(WHITE_SWORD_END);
|
||||
}
|
||||
|
||||
@@ -341,8 +341,7 @@ extern EntityData gUnk_080D6558;
|
||||
extern EntityData gUnk_080D6618;
|
||||
|
||||
void sub_StateChange_HouseInteriors1_Library2F(void) {
|
||||
// flippers
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080D6578);
|
||||
if (CheckLocalFlag(MIZUKAKI_BOOK_ALLBACK) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080D6638);
|
||||
@@ -366,8 +365,7 @@ void sub_StateChange_HouseInteriors1_Library1F(void) {
|
||||
if (gSave.global_progress > 4) {
|
||||
LoadRoomEntityList(&gUnk_080D6714);
|
||||
}
|
||||
// flippers
|
||||
if (!GetInventoryValue(0x46) && CheckGlobalFlag(MIZUKAKI_START) && CheckLocalFlag(MIZUKAKI_KOBITO)) {
|
||||
if (!GetInventoryValue(ITEM_FLIPPERS) && CheckGlobalFlag(MIZUKAKI_START) && CheckLocalFlag(MIZUKAKI_KOBITO)) {
|
||||
LoadRoomEntityList(&gUnk_additional_9_HouseInteriors1_Library1F);
|
||||
} else {
|
||||
LoadRoomEntityList(&gUnk_additional_8_HouseInteriors1_Library1F);
|
||||
@@ -807,8 +805,7 @@ u32 sub_unk3_GreatFairies_Exit(void) {
|
||||
extern EntityData gUnk_080D7D34;
|
||||
|
||||
void sub_StateChange_GreatFairies_Exit(void) {
|
||||
// four sword
|
||||
if (GetInventoryValue(0x6)) {
|
||||
if (GetInventoryValue(ITEM_FOURSWORD)) {
|
||||
SetTile(0x4072, 0x14d, 1);
|
||||
SetTile(0x4072, 0x10c, 1);
|
||||
SetTile(0x4090, 0x14c, 1);
|
||||
@@ -942,9 +939,9 @@ extern EntityData gUnk_080D8A34;
|
||||
extern EntityData gUnk_080D8A04;
|
||||
extern EntityData gUnk_080D89E4;
|
||||
|
||||
extern u32 gUnk_080D8BBC;
|
||||
extern u32 gUnk_080D8BFA;
|
||||
extern u32 gUnk_080D8C68;
|
||||
extern u16 gUnk_080D8BBC;
|
||||
extern u16 gUnk_080D8BFA;
|
||||
extern u16 gUnk_080D8C68;
|
||||
|
||||
void sub_StateChange_GoronCave_Main(void) {
|
||||
if (!CheckLocalFlag(GORON_DOUKUTU_APPEAR))
|
||||
@@ -974,7 +971,7 @@ void sub_StateChange_GoronCave_Main(void) {
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
u32* a;
|
||||
u16* a;
|
||||
u16 x, y;
|
||||
u16 entCnt;
|
||||
u16 shakeTime, shakeMag, sfx;
|
||||
@@ -990,7 +987,7 @@ void sub_0804BF38(Entity* this, ScriptExecutionContext* context) {
|
||||
u32 xOff;
|
||||
struct_080D8E54* ptr;
|
||||
u32 xtile, ytile;
|
||||
u32* a;
|
||||
u16* a;
|
||||
|
||||
iVar2 = context->intVariable;
|
||||
ptr = &gUnk_080D8E50[iVar2];
|
||||
@@ -4822,7 +4819,7 @@ void sub_StateChange_HouseInteriors2_Julietta(void) {
|
||||
LoadRoomEntityList(&gUnk_080F2570);
|
||||
break;
|
||||
}
|
||||
if (!GetInventoryValue(0x39)) {
|
||||
if (!GetInventoryValue(ITEM_QST_BOOK1)) {
|
||||
LoadRoomEntityList(&gUnk_080F25C0);
|
||||
}
|
||||
} else {
|
||||
@@ -5412,7 +5409,7 @@ extern EntityData gUnk_080F5788;
|
||||
|
||||
void sub_StateChange_HouseInteriors3_StockwellShop(void) {
|
||||
LoadRoomEntityList(&gUnk_080F5758);
|
||||
if (!GetInventoryValue(0x36) && CheckLocalFlagByBank(0x200, 0x8f)) {
|
||||
if (!GetInventoryValue(ITEM_QST_DOGFOOD) && CheckLocalFlagByBank(0x200, 0x8f)) {
|
||||
LoadRoomEntityList(&gUnk_080F57E8);
|
||||
}
|
||||
if (!CheckLocalFlag(0x55)) {
|
||||
@@ -5459,7 +5456,7 @@ extern EntityData gUnk_080F5B3C;
|
||||
|
||||
void sub_StateChange_HouseInteriors3_RemShoeShop(void) {
|
||||
#ifndef EU
|
||||
if (GetInventoryValue(0x38) == 1) {
|
||||
if (GetInventoryValue(ITEM_QST_MUSHROOM) == 1) {
|
||||
LoadRoomEntityList(&gUnk_080F5B3C);
|
||||
}
|
||||
#endif
|
||||
@@ -5828,14 +5825,14 @@ extern u32 gUnk_080F7C80;
|
||||
extern void sub_0804F4E4(void);
|
||||
|
||||
u32 sub_unk3_HyruleField_OutsideCastle(void) {
|
||||
if (CheckGlobalFlag(TABIDACHI) && !GetInventoryValue(0x11)) {
|
||||
if (CheckGlobalFlag(TABIDACHI) && !GetInventoryValue(ITEM_GUST_JAR)) {
|
||||
gRoomVars.field_0x6c[0] = &gUnk_080F7CD0;
|
||||
gRoomVars.field_0x6c[7] = sub_0804F5E8;
|
||||
}
|
||||
#if defined(JP) || defined(EU) || defined(DEMO_JP)
|
||||
if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(0x3) && !CheckLocalFlag(0x8a)) {
|
||||
if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(ITEM_RED_SWORD) && !CheckLocalFlag(0x8a)) {
|
||||
#else
|
||||
if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(0x3) && !CheckLocalFlag(0x8c)) {
|
||||
if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(ITEM_RED_SWORD) && !CheckLocalFlag(0x8c)) {
|
||||
#endif
|
||||
gRoomVars.field_0x6c[0] = &gUnk_080F7C80;
|
||||
gRoomVars.field_0x6c[7] = sub_0804F4E4;
|
||||
@@ -6087,7 +6084,7 @@ void sub_StateChange_Caves_Boomerang(void) {
|
||||
} else {
|
||||
LoadRoomEntityList(&gUnk_080F85F8);
|
||||
}
|
||||
if (!GetInventoryValue(0xc)) {
|
||||
if (!GetInventoryValue(ITEM_MAGIC_BOOMERANG)) {
|
||||
ClearLocalFlag(8);
|
||||
}
|
||||
}
|
||||
@@ -6682,7 +6679,7 @@ void sub_StateChange_MtCrenel_CaveOfFlamesEntrance(void) {
|
||||
if ((gSave.windcrests & 0x1000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080FB004);
|
||||
}
|
||||
if (GetInventoryValue(0x2)) {
|
||||
if (GetInventoryValue(ITEM_GREEN_SWORD)) {
|
||||
SetGlobalFlag(WHITE_SWORD_END);
|
||||
}
|
||||
}
|
||||
|
||||
+19
-20
@@ -3,12 +3,11 @@
|
||||
#include "screen.h"
|
||||
#include "area.h"
|
||||
#include "game.h"
|
||||
|
||||
#include "object.h"
|
||||
#include "npc.h"
|
||||
#include "kinstone.h"
|
||||
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
|
||||
void InitScriptForEntity(Entity*, ScriptExecutionContext*, u16*);
|
||||
void InitScriptExecutionContext(ScriptExecutionContext* context, u16* script);
|
||||
@@ -146,7 +145,7 @@ void ScriptCommand_IncreaseMaxHealth(Entity* entity, ScriptExecutionContext* con
|
||||
void ScriptCommand_GivePlayerItem(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_GiveKinstone(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_GetInventoryValue(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_0807F078(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_SetInventoryValue(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_0807F088(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_CameraTargetEntity(Entity* entity, ScriptExecutionContext* context);
|
||||
void ScriptCommand_CameraTargetPlayer(Entity* entity, ScriptExecutionContext* context);
|
||||
@@ -596,7 +595,7 @@ void ExecuteScript(Entity* entity, ScriptExecutionContext* context) {
|
||||
ScriptCommand_GivePlayerItem,
|
||||
ScriptCommand_GiveKinstone,
|
||||
ScriptCommand_GetInventoryValue,
|
||||
ScriptCommand_0807F078,
|
||||
ScriptCommand_SetInventoryValue,
|
||||
ScriptCommand_0807F088,
|
||||
ScriptCommand_CameraTargetEntity,
|
||||
ScriptCommand_CameraTargetPlayer,
|
||||
@@ -1502,8 +1501,8 @@ void ScriptCommand_GetInventoryValue(Entity* entity, ScriptExecutionContext* con
|
||||
context->condition = context->intVariable != 0;
|
||||
}
|
||||
|
||||
void ScriptCommand_0807F078(Entity* entity, ScriptExecutionContext* context) {
|
||||
sub_0807CAA0(context->scriptInstructionPointer[1], context->scriptInstructionPointer[2]);
|
||||
void ScriptCommand_SetInventoryValue(Entity* entity, ScriptExecutionContext* context) {
|
||||
SetInventoryValue(context->scriptInstructionPointer[1], context->scriptInstructionPointer[2]);
|
||||
}
|
||||
|
||||
void ScriptCommand_0807F088(Entity* entity, ScriptExecutionContext* context) {
|
||||
@@ -1615,21 +1614,21 @@ void EquipItem(Entity* entity, ScriptExecutionContext* context) {
|
||||
slot = context->intVariable >> 0x10;
|
||||
item &= 0xFFFF;
|
||||
switch (item) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
case ITEM_SMITH_SWORD:
|
||||
case ITEM_GREEN_SWORD:
|
||||
case ITEM_RED_SWORD:
|
||||
case ITEM_BLUE_SWORD:
|
||||
case ITEM_FOURSWORD:
|
||||
// Pick greatest sword unlocked
|
||||
item = 1;
|
||||
if (GetInventoryValue(2))
|
||||
item = 2;
|
||||
if (GetInventoryValue(3))
|
||||
item = 3;
|
||||
if (GetInventoryValue(4))
|
||||
item = 4;
|
||||
if (GetInventoryValue(6))
|
||||
item = 6;
|
||||
item = ITEM_SMITH_SWORD;
|
||||
if (GetInventoryValue(ITEM_GREEN_SWORD))
|
||||
item = ITEM_GREEN_SWORD;
|
||||
if (GetInventoryValue(ITEM_RED_SWORD))
|
||||
item = ITEM_RED_SWORD;
|
||||
if (GetInventoryValue(ITEM_BLUE_SWORD))
|
||||
item = ITEM_BLUE_SWORD;
|
||||
if (GetInventoryValue(ITEM_FOURSWORD))
|
||||
item = ITEM_FOURSWORD;
|
||||
break;
|
||||
}
|
||||
ForceEquipItem(item, slot);
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#include "asm.h"
|
||||
#include "room.h"
|
||||
|
||||
extern void sub_0807B778(u32, u32);
|
||||
|
||||
void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) {
|
||||
if (param_1 == 53) {
|
||||
sub_08000152(53, param_2, param_3);
|
||||
sub_0807B778(param_2, param_3);
|
||||
sub_0807B778(param_2 + 1, param_3);
|
||||
sub_0807B778(param_2 - 1, param_3);
|
||||
sub_0807B778(param_2 + 64, param_3);
|
||||
sub_0807B778(param_2 - 64, param_3);
|
||||
} else {
|
||||
SetTileType(param_1, param_2, param_3);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0807B820(u32 param_1) {
|
||||
SetTileType(620, param_1 - 65, 1);
|
||||
SetTileType(627, param_1 - 65, 2);
|
||||
SetTileType(621, param_1 - 64, 1);
|
||||
SetTileType(628, param_1 - 64, 2);
|
||||
SetTileType(622, param_1 - 63, 1);
|
||||
SetTileType(629, param_1 - 63, 2);
|
||||
SetTileType(623, param_1 - 1, 1);
|
||||
SetTileType(624, param_1, 1);
|
||||
SetTileType(626, param_1 + 1, 1);
|
||||
}
|
||||
|
||||
void sub_0807B8A8(u32 param_1) {
|
||||
SetTileType(636, param_1 - 65, 1);
|
||||
SetTileType(643, param_1 - 65, 2);
|
||||
SetTileType(637, param_1 - 64, 1);
|
||||
SetTileType(644, param_1 - 64, 2);
|
||||
SetTileType(638, param_1 - 63, 1);
|
||||
SetTileType(645, param_1 - 63, 2);
|
||||
SetTileType(639, param_1 - 1, 1);
|
||||
SetTileType(640, param_1, 1);
|
||||
SetTileType(642, param_1 + 1, 1);
|
||||
}
|
||||
|
||||
void sub_0807B930(int param_1) {
|
||||
SetTileType(652, param_1 - 65, 1);
|
||||
SetTileType(659, param_1 - 65, 2);
|
||||
SetTileType(653, param_1 - 64, 1);
|
||||
SetTileType(660, param_1 - 64, 2);
|
||||
SetTileType(654, param_1 - 63, 1);
|
||||
SetTileType(661, param_1 - 63, 2);
|
||||
SetTileType(655, param_1 - 1, 1);
|
||||
SetTileType(656, param_1, 1);
|
||||
SetTileType(658, param_1 + 1, 1);
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "save.h"
|
||||
#include "common.h"
|
||||
|
||||
extern u16 gMetatilesBottom[];
|
||||
extern u16 gMetatilesTop[];
|
||||
extern u8 gMapData;
|
||||
|
||||
extern const u8 gUnk_020176E0[];
|
||||
|
||||
void sub_0807C960(void* dest, u32 offset) {
|
||||
void* src;
|
||||
|
||||
if (offset != -1) {
|
||||
src = &gMapData + (offset & 0x7fffffff);
|
||||
if ((u32)dest >> 0x18 == 6) {
|
||||
LZ77UnCompVram(src, (void*)dest);
|
||||
} else {
|
||||
LZ77UnCompWram(src, (void*)dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0807C998(u32* a1) {
|
||||
sub_0807C960(gMetatilesBottom, a1[0]);
|
||||
sub_0807C960(gMetatilesBottom - 0x1000, a1[1]);
|
||||
sub_0807C960(gMetatilesTop, a1[2]);
|
||||
sub_0807C960(gMetatilesTop - 0x1000, a1[3]);
|
||||
}
|
||||
|
||||
void sub_0807C9D8(u32* a1) {
|
||||
u32* v1; // r5@1
|
||||
|
||||
v1 = a1;
|
||||
sub_0807C960((u8*)0x6004000, *a1);
|
||||
sub_0807C960((u8*)0x6000000, v1[1]);
|
||||
sub_0807C960((u8*)0x6008000, v1[2]);
|
||||
sub_0807C960((u8*)gUnk_020176E0, v1[3]);
|
||||
LoadPalettes(gUnk_020176E0, 2, 13);
|
||||
}
|
||||
|
||||
u32 FinalizeSave(void) {
|
||||
if (gSave.invalid || gSave.initialized != 1) {
|
||||
gSave.invalid = 0;
|
||||
gSave.initialized = 1;
|
||||
gSave.global_progress = 1;
|
||||
gSave.stats.health = 24;
|
||||
gSave.stats.maxHealth = 24;
|
||||
gSave.saved_status.area_next = 0x22;
|
||||
gSave.saved_status.room_next = 0x15; // links room
|
||||
gSave.saved_status.start_anim = 0;
|
||||
gSave.saved_status.spawn_type = PL_SPAWN_DEFAULT;
|
||||
gSave.saved_status.layer = 1;
|
||||
gSave.saved_status.start_pos_x = 0x90;
|
||||
gSave.saved_status.start_pos_y = 0x38;
|
||||
}
|
||||
if (gSave.name[0] == '\0') {
|
||||
MemCopy(gUnk_0811E470, &gSave.name, FILENAME_LENGTH - 1);
|
||||
}
|
||||
#ifdef DEMO_USA
|
||||
{
|
||||
const u8* tmp;
|
||||
MemCopy(demoPointers[gSaveHeader->saveFileId], &gSave, 0x4B4);
|
||||
if (gSaveHeader->language == 0) {
|
||||
gSave.name[0] = 0x97;
|
||||
gSave.name[1] = 0x7F;
|
||||
gSave.name[2] = 0xDD;
|
||||
gSave.name[3] = 0;
|
||||
}
|
||||
ModHealth(0xA0);
|
||||
ModRupees(-9999);
|
||||
tmp = demoUnknown1 + gUnk_02000010.field_0x7 * 3;
|
||||
gSave.demo_timer = tmp[gSaveHeader->saveFileId] * 3600;
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user