mirror of
https://github.com/zeldaret/tmc
synced 2026-06-01 17:58:06 -04:00
Merge branch 'master' into cleanup_declarations
This commit is contained in:
@@ -19,7 +19,7 @@ void sub_0808F658(Entity* this) {
|
||||
this->spritePriority.b0 = this->type;
|
||||
this->frameIndex = this->type;
|
||||
this->direction = 8;
|
||||
this->nonPlanarMovement = gUnk_08121EB0[this->type];
|
||||
this->speed = gUnk_08121EB0[this->type];
|
||||
this->field_0x78.HWORD = gRoomControls.roomOriginX - 0x60;
|
||||
this->field_0x7a.HWORD = gRoomControls.roomOriginX + gRoomControls.width + 0x60;
|
||||
this->animationState = 0;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ void sub_0809CF54(Entity* this) {
|
||||
this->field_0x20 = -0x18000;
|
||||
this->height.WORD = -0x38C000;
|
||||
this->field_0x68.HWORD = -0x800;
|
||||
this->nonPlanarMovement = 0x280;
|
||||
this->speed = 0x280;
|
||||
this->direction = 8;
|
||||
this->collisionLayer = 2;
|
||||
this->x.HALF.HI = gRoomControls.roomScrollX;
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@ void sub_0809F7BC(Entity* this) {
|
||||
cloud = sub_0809F770(this);
|
||||
if (cloud != NULL) {
|
||||
uVar1 = Random();
|
||||
cloud->nonPlanarMovement = gUnk_081247C8[uVar1 & 3];
|
||||
cloud->speed = gUnk_081247C8[uVar1 & 3];
|
||||
cloud->direction = (u8)(uVar1 >> 8) & 31;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ static u32 sub_0808EF6C(Entity* this) {
|
||||
if (this->field_0x6c.HWORD < var7) {
|
||||
var7 = this->field_0x6c.HWORD;
|
||||
}
|
||||
this->nonPlanarMovement = var7;
|
||||
this->speed = var7;
|
||||
this->direction = sub_080045DA(var0, var2) >> 3;
|
||||
sub_0806F69C(this);
|
||||
return 1;
|
||||
@@ -515,7 +515,7 @@ static void sub_0808EFF0(Entity* this) {
|
||||
u8 var1;
|
||||
|
||||
this->spriteSettings.b.draw = 2;
|
||||
this->nonPlanarMovement = 0x400;
|
||||
this->speed = 0x400;
|
||||
this->currentHealth = 1;
|
||||
this->frameIndex = 0xFF;
|
||||
this->animIndex = 0xFF;
|
||||
|
||||
+15
-14
@@ -6,6 +6,7 @@
|
||||
#include "flags.h"
|
||||
#include "save.h"
|
||||
#include "random.h"
|
||||
#include "script.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
|
||||
@@ -160,21 +161,21 @@ void GreatFairy_WingsInit(Entity* this) {
|
||||
this->spriteRendering.alphaBlend = 1;
|
||||
gScreen.controls.layerFXControl = 0xF40;
|
||||
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 8);
|
||||
this->nonPlanarMovement = 1024;
|
||||
this->speed = 1024;
|
||||
sub_0805EC9C(this, 1024, 256, 0);
|
||||
}
|
||||
|
||||
void GreatFairy_WingsUpdate(Entity* this) {
|
||||
s32 iVar1;
|
||||
|
||||
iVar1 = this->nonPlanarMovement -= 32;
|
||||
iVar1 = this->speed -= 32;
|
||||
if (iVar1 * 65536 >> 16 == 256) {
|
||||
this->action = 2;
|
||||
sub_0805EC60(this);
|
||||
gRoomVars.greatFairyState |= 32;
|
||||
gUnk_02033280.unk_00 |= 4;
|
||||
gActiveScriptInfo.unk_00 |= 4;
|
||||
} else {
|
||||
sub_0805EC9C(this, this->nonPlanarMovement, 256, 0);
|
||||
sub_0805EC9C(this, this->speed, 256, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +262,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) {
|
||||
if (this->height.HALF.HI == -20) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 90;
|
||||
this->nonPlanarMovement = 4096;
|
||||
this->speed = 4096;
|
||||
this->spriteRendering.b0 = 3;
|
||||
sub_0805EC9C(this, 256, 256, 0);
|
||||
}
|
||||
@@ -276,7 +277,7 @@ void GreatFairy_MiniAffineUpdate(Entity* this) {
|
||||
this->action = 3;
|
||||
sub_0805EC60(this);
|
||||
} else {
|
||||
iVar2 = this->nonPlanarMovement -= 24;
|
||||
iVar2 = this->speed -= 24;
|
||||
sub_0805EC9C(this, 256, iVar2 * 0x10000 >> 20, 0);
|
||||
}
|
||||
}
|
||||
@@ -387,7 +388,7 @@ void sub_08087150(Entity* this) {
|
||||
this->spriteOrientation.flipY = 0;
|
||||
this->spriteRendering.b0 = 0;
|
||||
this->spritePriority.b0 = 3;
|
||||
this->nonPlanarMovement = 0x80;
|
||||
this->speed = 0x80;
|
||||
this->direction = 0x10;
|
||||
temp = gUnk_0812079C;
|
||||
this->palette.raw = ((temp & 0xf) << 4) | 0xf;
|
||||
@@ -464,7 +465,7 @@ void sub_080872AC(Entity* this) {
|
||||
this->field_0x68.HWORD = this->x.HALF.HI;
|
||||
this->field_0x6a.HWORD = this->y.HALF.HI;
|
||||
this->direction = (u8)Random() & 0x1F;
|
||||
this->nonPlanarMovement = 32;
|
||||
this->speed = 32;
|
||||
GreatFairy_InitializeAnimation(this);
|
||||
}
|
||||
|
||||
@@ -530,7 +531,7 @@ void sub_080873FC(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08087424(Entity* arg0, struct_08087424* arg1) {
|
||||
void sub_08087424(Entity* this, ScriptExecutionContext* context) {
|
||||
Entity* ent;
|
||||
|
||||
sub_080791D0();
|
||||
@@ -541,9 +542,9 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) {
|
||||
sub_0805E3A0(ent, 2);
|
||||
}
|
||||
|
||||
switch (arg1->unk4) {
|
||||
switch (context->intVariable) {
|
||||
case 0:
|
||||
gSave.stats.arrowCount = arg1->unk4;
|
||||
gSave.stats.arrowCount = 0;
|
||||
break;
|
||||
case 1:
|
||||
gSave.stats.bombCount = 0;
|
||||
@@ -551,14 +552,14 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0808747C(u32 arg0, u32 arg1) {
|
||||
u32 iVar1;
|
||||
void sub_0808747C(Entity* this, ScriptExecutionContext* context) {
|
||||
u32 iVar1 = 0;
|
||||
|
||||
iVar1 = (u32)FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0);
|
||||
if (iVar1 != 0) {
|
||||
iVar1 = 1;
|
||||
}
|
||||
*(u32*)(arg1 + 0x14) = iVar1;
|
||||
context->condition = iVar1;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
|
||||
@@ -117,7 +117,7 @@ static void sub_0808681C(Entity* this) {
|
||||
}
|
||||
|
||||
if (this->flags & 0x2) {
|
||||
ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
sub_080868EC(this, *(void**)&this->cutsceneBeh);
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ void sub_080868B0(Entity* this) {
|
||||
this->hitbox = &gUnk_081206AC;
|
||||
this->actionDelay = 8;
|
||||
}
|
||||
ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
sub_080868EC(this, *(void**)&this->cutsceneBeh);
|
||||
}
|
||||
|
||||
@@ -174,11 +174,10 @@ static u8 sub_08086954(Entity* this) {
|
||||
return this->actionDelay;
|
||||
}
|
||||
|
||||
// TODO: Second arg is some unknown struct.
|
||||
void sub_080869A4(Entity* entityA, u32* entityB) {
|
||||
entityB[5] = 0;
|
||||
if (!sub_08086954(entityA)) {
|
||||
entityA->actionDelay = 8;
|
||||
entityB[5] = 1;
|
||||
void sub_080869A4(Entity* this, ScriptExecutionContext* context) {
|
||||
context->condition = 0;
|
||||
if (!sub_08086954(this)) {
|
||||
this->actionDelay = 8;
|
||||
context->condition = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,8 +141,8 @@ static void sub_080810A8(Entity* this) {
|
||||
sub_080814A4(this);
|
||||
if (this->direction & 0x80) {
|
||||
this->direction &= 0x1F;
|
||||
if (this->nonPlanarMovement == 0) {
|
||||
this->nonPlanarMovement = 0x100;
|
||||
if (this->speed == 0) {
|
||||
this->speed = 0x100;
|
||||
}
|
||||
} else {
|
||||
this->direction |= 0xFF;
|
||||
@@ -259,7 +259,7 @@ void sub_080812A0(Entity* this) {
|
||||
void sub_080812A8(Entity* this) {
|
||||
if (sub_080002D0(this) != 0xF && this->field_0x6e.HWORD != GetTileTypeByEntity(this)) {
|
||||
this->direction = 0;
|
||||
this->nonPlanarMovement = 0;
|
||||
this->speed = 0;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->field_0x68.HALF.HI = 0;
|
||||
sub_080810A8(this);
|
||||
|
||||
@@ -22,7 +22,7 @@ void sub_080A0684(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
this->action = 1;
|
||||
this->nonPlanarMovement = 0x300;
|
||||
this->speed = 0x300;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->frameIndex = 0;
|
||||
this->spriteSettings.b.flipY = 1;
|
||||
|
||||
@@ -50,7 +50,7 @@ void sub_080916EC(Entity* this) {
|
||||
this->field_0x40 = 0x44;
|
||||
this->flags2 = 0x80;
|
||||
this->direction = DirectionFromAnimationState(this->animationState);
|
||||
this->nonPlanarMovement = 0x700;
|
||||
this->speed = 0x700;
|
||||
this->spritePriority.b1 = 3;
|
||||
InitAnimationForceUpdate(this, this->type2 + 4 + this->animationState);
|
||||
SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
|
||||
@@ -80,7 +80,7 @@ void sub_080917DC(Entity* this) {
|
||||
gPlayerState.jumpStatus = 0x81;
|
||||
gPlayerState.flags.all |= 0x4000000;
|
||||
gPlayerEntity.field_0x20 = 0x20000;
|
||||
gPlayerEntity.nonPlanarMovement = 0x100;
|
||||
gPlayerEntity.speed = 0x100;
|
||||
gPlayerEntity.flags &= 0x7f;
|
||||
ResetPlayer();
|
||||
sub_0807A108();
|
||||
@@ -142,7 +142,7 @@ void sub_080919AC(Entity* this) {
|
||||
}
|
||||
} else {
|
||||
this->flags = this->flags | 0x80;
|
||||
gPlayerEntity.nonPlanarMovement = 0;
|
||||
gPlayerEntity.speed = 0;
|
||||
sub_0806F69C(this);
|
||||
CopyPosition(this, &gPlayerEntity);
|
||||
gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
|
||||
@@ -175,7 +175,7 @@ void sub_080919AC(Entity* this) {
|
||||
gPlayerState.jumpStatus = 0x41;
|
||||
gPlayerState.flags.all = (gPlayerState.flags.all ^ 0x1000) | 0x4000000;
|
||||
gPlayerEntity.field_0x20 = 0x20000;
|
||||
gPlayerEntity.nonPlanarMovement = 0x200;
|
||||
gPlayerEntity.speed = 0x200;
|
||||
gPlayerEntity.animationState = this->animationState << 1;
|
||||
gPlayerEntity.direction = this->direction;
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
|
||||
@@ -55,5 +55,5 @@ void sub_08086A6C(Entity* ent) {
|
||||
uVar1 = Random();
|
||||
ent->field_0x20 = 163840;
|
||||
ent->direction = (uVar1 >> 16) & 31;
|
||||
ent->nonPlanarMovement = uVar1 & 480;
|
||||
ent->speed = uVar1 & 480;
|
||||
}
|
||||
|
||||
@@ -106,6 +106,6 @@ void sub_0809F448(Entity* this) {
|
||||
tmp += -0x80000 + (rand & 0xFFFFF);
|
||||
break;
|
||||
}
|
||||
this->nonPlanarMovement = (tmp > 0 ? tmp : -tmp) / (tmp2->unk_1 << 8);
|
||||
this->speed = (tmp > 0 ? tmp : -tmp) / (tmp2->unk_1 << 8);
|
||||
this->direction = sub_080045DA(tmp, 0) >> 3;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ void ObjectB2(Entity* this) {
|
||||
this->attachedEntity = pEVar3;
|
||||
InitializeAnimation(this, this->type);
|
||||
}
|
||||
this->nonPlanarMovement = this->parent->nonPlanarMovement;
|
||||
this->speed = this->parent->speed;
|
||||
sub_0806F69C(this);
|
||||
if (sub_080AE4CC(this->attachedEntity, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->nonPlanarMovement < 0x41) {
|
||||
if (this->speed < 0x41) {
|
||||
this->spriteSettings.b.draw ^= 1;
|
||||
|
||||
if (--this->actionDelay == 0) {
|
||||
|
||||
+3
-3
@@ -32,7 +32,7 @@ void sub_0808222C(Entity* this) {
|
||||
|
||||
this->action = 1;
|
||||
this->hitbox = &gUnk_080FD338;
|
||||
this->nonPlanarMovement = 0x80;
|
||||
this->speed = 0x80;
|
||||
this->y.HALF.HI += 3;
|
||||
this->field_0x16 = 0;
|
||||
this->flags |= 0x80;
|
||||
@@ -84,7 +84,7 @@ void sub_08082310(Entity* this) {
|
||||
this->actionDelay = 32;
|
||||
this->action = 4;
|
||||
if (gPlayerState.flags.all & 0x80) {
|
||||
this->nonPlanarMovement >>= 1;
|
||||
this->speed >>= 1;
|
||||
this->actionDelay = 64;
|
||||
}
|
||||
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
|
||||
@@ -183,7 +183,7 @@ void sub_08082614(Entity* this) {
|
||||
|
||||
this->action = 1;
|
||||
if (gPlayerState.flags.all & 0x80) {
|
||||
this->nonPlanarMovement <<= 1;
|
||||
this->speed <<= 1;
|
||||
}
|
||||
|
||||
this->field_0x70.HALF.LO = sub_080001DA(COORD_TO_TILE(this), this->collisionLayer);
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ void sub_0808A46C(Entity* this) {
|
||||
void sub_0808A484(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->nonPlanarMovement = 0x40;
|
||||
this->speed = 0x40;
|
||||
this->direction = 6;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->spritePriority.b0 = 0;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
#include "script.h"
|
||||
|
||||
@@ -14,8 +13,8 @@ void Windcrest(Entity* this) {
|
||||
this->frameIndex = 0;
|
||||
sub_0807DD64(this);
|
||||
}
|
||||
sub_0807DDAC(this, NULL);
|
||||
sub_0807DDE4(this);
|
||||
ExecuteScriptForEntity(this, NULL);
|
||||
HandleEntity0x82Actions(this);
|
||||
}
|
||||
|
||||
void sub_080A2124(Entity* this) {
|
||||
|
||||
Reference in New Issue
Block a user