mirror of https://github.com/zeldaret/tmc.git
Formatting
This commit is contained in:
parent
8ff6027f97
commit
18b86e484a
|
@ -268,7 +268,8 @@ typedef struct {
|
|||
typedef struct {
|
||||
/*0x00*/ u8 ignoreLayer; /* if bit 0 set, skip layer check for collision */
|
||||
/*0x01*/ u8 type;
|
||||
/*0x02*/ u8 interactDirections; /* lower 4 bits determine Link's allowed facing directions to interact, 0 to allow (0000WSEN) */
|
||||
/*0x02*/ u8 interactDirections; /* lower 4 bits determine Link's allowed facing directions to interact, 0 to allow
|
||||
(0000WSEN) */
|
||||
/*0x03*/ u8 kinstoneId;
|
||||
/*0x04*/ const Rect* customHitbox; /* optional custom rectangle */
|
||||
/*0x08*/ Entity* entity;
|
||||
|
@ -278,9 +279,10 @@ typedef struct {
|
|||
/*0x00*/ u8 isUpdated;
|
||||
/*0x01*/ u8 unused;
|
||||
/*0x02*/ u8 kinstoneId;
|
||||
/*0x03*/ u8 currentIndex; /* index of currentObject in canditate list, or 0xFF */
|
||||
/*0x03*/ u8 currentIndex; /* index of currentObject in candidate list, or 0xFF */
|
||||
/*0x04*/ InteractableObject* currentObject;
|
||||
/*0x08*/ InteractableObject candidates[0x20]; /* contains the loaded NPCs, key doors, windcrests and other objects */
|
||||
/*0x08*/ InteractableObject
|
||||
candidates[0x20]; /* contains the loaded NPCs, key doors, windcrests and other objects */
|
||||
} PossibleInteraction;
|
||||
|
||||
static_assert(sizeof(PossibleInteraction) == 0x188);
|
||||
|
|
|
@ -204,7 +204,8 @@ u32 UpdatePlayerCollision(void) {
|
|||
ptr1 = &gUnk_080B4490[index * 2];
|
||||
if (sub_080B1B44(COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr1[0], -ptr1[1]), gPlayerEntity.collisionLayer) ==
|
||||
0xff) {
|
||||
if ((((gPlayerState.flags & (PL_FLAGS10000 | PL_FLAGS2)) != 0) || ((gPlayerState.sword_state & 0x10) != 0)) ||
|
||||
if ((((gPlayerState.flags & (PL_FLAGS10000 | PL_FLAGS2)) != 0) ||
|
||||
((gPlayerState.sword_state & 0x10) != 0)) ||
|
||||
((sub_080806BC(gPlayerEntity.x.HALF.HI - gRoomControls.origin_x,
|
||||
gPlayerEntity.y.HALF.HI - gRoomControls.origin_y, index, 5) == 0 &&
|
||||
(((gPlayerState.heldObject != 0 || ((gPlayerState.field_0x1c & 0xf) != 0)) ||
|
||||
|
|
|
@ -51,8 +51,8 @@ Entity* sub_08049E80(void) {
|
|||
}
|
||||
|
||||
Entity* sub_08049EB0(void) {
|
||||
if ((gPlayerState.field_0x3c == 0) && !(gPlayerState.flags &
|
||||
(PL_MOLDWORM_CAPTURED | PL_DISABLE_ITEMS | PL_MINISH | PL_CAPTURED))) {
|
||||
if ((gPlayerState.field_0x3c == 0) &&
|
||||
!(gPlayerState.flags & (PL_MOLDWORM_CAPTURED | PL_DISABLE_ITEMS | PL_MINISH | PL_CAPTURED))) {
|
||||
gUnk_020000B0 = &gPlayerEntity;
|
||||
return &gPlayerEntity;
|
||||
}
|
||||
|
|
12
src/common.c
12
src/common.c
|
@ -468,7 +468,8 @@ void DrawDungeonMap(u32 floor, DungeonMapObject* specialData, u32 size) {
|
|||
tileEntity++;
|
||||
}
|
||||
}
|
||||
if ((HasDungeonCompass() && ((floorMapData->unk_2 & 2) != 0)) && (!CheckGlobalFlag(gArea.dungeon_idx + 1))) {
|
||||
if ((HasDungeonCompass() && ((floorMapData->unk_2 & 2) != 0)) &&
|
||||
(!CheckGlobalFlag(gArea.dungeon_idx + 1))) {
|
||||
roomHeader = gAreaRoomHeaders[floorMapData->area] + floorMapData->room;
|
||||
specialData->type = DMO_TYPE_BOSS;
|
||||
tmp1 = ((roomHeader->pixel_width / 2) + roomHeader->map_x) / 16;
|
||||
|
@ -1073,9 +1074,10 @@ KinstoneId GetFusionToOffer(Entity* entity) {
|
|||
while (TRUE) { // loop through fusions for this fuser
|
||||
switch (offeredFusion) {
|
||||
case KINSTONE_NEEDS_REPLACEMENT: // offered fusion completed with someone else
|
||||
case KINSTONE_NONE: // no fusion offered yet
|
||||
case KINSTONE_NONE: // no fusion offered yet
|
||||
offeredFusion = fuserFusionData[5];
|
||||
if (offeredFusion == KINSTONE_NONE || offeredFusion == KINSTONE_RANDOM || CheckKinstoneFused(offeredFusion) == 0) {
|
||||
if (offeredFusion == KINSTONE_NONE || offeredFusion == KINSTONE_RANDOM ||
|
||||
CheckKinstoneFused(offeredFusion) == 0) {
|
||||
break;
|
||||
}
|
||||
case KINSTONE_JUST_FUSED: // previous fusion completed
|
||||
|
@ -1086,8 +1088,8 @@ KinstoneId GetFusionToOffer(Entity* entity) {
|
|||
if (offeredFusion == KINSTONE_RANDOM) { // random shared fusion
|
||||
offeredFusion = GetRandomSharedFusion(fuserData);
|
||||
}
|
||||
if (offeredFusion == KINSTONE_NONE) { // end of fusion list
|
||||
offeredFusion = KINSTONE_FUSER_DONE; // mark this fuser as done
|
||||
if (offeredFusion == KINSTONE_NONE) { // end of fusion list
|
||||
offeredFusion = KINSTONE_FUSER_DONE; // mark this fuser as done
|
||||
break;
|
||||
}
|
||||
if (offeredFusion == KINSTONE_JUST_FUSED) { // previous fusion completed
|
||||
|
|
|
@ -232,9 +232,8 @@ void NPC4E_Fusion(Entity* this) {
|
|||
const Hitbox gUnk_08114154 = { 0, -8, 0, 0, 0, 0, 24, 8 };
|
||||
|
||||
const InteractCollisionData gNpc4ECollisionData[] = { //
|
||||
{ 0, 0, 8, 8, 0x0E, 0, 0, 0 }, { 0, 0, 26, 8, 0x0E, 0, 0, 0 },
|
||||
{ 0, 0, 16, 4, 0x0E, 0, 0, 0 }, { 0, 0, 10, 10, 0x00, 0, 0, 0 },
|
||||
{ 0, 0, 10, 10, 0x00, 0, 0, 0 }, { 0, 0, 6, 4, 0x0E, 0, 0, 0 },
|
||||
{ 0, 0, 8, 8, 0x0E, 0, 0, 0 }, { 0, 0, 26, 8, 0x0E, 0, 0, 0 }, { 0, 0, 16, 4, 0x0E, 0, 0, 0 },
|
||||
{ 0, 0, 10, 10, 0x00, 0, 0, 0 }, { 0, 0, 10, 10, 0x00, 0, 0, 0 }, { 0, 0, 6, 4, 0x0E, 0, 0, 0 },
|
||||
{ 0, 8, 16, 4, 0x0E, 0, 0, 0 }, { 0, -8, 24, 8, 0x0E, 0, 0, 0 },
|
||||
#ifndef EU
|
||||
{ 0, 0, 88, 8, 0x0E, 0, 0, 0 }
|
||||
|
|
|
@ -103,7 +103,8 @@ void CameraTarget_Action1(Entity* this) {
|
|||
if (this->timer) {
|
||||
this->timer--;
|
||||
} else {
|
||||
if ((gPossibleInteraction.currentObject->entity != NULL) && ((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) {
|
||||
if ((gPossibleInteraction.currentObject->entity != NULL) &&
|
||||
((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) {
|
||||
this->child = gPossibleInteraction.currentObject->entity;
|
||||
this->interactType = gPossibleInteraction.currentIndex;
|
||||
sub_08083A40(this);
|
||||
|
@ -119,8 +120,8 @@ void CameraTarget_Action2(Entity* this) {
|
|||
u32 temp2;
|
||||
const KinstoneWorldEvent* ptr;
|
||||
|
||||
if ((this->type != 1) &&
|
||||
(((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) >= 100 || (this->child != gPossibleInteraction.currentObject->entity)))) {
|
||||
if ((this->type != 1) && (((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) >= 100 ||
|
||||
(this->child != gPossibleInteraction.currentObject->entity)))) {
|
||||
sub_080838DC(this);
|
||||
} else {
|
||||
this->x = this->child->x;
|
||||
|
|
|
@ -118,9 +118,9 @@ void ItemForSale_Action2(ItemForSaleEntity* this) {
|
|||
sub_080819B4(this);
|
||||
} else {
|
||||
ptr = sub_080784E4();
|
||||
if (((*(int*)(ptr + 8) == 0) ||
|
||||
((*(u8*)(ptr + 1) != 1 || (gUnk_0200AF00.rActionPlayerState = R_ACTION_SPEAK, (gPlayerState.playerInput.newInput &
|
||||
(PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0)))) &&
|
||||
if (((*(int*)(ptr + 8) == 0) || ((*(u8*)(ptr + 1) != 1 || (gUnk_0200AF00.rActionPlayerState = R_ACTION_SPEAK,
|
||||
(gPlayerState.playerInput.newInput &
|
||||
(PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0)))) &&
|
||||
((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_10 | PLAYER_INPUT_8)) != 0)) {
|
||||
sub_080819B4(this);
|
||||
}
|
||||
|
|
|
@ -134,7 +134,8 @@ void LockedDoor_Init(Entity* this) {
|
|||
} else {
|
||||
this->action = 8;
|
||||
AddInteractableSmallKeyLock(this);
|
||||
SetInteractableObjectCollision(this, 0, gLockedDoorInteractDirections[this->field_0x7c.BYTES.byte2], NULL);
|
||||
SetInteractableObjectCollision(this, 0, gLockedDoorInteractDirections[this->field_0x7c.BYTES.byte2],
|
||||
NULL);
|
||||
}
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
|
|
|
@ -1090,7 +1090,8 @@ bool32 sub_080782C0(void) {
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (((gPlayerState.playerInput.newInput & PLAYER_INPUT_1000) != 0) && ((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) {
|
||||
if (((gPlayerState.playerInput.newInput & PLAYER_INPUT_1000) != 0) &&
|
||||
((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) {
|
||||
AddKinstoneToBag(KINSTONE_NONE);
|
||||
if (gSave.kinstoneAmounts[0] != 0) {
|
||||
gPossibleInteraction.kinstoneId = gPossibleInteraction.currentObject->kinstoneId;
|
||||
|
|
Loading…
Reference in New Issue