mirror of
https://github.com/zeldaret/tmc
synced 2026-07-02 04:25:56 -04:00
Merge remote-tracking branch 'upstream/master' into tilemap-docs
This commit is contained in:
@@ -27,7 +27,7 @@ typedef struct {
|
||||
} BossDoorEntity;
|
||||
|
||||
extern bool32 gUnk_02036BB8;
|
||||
extern const u8 gUnk_0811F740[];
|
||||
extern const u8 gLockedDoorInteractDirections[];
|
||||
|
||||
void sub_0808C500(BossDoorEntity*);
|
||||
void sub_0808C4BC(BossDoorEntity*);
|
||||
@@ -69,8 +69,8 @@ void BossDoor_Init(BossDoorEntity* this) {
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = 1;
|
||||
sub_0808C500(this);
|
||||
sub_08078800(super);
|
||||
sub_08078850(super, 0, gUnk_0811F740[this->unk_76], 0);
|
||||
AddInteractableBossDoor(super);
|
||||
SetInteractableObjectCollision(super, 0, gLockedDoorInteractDirections[this->unk_76], NULL);
|
||||
break;
|
||||
case 1:
|
||||
super->action = 4;
|
||||
@@ -87,7 +87,7 @@ void BossDoor_Init(BossDoorEntity* this) {
|
||||
void BossDoor_Action1(BossDoorEntity* this) {
|
||||
if (super->interactType != 0) {
|
||||
super->action = 2;
|
||||
sub_080788E0(super);
|
||||
RemoveInteractableObject(super);
|
||||
SetFlag(this->unk_86);
|
||||
}
|
||||
}
|
||||
|
||||
+18
-16
@@ -53,16 +53,17 @@ void CameraTarget(Entity* this) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
if ((gMessage.doTextBox & 0x7f) != 0) {
|
||||
default:
|
||||
if (gUnk_03003DF0.unk_4[3] == 50) {
|
||||
if (CheckKinstoneFused(KINSTONE_32) == 0) {
|
||||
uVar2 = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
uVar2 = 1;
|
||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (gPossibleInteraction.currentObject->kinstoneId == KINSTONE_32) {
|
||||
if (CheckKinstoneFused(KINSTONE_32) == 0) {
|
||||
uVar2 = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
uVar2 = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -102,9 +103,10 @@ void CameraTarget_Action1(Entity* this) {
|
||||
if (this->timer) {
|
||||
this->timer--;
|
||||
} else {
|
||||
if ((*(Entity**)(gUnk_03003DF0.unk_4 + 8) != NULL) && ((u8)(gUnk_03003DF0.unk_4[3] - 1) < 100)) {
|
||||
this->child = *(Entity**)(gUnk_03003DF0.unk_4 + 8);
|
||||
this->interactType = gUnk_03003DF0.unk_3;
|
||||
if ((gPossibleInteraction.currentObject->entity != NULL) &&
|
||||
((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) {
|
||||
this->child = gPossibleInteraction.currentObject->entity;
|
||||
this->interactType = gPossibleInteraction.currentIndex;
|
||||
sub_08083A40(this);
|
||||
}
|
||||
}
|
||||
@@ -118,8 +120,8 @@ void CameraTarget_Action2(Entity* this) {
|
||||
u32 temp2;
|
||||
const KinstoneWorldEvent* ptr;
|
||||
|
||||
if ((this->type != 1) &&
|
||||
(((u8)(gUnk_03003DF0.unk_4[3] - 1) >= 100 || (this->child != *(Entity**)(gUnk_03003DF0.unk_4 + 8))))) {
|
||||
if ((this->type != 1) && (((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) >= 100 ||
|
||||
(this->child != gPossibleInteraction.currentObject->entity)))) {
|
||||
sub_080838DC(this);
|
||||
} else {
|
||||
this->x = this->child->x;
|
||||
@@ -128,12 +130,12 @@ void CameraTarget_Action2(Entity* this) {
|
||||
if (this->frame == 1) {
|
||||
this->frame = 0;
|
||||
if (this->type == 0) {
|
||||
bVar2 = gUnk_03003DF0.unk_4[3];
|
||||
bVar2 = gPossibleInteraction.currentObject->kinstoneId;
|
||||
} else {
|
||||
bVar2 = this->type2;
|
||||
}
|
||||
ptr = gKinstoneWorldEvents + bVar2;
|
||||
bVar1 = ptr->unk6;
|
||||
bVar1 = ptr->bubbleIcon;
|
||||
bVar3 = bVar1 & 1;
|
||||
this->palette.b.b0 = bVar3;
|
||||
temp = gUnk_0811F744[bVar1] < 0;
|
||||
|
||||
@@ -26,7 +26,7 @@ extern const Hitbox gUnk_0811F8A8;
|
||||
extern const Hitbox gUnk_0811F8B0;
|
||||
|
||||
void sub_080842D8(ChestSpawnerEntity*);
|
||||
void sub_08078828(ChestSpawnerEntity*);
|
||||
void AddInteractableChest(ChestSpawnerEntity*);
|
||||
void sub_08083E20(ChestSpawnerEntity*);
|
||||
void sub_08084074(u32);
|
||||
void sub_080840A8(s32, s32);
|
||||
@@ -76,7 +76,7 @@ void sub_08083E20(ChestSpawnerEntity* this) {
|
||||
super->spriteSettings.draw = 1;
|
||||
super->spriteRendering.alphaBlend = 0;
|
||||
sub_080842D8(this);
|
||||
sub_08078828(this);
|
||||
AddInteractableChest(this);
|
||||
}
|
||||
void ChestSpawner_Type2Init(ChestSpawnerEntity* this) {
|
||||
super->hitbox = (Hitbox*)&gUnk_0811F8B0;
|
||||
@@ -153,7 +153,7 @@ void ChestSpawner_Type2Action3(ChestSpawnerEntity* this) {
|
||||
if (super->interactType != 0) {
|
||||
super->action = 4;
|
||||
super->subtimer = 30;
|
||||
sub_080788E0(super);
|
||||
RemoveInteractableObject(super);
|
||||
RequestPriorityDuration(super, 60);
|
||||
SoundReq(SFX_CHEST_OPEN);
|
||||
}
|
||||
|
||||
@@ -172,9 +172,9 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
|
||||
this->unk_70 = ((super->x.HALF.HI + (s8)gUnk_08123184[tmp]) & -0x10) | 8;
|
||||
this->unk_72 = ((super->y.HALF.HI + (s8)gUnk_08123184[(tmp) + 1]) & -0x10) | 8;
|
||||
if (sub_080B1AB4(this->unk_70, this->unk_72, super->collisionLayer) == 0x19) {
|
||||
gHUD.unk_2f = 3;
|
||||
gHUD.rActionPlayerState = R_ACTION_THROW;
|
||||
} else {
|
||||
gHUD.unk_2f = 0;
|
||||
gHUD.rActionPlayerState = R_ACTION_NONE;
|
||||
}
|
||||
PositionRelative(&gPlayerEntity, super, 0, 0x10000);
|
||||
if (GetTileUnderEntity(super) == 0x19) {
|
||||
@@ -184,7 +184,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
|
||||
if ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_40)) == 0) {
|
||||
return;
|
||||
}
|
||||
if (gHUD.unk_2f != 3) {
|
||||
if (gHUD.rActionPlayerState != R_ACTION_THROW) {
|
||||
return;
|
||||
}
|
||||
gPlayerState.heldObject = 0;
|
||||
|
||||
+85
-71
@@ -13,23 +13,28 @@
|
||||
#include "npc.h"
|
||||
#include "object.h"
|
||||
#include "script.h"
|
||||
#include "item.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
s16 unk68;
|
||||
s16 unk6a;
|
||||
s16 unk6c;
|
||||
s16 timer;
|
||||
s16 currentCuccos;
|
||||
s16 targetCuccos;
|
||||
u16 unk6e;
|
||||
u8 unk70[0x18];
|
||||
u8 returnedCuccoTypes[0x18];
|
||||
} CuccoMinigameEntity;
|
||||
|
||||
typedef Entity* CuccoMinigameHeap[10];
|
||||
|
||||
u32 sub_080A1514();
|
||||
u32 CuccoMinigame_GetLevel();
|
||||
|
||||
const u16 gUnk_08124C20[] = {
|
||||
25, 0x2, 25, 0x3, 30, 0x4, 45, 0x5, 50, 0x5, 45, 0x5, 50, 0x6, 60, 0x7, 55, 0x2, 55, 0x3,
|
||||
};
|
||||
typedef struct {
|
||||
u16 time;
|
||||
u16 numCuccos;
|
||||
} CuccoMinigameGoal;
|
||||
|
||||
const CuccoMinigameGoal goalData[10] = { { 25, 2 }, { 25, 3 }, { 30, 4 }, { 45, 5 }, { 50, 5 },
|
||||
{ 45, 5 }, { 50, 6 }, { 60, 7 }, { 55, 2 }, { 55, 3 } };
|
||||
|
||||
static const u16 pCuccoMinigame_MinigameCuccoDefs[][30] = {
|
||||
{ 0x0001, 0x02E9, 0x0318, 0x0001, 0x0280, 0x0380, 0x0002, 0x0277, 0x0314, 0x0001,
|
||||
@@ -66,9 +71,18 @@ static const u16 pCuccoMinigame_MinigameCuccoDefs[][30] = {
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }
|
||||
};
|
||||
|
||||
static const u8 gUnk_08124EA0[] = { 0x3F, 0x0A, 0x01, 0x00, 0x3F, 0x0A, 0x01, 0x00, 0x3F, 0x14, 0x01, 0x00, 0x3F, 0x14,
|
||||
0x01, 0x00, 0x3F, 0x1E, 0x01, 0x00, 0x3F, 0x1E, 0x01, 0x00, 0x5C, 0x6E, 0x01, 0x00,
|
||||
0x5C, 0x6F, 0x01, 0x00, 0x5C, 0x70, 0x01, 0x00, 0x63, 0x00, 0x01, 0x00 };
|
||||
typedef struct {
|
||||
u8 item;
|
||||
u8 subtype;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
} CuccoMinigamePrizeData;
|
||||
|
||||
static const CuccoMinigamePrizeData prizeData[10] = { { ITEM_SHELLS, 10, 1, 0 }, { ITEM_SHELLS, 10, 1, 0 },
|
||||
{ ITEM_SHELLS, 20, 1, 0 }, { ITEM_SHELLS, 20, 1, 0 },
|
||||
{ ITEM_SHELLS, 30, 1, 0 }, { ITEM_SHELLS, 30, 1, 0 },
|
||||
{ ITEM_KINSTONE, 0x6E, 1, 0 }, { ITEM_KINSTONE, 0x6F, 1, 0 },
|
||||
{ ITEM_KINSTONE, 0x70, 1, 0 }, { ITEM_HEART_PIECE, 0, 1, 0 } };
|
||||
|
||||
static const u16 CuccoMinigame_Sounds[] = { SFX_VO_CUCCO5, SFX_VO_CUCCO_CALL };
|
||||
|
||||
@@ -78,17 +92,17 @@ void CuccoMinigame(CuccoMinigameEntity* this) {
|
||||
int index;
|
||||
u32 val;
|
||||
u8* puVar2;
|
||||
const u16* ptr;
|
||||
const CuccoMinigameGoal* ptr;
|
||||
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
ptr = gUnk_08124C20 + sub_080A1514() * 2;
|
||||
this->unk68 = ptr[0] * 0x3c;
|
||||
this->unk6a = 0;
|
||||
this->unk6c = ptr[1];
|
||||
ptr = &goalData[CuccoMinigame_GetLevel()];
|
||||
this->timer = ptr->time * 60;
|
||||
this->currentCuccos = 0;
|
||||
this->targetCuccos = ptr->numCuccos;
|
||||
this->unk6e = 1;
|
||||
|
||||
for (puVar2 = this->unk70, val = 0, index = 9; index >= 0; index--) {
|
||||
for (puVar2 = this->returnedCuccoTypes, val = 0, index = 9; index >= 0; index--) {
|
||||
*puVar2++ = val;
|
||||
}
|
||||
sub_0807DD64(super);
|
||||
@@ -110,7 +124,7 @@ NONMATCH("asm/non_matching/objectB9/sub_080A1270.inc", void sub_080A1270(CuccoMi
|
||||
|
||||
sVar6 = 0;
|
||||
entArray = ((Entity**)super->myHeap);
|
||||
ptr = this->unk70;
|
||||
ptr = this->returnedCuccoTypes;
|
||||
iVar1 = (gRoomControls.origin_x + 0x360);
|
||||
iVar4 = (gRoomControls.origin_y + 0x350);
|
||||
iVar1 = (iVar1 << 16) >> 16;
|
||||
@@ -147,9 +161,9 @@ NONMATCH("asm/non_matching/objectB9/sub_080A1270.inc", void sub_080A1270(CuccoMi
|
||||
}
|
||||
}
|
||||
|
||||
this->unk6a = sVar6;
|
||||
this->currentCuccos = sVar6;
|
||||
gPlayerState.field_0x27[0] = 0xff;
|
||||
if (--this->unk68 < 1) {
|
||||
if (--this->timer < 1) {
|
||||
SoundReq(SFX_CUCCO_MINIGAME_BELL);
|
||||
sub_08050384();
|
||||
} else {
|
||||
@@ -163,7 +177,7 @@ void CuccoMinigame_Cleanup(CuccoMinigameEntity* this) {
|
||||
s8* pcVar2;
|
||||
int index;
|
||||
|
||||
pcVar2 = this->unk70;
|
||||
pcVar2 = this->returnedCuccoTypes;
|
||||
puVar1 = super->myHeap;
|
||||
|
||||
for (index = 9; index >= 0; index--, pcVar2++, puVar1++) {
|
||||
@@ -174,8 +188,8 @@ void CuccoMinigame_Cleanup(CuccoMinigameEntity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A13B4(CuccoMinigameEntity* this, ScriptExecutionContext* context) {
|
||||
if (this->unk6a >= this->unk6c) {
|
||||
void CuccoMinigame_Results(CuccoMinigameEntity* this, ScriptExecutionContext* context) {
|
||||
if (this->currentCuccos >= this->targetCuccos) {
|
||||
MessageFromTarget(TEXT_INDEX(TEXT_ANJU, 0xc));
|
||||
context->condition = 1;
|
||||
} else {
|
||||
@@ -184,115 +198,115 @@ void sub_080A13B4(CuccoMinigameEntity* this, ScriptExecutionContext* context) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A13E8(CuccoMinigameEntity* this) {
|
||||
bool32 bVar2;
|
||||
const u8* ptr = &gUnk_08124EA0[sub_080A1514() * 4];
|
||||
void CuccoMinigame_WinItem(CuccoMinigameEntity* this) {
|
||||
bool32 skipItem;
|
||||
const CuccoMinigamePrizeData* prize = &prizeData[CuccoMinigame_GetLevel()];
|
||||
|
||||
bVar2 = 0;
|
||||
switch (ptr[0]) {
|
||||
case 0x3f:
|
||||
skipItem = 0;
|
||||
switch (prize->item) {
|
||||
case ITEM_SHELLS:
|
||||
if (gSave.stats.hasAllFigurines) {
|
||||
bVar2 = 1;
|
||||
skipItem = 1;
|
||||
}
|
||||
break;
|
||||
case 0x5c:
|
||||
case ITEM_KINSTONE:
|
||||
if (gSave.didAllFusions) {
|
||||
bVar2 = 1;
|
||||
skipItem = 1;
|
||||
}
|
||||
break;
|
||||
case 0x63:
|
||||
case ITEM_HEART_PIECE:
|
||||
if (!CheckGlobalFlag(ANJU_HEART)) {
|
||||
SetGlobalFlag(ANJU_HEART);
|
||||
break;
|
||||
}
|
||||
bVar2 = 1;
|
||||
skipItem = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!bVar2) {
|
||||
InitItemGetSequence(ptr[0], ptr[1], 0);
|
||||
if (!skipItem) {
|
||||
InitItemGetSequence(prize->item, prize->subtype, 0);
|
||||
} else {
|
||||
this->unk6e = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A1460(CuccoMinigameEntity* this) {
|
||||
s8* pcVar1;
|
||||
int iVar2;
|
||||
void CuccoMinigame_WinRupees(CuccoMinigameEntity* this) {
|
||||
s8* cuccoTypes;
|
||||
int index;
|
||||
s32 rupees;
|
||||
const u8* ptr;
|
||||
const u8* rupeeValues;
|
||||
|
||||
sub_080A1514();
|
||||
pcVar1 = this->unk70;
|
||||
CuccoMinigame_GetLevel(); // Rupees previously dependent on level?
|
||||
cuccoTypes = this->returnedCuccoTypes;
|
||||
rupees = 0;
|
||||
ptr = CuccoMinigameRupees;
|
||||
rupeeValues = CuccoMinigameRupees;
|
||||
|
||||
for (iVar2 = 9; iVar2 >= 0; iVar2--) {
|
||||
for (index = 9; index >= 0; index--) { // Only first 10 count?
|
||||
// Weird register addition
|
||||
// ptr[*pcVar1] translates to add r0,r3,r0 but should be add r0,r3
|
||||
u32 temp = *pcVar1;
|
||||
temp += (int)ptr;
|
||||
// rupeeValues[*cuccoTypes] translates to add r0,r3,r0 but should be add r0,r3
|
||||
u32 temp = *cuccoTypes;
|
||||
temp += (int)rupeeValues;
|
||||
rupees += *(u8*)temp;
|
||||
pcVar1++;
|
||||
cuccoTypes++;
|
||||
}
|
||||
ModRupees(rupees);
|
||||
MessageNoOverlap(TEXT_INDEX(TEXT_ANJU, 0x7), super);
|
||||
gMessage.rupees = (u16)rupees;
|
||||
}
|
||||
|
||||
void sub_080A14A8(void) {
|
||||
int iVar1;
|
||||
void CuccoMinigame_AdvanceLevel(void) {
|
||||
int level;
|
||||
|
||||
iVar1 = sub_080A1514();
|
||||
iVar1++;
|
||||
if (iVar1 > 9) {
|
||||
iVar1 = 9;
|
||||
level = CuccoMinigame_GetLevel();
|
||||
level++;
|
||||
if (level > 9) {
|
||||
level = 9;
|
||||
}
|
||||
|
||||
if (iVar1 & 1) {
|
||||
if (level & 1) {
|
||||
SetGlobalFlag(ANJU_LV_BIT0);
|
||||
} else {
|
||||
ClearGlobalFlag(ANJU_LV_BIT0);
|
||||
}
|
||||
|
||||
if (iVar1 & 2) {
|
||||
if (level & 2) {
|
||||
SetGlobalFlag(ANJU_LV_BIT1);
|
||||
} else {
|
||||
ClearGlobalFlag(ANJU_LV_BIT1);
|
||||
}
|
||||
|
||||
if (iVar1 & 4) {
|
||||
if (level & 4) {
|
||||
SetGlobalFlag(ANJU_LV_BIT2);
|
||||
} else {
|
||||
ClearGlobalFlag(ANJU_LV_BIT2);
|
||||
}
|
||||
|
||||
if (iVar1 & 8) {
|
||||
if (level & 8) {
|
||||
SetGlobalFlag(ANJU_LV_BIT3);
|
||||
} else {
|
||||
ClearGlobalFlag(ANJU_LV_BIT3);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_080A1514(void) {
|
||||
u32 rv = 0;
|
||||
u32 CuccoMinigame_GetLevel(void) {
|
||||
u32 level = 0;
|
||||
|
||||
if (CheckGlobalFlag(ANJU_LV_BIT0)) {
|
||||
rv = 1;
|
||||
level = 1;
|
||||
}
|
||||
|
||||
if (CheckGlobalFlag(ANJU_LV_BIT1)) {
|
||||
rv |= 2;
|
||||
level |= 2;
|
||||
}
|
||||
|
||||
if (CheckGlobalFlag(ANJU_LV_BIT2)) {
|
||||
rv |= 4;
|
||||
level |= 4;
|
||||
}
|
||||
|
||||
if (CheckGlobalFlag(ANJU_LV_BIT3)) {
|
||||
rv |= 8;
|
||||
level |= 8;
|
||||
}
|
||||
return rv;
|
||||
return level;
|
||||
}
|
||||
|
||||
void CuccoMinigame_Init(Entity* this, ScriptExecutionContext* context) {
|
||||
@@ -311,7 +325,7 @@ void CuccoMinigame_Init(Entity* this, ScriptExecutionContext* context) {
|
||||
} else {
|
||||
*(ScriptExecutionContext**)&((GenericEntity*)pEnt)->cutsceneBeh =
|
||||
(ScriptExecutionContext*)StartCutscene(pEnt, (u16*)context->intVariable);
|
||||
pCuccoMinigameDef = pCuccoMinigame_MinigameCuccoDefs[sub_080A1514()];
|
||||
pCuccoMinigameDef = pCuccoMinigame_MinigameCuccoDefs[CuccoMinigame_GetLevel()];
|
||||
ppEVar5 = (Entity**)pEnt->myHeap;
|
||||
room = &gRoomControls;
|
||||
for (index = 9; index >= 0; index--, pCuccoMinigameDef += 3) {
|
||||
@@ -332,9 +346,9 @@ void CuccoMinigame_Init(Entity* this, ScriptExecutionContext* context) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A1608(void) {
|
||||
void CuccoMinigame_TellObjective(void) {
|
||||
u16 messageIndex;
|
||||
const u16* ptr;
|
||||
const CuccoMinigameGoal* ptr;
|
||||
|
||||
messageIndex = TEXT_INDEX(TEXT_ANJU, 0x2);
|
||||
if (CheckRoomFlag(1)) {
|
||||
@@ -343,9 +357,9 @@ void sub_080A1608(void) {
|
||||
MessageFromTarget(messageIndex);
|
||||
gMessage.textWindowPosX = 1;
|
||||
gMessage.textWindowPosY = 0;
|
||||
ptr = &gUnk_08124C20[sub_080A1514() * 2];
|
||||
gMessage.rupees = ptr[0];
|
||||
gMessage.field_0x14 = ptr[1];
|
||||
ptr = &goalData[CuccoMinigame_GetLevel()];
|
||||
gMessage.rupees = ptr->time;
|
||||
gMessage.field_0x14 = ptr->numCuccos;
|
||||
}
|
||||
|
||||
void sub_080A1648(void) {
|
||||
|
||||
@@ -22,7 +22,7 @@ extern u16 gUnk_08122B1E[];
|
||||
extern Coords8 gUnk_08122B2E[]; // TODO struct xy
|
||||
typedef struct {
|
||||
Hitbox hit;
|
||||
u8 _8[4]; // TODO fourth param of sub_08078850
|
||||
u8 _8[4]; // TODO fourth param of SetInteractableObjectCollision
|
||||
u8 _c;
|
||||
} HitboxCfg;
|
||||
extern HitboxCfg gUnk_08122B3C[];
|
||||
@@ -395,13 +395,13 @@ void sub_08094FA8(CutsceneMiscObjectEntity* this) {
|
||||
super->action = 1;
|
||||
super->frameIndex = 0;
|
||||
super->spritePriority.b0 = 7;
|
||||
sub_080787B4(super);
|
||||
AddInteractableCheckableObject(super);
|
||||
break;
|
||||
case 1:
|
||||
if (super->interactType != 0) {
|
||||
super->interactType = 0;
|
||||
super->action = 2;
|
||||
sub_080788E0(super);
|
||||
RemoveInteractableObject(super);
|
||||
gPlayerState.queued_action = PLAYER_EMPTYBOTTLE;
|
||||
gPlayerState.field_0x38 = 54;
|
||||
#ifndef EU
|
||||
@@ -449,13 +449,13 @@ void sub_08095088(CutsceneMiscObjectEntity* this) {
|
||||
DeleteThisEntity();
|
||||
super->action = 1;
|
||||
super->spritePriority.b0 = 7;
|
||||
sub_080787B4(super);
|
||||
AddInteractableCheckableObject(super);
|
||||
break;
|
||||
case 1:
|
||||
if (super->interactType != 0) {
|
||||
super->interactType = 0;
|
||||
super->action = 2;
|
||||
sub_080788E0(super);
|
||||
RemoveInteractableObject(super);
|
||||
CreateEzloHint(TEXT_INDEX(TEXT_BELARI, 0x1F), 0);
|
||||
}
|
||||
break;
|
||||
@@ -1322,6 +1322,6 @@ void sub_080962E8(CutsceneMiscObjectEntity* this) {
|
||||
|
||||
void sub_080962F8(CutsceneMiscObjectEntity* this, ScriptExecutionContext* ctx) {
|
||||
HitboxCfg* cfg = &gUnk_08122B3C[ctx->intVariable];
|
||||
sub_08078850(super, 1, cfg->_c, cfg->_8);
|
||||
SetInteractableObjectCollision(super, 1, cfg->_c, cfg->_8);
|
||||
super->hitbox = &cfg->hit;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ void FigurineDevice_Init(FigurineDeviceEntity* this) {
|
||||
case 0:
|
||||
if (CheckLocalFlag(SHOP07_TANA)) {
|
||||
this->unk_7a = 1;
|
||||
sub_080787B4(super);
|
||||
AddInteractableCheckableObject(super);
|
||||
} else {
|
||||
this->unk_7a = 0;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ void FigurineDevice_Action1(FigurineDeviceEntity* this) {
|
||||
switch (this->unk_7a) {
|
||||
case 0:
|
||||
this->unk_7a = 1;
|
||||
sub_080787B4(super);
|
||||
AddInteractableCheckableObject(super);
|
||||
break;
|
||||
case 1:
|
||||
if (super->interactType != 0) {
|
||||
@@ -142,7 +142,7 @@ void FigurineDevice_Action1(FigurineDeviceEntity* this) {
|
||||
default:
|
||||
if (CheckRoomFlag(2) == 0) {
|
||||
this->unk_7a = 1;
|
||||
sub_080787B4(super);
|
||||
AddInteractableCheckableObject(super);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -421,10 +421,17 @@ void sub_0809CB70(FrozenOctorokEntity* this, s32 angle, s32 radius) {
|
||||
super->z.WORD = super->parent->z.WORD;
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/frozenOctorok/sub_0809CBE4.inc", void sub_0809CBE4(FrozenOctorokEntity* this)) {
|
||||
this->unk_79 += super->subtimer;
|
||||
void sub_0809CBE4(FrozenOctorokEntity* this) {
|
||||
u16 tmp1;
|
||||
FORCE_REGISTER(u8 tmp4, r4);
|
||||
u8* tmp3 = &this->unk_79;
|
||||
tmp1 = super->subtimer;
|
||||
tmp4 = *tmp3;
|
||||
tmp1 += tmp4;
|
||||
this->unk_79 = tmp1;
|
||||
if ((s8)super->subtimer < 0) {
|
||||
if (super->timer < -this->unk_79) {
|
||||
u8 tmp_r0 = super->timer;
|
||||
if (tmp1 << 0x18 < -tmp_r0 << 0x18) {
|
||||
super->subtimer = -super->subtimer;
|
||||
SoundReq(SFX_19E);
|
||||
}
|
||||
@@ -433,7 +440,6 @@ NONMATCH("asm/non_matching/frozenOctorok/sub_0809CBE4.inc", void sub_0809CBE4(Fr
|
||||
SoundReq(SFX_19E);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void FrozenOctorok_ChangeObjPaletteOfChildren(FrozenOctorokEntity* this, u32 palette) {
|
||||
u32 index;
|
||||
|
||||
+15
-15
@@ -27,14 +27,14 @@ typedef struct {
|
||||
// not match.
|
||||
} ModifiedParentEntity;
|
||||
|
||||
extern u32 sub_080787D8(Entity*);
|
||||
extern u32 AddInteractableShopItem(Entity*);
|
||||
extern void* sub_080784E4(void);
|
||||
|
||||
void ItemForSale_Init(ItemForSaleEntity*);
|
||||
void ItemForSale_Action1(ItemForSaleEntity*);
|
||||
void ItemForSale_Action2(ItemForSaleEntity*);
|
||||
void ItemForSale_Action3(ItemForSaleEntity*);
|
||||
void sub_08081A5C(ItemForSaleEntity*);
|
||||
void ItemForSale_MakeInteractable(ItemForSaleEntity*);
|
||||
void sub_080819B4(ItemForSaleEntity*);
|
||||
void sub_08081AB0(void);
|
||||
|
||||
@@ -71,7 +71,7 @@ void ItemForSale_Init(ItemForSaleEntity* this) {
|
||||
SetDefaultPriority(super, 6);
|
||||
#endif
|
||||
super->child = super;
|
||||
sub_08081A5C(this);
|
||||
ItemForSale_MakeInteractable(this);
|
||||
switch (super->timer) {
|
||||
case 0:
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD328;
|
||||
@@ -85,7 +85,7 @@ void ItemForSale_Init(ItemForSaleEntity* this) {
|
||||
void ItemForSale_Action1(ItemForSaleEntity* this) {
|
||||
if (super->subAction != 0) {
|
||||
super->action = 2;
|
||||
gHUD.unk_2f = 2;
|
||||
gHUD.rActionPlayerState = 2;
|
||||
} else {
|
||||
if (super->type == 0x36) {
|
||||
if (super->interactType != 0) {
|
||||
@@ -102,7 +102,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
|
||||
ResetActiveItems();
|
||||
gPlayerState.heldObject = 4;
|
||||
gNewPlayerEntity.unk_74 = super;
|
||||
gHUD.unk_2f = 2;
|
||||
gHUD.rActionPlayerState = R_ACTION_DROP;
|
||||
MessageClose();
|
||||
}
|
||||
}
|
||||
@@ -112,15 +112,15 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
|
||||
void ItemForSale_Action2(ItemForSaleEntity* this) {
|
||||
void* ptr;
|
||||
|
||||
gHUD.unk_2f = 2;
|
||||
gHUD.rActionPlayerState = R_ACTION_DROP;
|
||||
super->spriteSettings.draw = gPlayerEntity.spriteSettings.draw;
|
||||
if ((gPlayerState.heldObject == 0) || (super != gNewPlayerEntity.unk_74)) {
|
||||
sub_080819B4(this);
|
||||
} else {
|
||||
ptr = sub_080784E4();
|
||||
if (((*(int*)(ptr + 8) == 0) ||
|
||||
((*(u8*)(ptr + 1) != 1 || (gHUD.unk_2f = 7, (gPlayerState.playerInput.newInput &
|
||||
(PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0)))) &&
|
||||
if (((*(int*)(ptr + 8) == 0) || ((*(u8*)(ptr + 1) != 1 || (gHUD.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);
|
||||
}
|
||||
@@ -142,8 +142,8 @@ void sub_080819B4(ItemForSaleEntity* this) {
|
||||
gNewPlayerEntity.unk_74 = 0;
|
||||
ptr = &gHUD;
|
||||
gRoomVars.shopItemType = 0;
|
||||
ptr->unk_2c = 0;
|
||||
ptr->unk_2f = 0;
|
||||
ptr->rActionInteractObject = R_ACTION_NONE;
|
||||
ptr->rActionPlayerState = R_ACTION_NONE;
|
||||
gRoomVars.shopItemType2 = 0;
|
||||
super->x.HALF.HI = this->unk_80 + gRoomControls.origin_x;
|
||||
super->y.HALF.HI = this->unk_82 + gRoomControls.origin_y;
|
||||
@@ -154,13 +154,13 @@ void sub_080819B4(ItemForSaleEntity* this) {
|
||||
super->collisionLayer = 1;
|
||||
super->spritePriority.b0 = 4;
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
sub_08081A5C(this);
|
||||
ItemForSale_MakeInteractable(this);
|
||||
}
|
||||
|
||||
void sub_08081A5C(ItemForSaleEntity* this) {
|
||||
u32 tmp = sub_080787D8(super);
|
||||
void ItemForSale_MakeInteractable(ItemForSaleEntity* this) {
|
||||
u32 tmp = AddInteractableShopItem(super);
|
||||
if (super->timer == 1) {
|
||||
gUnk_03003DF0.array[tmp].unk_2 = 0;
|
||||
gPossibleInteraction.candidates[tmp].interactDirections = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ void sub_080855E8(LilypadLargeEntity* this) {
|
||||
super->flags |= 0x20;
|
||||
if (sub_0806FC80(super, &gPlayerEntity, 0x18) != 0) {
|
||||
|
||||
gPlayerState.flags |= 2;
|
||||
gPlayerState.flags |= PL_FLAGS2;
|
||||
if (gPlayerEntity.z.WORD == 0) {
|
||||
if (gPlayerState.swim_state != 0) {
|
||||
gPlayerEntity.collisionFlags &= 0xfb;
|
||||
@@ -258,7 +258,7 @@ void sub_080855E8(LilypadLargeEntity* this) {
|
||||
this->unk_85 = 0;
|
||||
}
|
||||
|
||||
if ((gPlayerState.flags & 2) != 0) {
|
||||
if ((gPlayerState.flags & PL_FLAGS2) != 0) {
|
||||
sub_08085F1C(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ const struct_0811F730 gUnk_0811F730[] = {
|
||||
{ { 8, 8 }, { 8, -8 } },
|
||||
};
|
||||
|
||||
const u8 gUnk_0811F740[] = {
|
||||
const u8 gLockedDoorInteractDirections[] = {
|
||||
0xBE,
|
||||
0x7D,
|
||||
0xEB,
|
||||
@@ -133,8 +133,9 @@ void LockedDoor_Init(Entity* this) {
|
||||
this->action = 5;
|
||||
} else {
|
||||
this->action = 8;
|
||||
sub_080787CC(this);
|
||||
sub_08078850(this, 0, gUnk_0811F740[this->field_0x7c.BYTES.byte2], 0);
|
||||
AddInteractableSmallKeyLock(this);
|
||||
SetInteractableObjectCollision(this, 0, gLockedDoorInteractDirections[this->field_0x7c.BYTES.byte2],
|
||||
NULL);
|
||||
}
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
|
||||
@@ -44,14 +44,14 @@ void Object37_Init(Object37Entity* this) {
|
||||
void Object37_Action1(Object37Entity* this) {
|
||||
Entity* item;
|
||||
|
||||
if ((gSave.unk24E[0] != 0) && (this->unk70 != *this->unk78)) {
|
||||
if ((gSave.fusionUnmarked[0] != 0) && (this->unk70 != *this->unk78)) {
|
||||
item = CreateGroundItem(super, ITEM_RUPEE100, 0);
|
||||
if (item != 0) {
|
||||
item->direction = gPlayerEntity.animationState << 2;
|
||||
item->speed = 0x80;
|
||||
item->zVelocity = Q_16_16(2.0);
|
||||
}
|
||||
gSave.unk24E[0] = 1;
|
||||
gSave.fusionUnmarked[0] = 1;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void ObjectA(Entity* this) {
|
||||
}
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
sub_080787CC(this);
|
||||
AddInteractableSmallKeyLock(this);
|
||||
}
|
||||
} else if (this->interactType != 0) {
|
||||
SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
|
||||
|
||||
@@ -132,7 +132,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
|
||||
if (sub_080896B0()) {
|
||||
gPlayerState.queued_action = PLAYER_PULL;
|
||||
gPlayerState.field_0x38 = 0x20;
|
||||
gPlayerState.flags |= 1;
|
||||
gPlayerState.flags |= PL_BUSY;
|
||||
gPlayerEntity.x.HALF.LO = 0;
|
||||
gPlayerEntity.y.HALF.LO = 0;
|
||||
super->direction = (gPlayerEntity.animationState ^ 4) << 2;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
extern void sub_08078828(Entity*);
|
||||
extern void AddInteractableChest(Entity*);
|
||||
extern void OpenSmallChest(u32 pos, u32 layer);
|
||||
|
||||
void SpecialChest(Entity* this) {
|
||||
@@ -19,7 +19,7 @@ void SpecialChest(Entity* this) {
|
||||
}
|
||||
this->action = 1;
|
||||
this->collisionLayer = 1;
|
||||
sub_08078828(this);
|
||||
AddInteractableChest(this);
|
||||
}
|
||||
if (this->interactType != 0) {
|
||||
OpenSmallChest(COORD_TO_TILE(this), 2);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "global.h"
|
||||
#include "message.h"
|
||||
|
||||
extern void sub_080787B4(Entity*);
|
||||
extern void AddInteractableCheckableObject(Entity*);
|
||||
void SwordsmanNewsletter_Init(Entity*);
|
||||
void SwordsmanNewsletter_Action1(Entity*);
|
||||
|
||||
@@ -27,7 +27,7 @@ void SwordsmanNewsletter_Init(Entity* this) {
|
||||
this->frameIndex = this->type;
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
this->hitbox = (Hitbox*)&gUnk_081228A8;
|
||||
sub_080787B4(this);
|
||||
AddInteractableCheckableObject(this);
|
||||
}
|
||||
|
||||
void SwordsmanNewsletter_Action1(Entity* this) {
|
||||
|
||||
@@ -22,9 +22,9 @@ void Windcrest(Entity* this) {
|
||||
HandleEntity0x82Actions(this);
|
||||
}
|
||||
|
||||
void sub_080A2124(Entity* this) {
|
||||
static const u8 gUnk_08125010[] = { 0, 0, 12, 12 };
|
||||
sub_08078850(this, 1, 0xe, gUnk_08125010);
|
||||
void Windcrest_ChangeInteractableHitbox(Entity* this) {
|
||||
static const Rect gUnk_08125010 = { 0, 0, 12, 12 };
|
||||
SetInteractableObjectCollision(this, 1, 0xe, &gUnk_08125010);
|
||||
}
|
||||
|
||||
void Windcrest_Unlock(Entity* this) {
|
||||
|
||||
Reference in New Issue
Block a user