mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
z_en_a_keep documentation and cleanup (#900)
This commit is contained in:
parent
42b8cec3d0
commit
d539c259af
3 changed files with 115 additions and 102 deletions
|
@ -855,20 +855,23 @@
|
||||||
<Texture Name="gMoonTex" OutName="moon" Format="ia8" Width="64" Height="64" Offset="0x37F00"/>
|
<Texture Name="gMoonTex" OutName="moon" Format="ia8" Width="64" Height="64" Offset="0x37F00"/>
|
||||||
<DList Name="gMoonDL" Offset="0x38F00"/>
|
<DList Name="gMoonDL" Offset="0x38F00"/>
|
||||||
<Texture Name="gUnknownCircle6Tex" OutName="unknown_circle_6" Format="i8" Width="32" Height="32" Offset="0x38FB0"/>
|
<Texture Name="gUnknownCircle6Tex" OutName="unknown_circle_6" Format="i8" Width="32" Height="32" Offset="0x38FB0"/>
|
||||||
<Collision Name="gUnknown1Col" Offset="0x394B0"/>
|
<Collision Name="gLargerCubeCol" Offset="0x394B0"/> <!-- unused in game -->
|
||||||
<DList Name="gLiftableRockDL" Offset="0x39660"/>
|
<DList Name="gLiftableRockDL" Offset="0x39660"/>
|
||||||
|
|
||||||
|
<!-- unused in game -->
|
||||||
<DList Name="gUnusedRockRectangularPrism1DL" Offset="0x39890"/>
|
<DList Name="gUnusedRockRectangularPrism1DL" Offset="0x39890"/>
|
||||||
<Collision Name="gUnknown2Col" Offset="0x39A48"/>
|
<Collision Name="gWideTallBlockCol" Offset="0x39A48"/>
|
||||||
<DList Name="gUnusedRockRectangularPrism2DL" Offset="0x39C00"/>
|
<DList Name="gFlatBlockDL" Offset="0x39C00"/>
|
||||||
<Collision Name="gUnknown3Col" Offset="0x39DC0"/>
|
<Collision Name="gTallBlockCol" Offset="0x39DC0"/>
|
||||||
<DList Name="gUnusedRockRectangularPrism3DL" Offset="0x39F70"/>
|
<DList Name="gUnusedRockRectangularPrism3DL" Offset="0x39F70"/>
|
||||||
<Collision Name="gUnknown4Col" Offset="0x3A120"/>
|
<Collision Name="gSmallerFlatBlockCol" Offset="0x3A120"/>
|
||||||
<DList Name="gUnusedRockRectangularPrism4DL" Offset="0x3A2D0"/>
|
<DList Name="gFlatRotBlockDL" Offset="0x3A2D0"/>
|
||||||
<Collision Name="gUnknown5Col" Offset="0x3A480"/>
|
<Collision Name="gLargerFlatBlockCol" Offset="0x3A480"/>
|
||||||
<DList Name="gUnusedRockRectangularPrism5DL" Offset="0x3A630"/>
|
<DList Name="gSmallCubeDL" Offset="0x3A630"/>
|
||||||
<Collision Name="gUnknown6Col" Offset="0x3A7F0"/>
|
<Collision Name="gSmallerCubeCol" Offset="0x3A7F0"/>
|
||||||
<DList Name="gUnusedTreeStumpDL" Offset="0x3A9B0"/>
|
<DList Name="gTreeStumpDL" Offset="0x3A9B0"/>
|
||||||
<DList Name="gUnusedGrassBladesDL" Offset="0x3AB80"/>
|
<DList Name="gGrassBladesDL" Offset="0x3AB80"/>
|
||||||
|
|
||||||
<Texture Name="gHeartShapeTex" OutName="heart_shape" Format="i8" Width="16" Height="16" Offset="0x3AC30"/>
|
<Texture Name="gHeartShapeTex" OutName="heart_shape" Format="i8" Width="16" Height="16" Offset="0x3AC30"/>
|
||||||
<DList Name="gHeartPieceInteriorDL" Offset="0x3B030"/>
|
<DList Name="gHeartPieceInteriorDL" Offset="0x3B030"/>
|
||||||
<DList Name="gHeartPieceExteriorDL" Offset="0x3BBA0"/>
|
<DList Name="gHeartPieceExteriorDL" Offset="0x3BBA0"/>
|
||||||
|
|
|
@ -259,6 +259,7 @@ typedef struct EnItem00 {
|
||||||
/* 0x160 */ ColliderCylinder collider;
|
/* 0x160 */ ColliderCylinder collider;
|
||||||
} EnItem00; // size = 0x1AC
|
} EnItem00; // size = 0x1AC
|
||||||
|
|
||||||
|
// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/* 0x00 */ A_OBJ_BLOCK_SMALL,
|
/* 0x00 */ A_OBJ_BLOCK_SMALL,
|
||||||
/* 0x01 */ A_OBJ_BLOCK_LARGE,
|
/* 0x01 */ A_OBJ_BLOCK_LARGE,
|
||||||
|
@ -271,7 +272,8 @@ typedef enum {
|
||||||
/* 0x08 */ A_OBJ_TREE_STUMP,
|
/* 0x08 */ A_OBJ_TREE_STUMP,
|
||||||
/* 0x09 */ A_OBJ_SIGNPOST_OBLONG,
|
/* 0x09 */ A_OBJ_SIGNPOST_OBLONG,
|
||||||
/* 0x0A */ A_OBJ_SIGNPOST_ARROW,
|
/* 0x0A */ A_OBJ_SIGNPOST_ARROW,
|
||||||
/* 0x0B */ A_OBJ_KNOB
|
/* 0x0B */ A_OBJ_BOULDER_FRAGMENT,
|
||||||
|
/* 0x0C */ A_OBJ_MAX
|
||||||
} AObjType;
|
} AObjType;
|
||||||
|
|
||||||
struct EnAObj;
|
struct EnAObj;
|
||||||
|
@ -281,13 +283,13 @@ typedef void (*EnAObjActionFunc)(struct EnAObj*, struct GlobalContext*);
|
||||||
typedef struct EnAObj {
|
typedef struct EnAObj {
|
||||||
/* 0x000 */ DynaPolyActor dyna;
|
/* 0x000 */ DynaPolyActor dyna;
|
||||||
/* 0x164 */ EnAObjActionFunc actionFunc;
|
/* 0x164 */ EnAObjActionFunc actionFunc;
|
||||||
/* 0x168 */ s32 unk_168;
|
/* 0x168 */ s32 rotateWaitTimer;
|
||||||
/* 0x16C */ s16 textId;
|
/* 0x16C */ s16 textId;
|
||||||
/* 0x16E */ s16 unk_16E;
|
/* 0x16E */ s16 rotateState;
|
||||||
/* 0x170 */ s16 unk_170;
|
/* 0x170 */ s16 rotateForTimer;
|
||||||
/* 0x172 */ s16 unk_172;
|
/* 0x172 */ s16 rotSpeedY;
|
||||||
/* 0x174 */ s16 unk_174;
|
/* 0x174 */ s16 rotSpeedX;
|
||||||
/* 0x178 */ f32 unk_178;
|
/* 0x178 */ f32 focusYoffset;
|
||||||
/* 0x17C */ ColliderCylinder collider;
|
/* 0x17C */ ColliderCylinder collider;
|
||||||
} EnAObj; // size = 0x1C8
|
} EnAObj; // size = 0x1C8
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,16 @@ void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||||
void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx);
|
void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||||
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx);
|
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||||
|
|
||||||
void func_8001D204(EnAObj* this, GlobalContext* globalCtx);
|
void EnAObj_WaitFinishedTalking(EnAObj* this, GlobalContext* globalCtx);
|
||||||
void func_8001D25C(EnAObj* this, GlobalContext* globalCtx);
|
void EnAObj_WaitTalk(EnAObj* this, GlobalContext* globalCtx);
|
||||||
void func_8001D360(EnAObj* this, GlobalContext* globalCtx);
|
void EnAObj_BlockRot(EnAObj* this, GlobalContext* globalCtx);
|
||||||
void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx);
|
void EnAObj_BoulderFragment(EnAObj* this, GlobalContext* globalCtx);
|
||||||
void func_8001D608(EnAObj* this, GlobalContext* globalCtx);
|
void EnAObj_Block(EnAObj* this, GlobalContext* globalCtx);
|
||||||
|
|
||||||
void func_8001D234(EnAObj* this, s16 params);
|
void EnAObj_SetupWaitTalk(EnAObj* this, s16 type);
|
||||||
void func_8001D310(EnAObj* this, s16 params);
|
void EnAObj_SetupBlockRot(EnAObj* this, s16 type);
|
||||||
void func_8001D480(EnAObj* this, s16 params);
|
void EnAObj_SetupBoulderFragment(EnAObj* this, s16 type);
|
||||||
void func_8001D5C8(EnAObj* this, s16 params);
|
void EnAObj_SetupBlock(EnAObj* this, s16 type);
|
||||||
|
|
||||||
const ActorInit En_A_Obj_InitVars = {
|
const ActorInit En_A_Obj_InitVars = {
|
||||||
ACTOR_EN_A_OBJ,
|
ACTOR_EN_A_OBJ,
|
||||||
|
@ -54,22 +54,27 @@ static ColliderCylinderInit sCylinderInit = {
|
||||||
{ 25, 60, 0, { 0, 0, 0 } },
|
{ 25, 60, 0, { 0, 0, 0 } },
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CollisionHeader D_06000730;
|
extern CollisionHeader D_06000730; // gHookshotTargetCol ?
|
||||||
|
|
||||||
static CollisionHeader* D_8011546C[] = {
|
static CollisionHeader* sColHeaders[] = {
|
||||||
&gUnknown1Col, &gUnknown1Col, &gUnknown4Col, &gUnknown5Col, &gUnknown6Col, &D_06000730,
|
&gLargerCubeCol, // A_OBJ_GRASS_CLUMP, A_OBJ_TREE_STUMP
|
||||||
|
&gLargerCubeCol, // A_OBJ_BLOCK_LARGE, A_OBJ_BLOCK_HUGE
|
||||||
|
&gSmallerFlatBlockCol, // unused
|
||||||
|
&gLargerFlatBlockCol, // A_OBJ_BLOCK_SMALL_ROT, A_OBJ_BLOCK_LARGE_ROT
|
||||||
|
&gSmallerCubeCol, // unused
|
||||||
|
&D_06000730, // A_OBJ_UNKNOWN_6
|
||||||
};
|
};
|
||||||
|
|
||||||
static Gfx* D_80115484[] = {
|
static Gfx* sDLists[] = {
|
||||||
gUnusedRockRectangularPrism2DL,
|
gFlatBlockDL,
|
||||||
gUnusedRockRectangularPrism2DL,
|
gFlatBlockDL,
|
||||||
gUnusedRockRectangularPrism2DL,
|
gFlatBlockDL,
|
||||||
gUnusedRockRectangularPrism4DL,
|
gFlatRotBlockDL,
|
||||||
gUnusedRockRectangularPrism4DL,
|
gFlatRotBlockDL,
|
||||||
gUnusedRockRectangularPrism5DL,
|
gSmallCubeDL,
|
||||||
0x06000210,
|
/* gHookshotPostDL ? */ 0x06000210,
|
||||||
gUnusedGrassBladesDL,
|
gGrassBladesDL,
|
||||||
gUnusedTreeStumpDL,
|
gTreeStumpDL,
|
||||||
gSignRectangularDL,
|
gSignRectangularDL,
|
||||||
gSignDirectionalDL,
|
gSignDirectionalDL,
|
||||||
gBoulderFragmentsDL,
|
gBoulderFragmentsDL,
|
||||||
|
@ -83,7 +88,7 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
CollisionHeader* colHeader = NULL;
|
CollisionHeader* colHeader = NULL;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
EnAObj* this = THIS;
|
EnAObj* this = THIS;
|
||||||
f32 sp28 = 6.0f;
|
f32 shadowScale = 6.0f;
|
||||||
|
|
||||||
this->textId = (thisx->params >> 8) & 0xFF;
|
this->textId = (thisx->params >> 8) & 0xFF;
|
||||||
thisx->params &= 0xFF;
|
thisx->params &= 0xFF;
|
||||||
|
@ -109,11 +114,11 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thisx->params >= 9) {
|
if (thisx->params >= A_OBJ_SIGNPOST_OBLONG) {
|
||||||
sp28 = 12.0f;
|
shadowScale = 12.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, sp28);
|
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, shadowScale);
|
||||||
|
|
||||||
thisx->focus.pos = thisx->world.pos;
|
thisx->focus.pos = thisx->world.pos;
|
||||||
this->dyna.bgId = BGACTOR_NEG_ONE;
|
this->dyna.bgId = BGACTOR_NEG_ONE;
|
||||||
|
@ -127,25 +132,25 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
case A_OBJ_BLOCK_HUGE:
|
case A_OBJ_BLOCK_HUGE:
|
||||||
this->dyna.bgId = 1;
|
this->dyna.bgId = 1;
|
||||||
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
|
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
|
||||||
func_8001D5C8(this, thisx->params);
|
EnAObj_SetupBlock(this, thisx->params);
|
||||||
break;
|
break;
|
||||||
case A_OBJ_BLOCK_SMALL_ROT:
|
case A_OBJ_BLOCK_SMALL_ROT:
|
||||||
case A_OBJ_BLOCK_LARGE_ROT:
|
case A_OBJ_BLOCK_LARGE_ROT:
|
||||||
this->dyna.bgId = 3;
|
this->dyna.bgId = 3;
|
||||||
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
|
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG);
|
||||||
func_8001D310(this, thisx->params);
|
EnAObj_SetupBlockRot(this, thisx->params);
|
||||||
break;
|
break;
|
||||||
case A_OBJ_UNKNOWN_6:
|
case A_OBJ_UNKNOWN_6:
|
||||||
// clang-format off
|
// clang-format off
|
||||||
thisx->flags |= 0x1; this->dyna.bgId = 5; this->unk_178 = 10.0f;
|
thisx->flags |= 0x1; this->dyna.bgId = 5; this->focusYoffset = 10.0f;
|
||||||
// clang-format on
|
// clang-format on
|
||||||
thisx->gravity = -2.0f;
|
thisx->gravity = -2.0f;
|
||||||
func_8001D234(this, thisx->params);
|
EnAObj_SetupWaitTalk(this, thisx->params);
|
||||||
break;
|
break;
|
||||||
case A_OBJ_GRASS_CLUMP:
|
case A_OBJ_GRASS_CLUMP:
|
||||||
case A_OBJ_TREE_STUMP:
|
case A_OBJ_TREE_STUMP:
|
||||||
this->dyna.bgId = 0;
|
this->dyna.bgId = 0;
|
||||||
func_8001D234(this, thisx->params);
|
EnAObj_SetupWaitTalk(this, thisx->params);
|
||||||
break;
|
break;
|
||||||
case A_OBJ_SIGNPOST_OBLONG:
|
case A_OBJ_SIGNPOST_OBLONG:
|
||||||
case A_OBJ_SIGNPOST_ARROW:
|
case A_OBJ_SIGNPOST_ARROW:
|
||||||
|
@ -153,29 +158,29 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
thisx->flags |= 0x1 | 0x8; thisx->targetArrowOffset = 500.0f;
|
thisx->flags |= 0x1 | 0x8; thisx->targetArrowOffset = 500.0f;
|
||||||
// clang-format on
|
// clang-format on
|
||||||
this->unk_178 = 45.0f;
|
this->focusYoffset = 45.0f;
|
||||||
func_8001D234(this, thisx->params);
|
EnAObj_SetupWaitTalk(this, thisx->params);
|
||||||
Collider_InitCylinder(globalCtx, &this->collider);
|
Collider_InitCylinder(globalCtx, &this->collider);
|
||||||
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
|
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
|
||||||
thisx->colChkInfo.mass = MASS_IMMOVABLE;
|
thisx->colChkInfo.mass = MASS_IMMOVABLE;
|
||||||
thisx->targetMode = 0;
|
thisx->targetMode = 0;
|
||||||
break;
|
break;
|
||||||
case A_OBJ_KNOB:
|
case A_OBJ_BOULDER_FRAGMENT:
|
||||||
thisx->gravity = -1.5f;
|
thisx->gravity = -1.5f;
|
||||||
func_8001D480(this, thisx->params);
|
EnAObj_SetupBoulderFragment(this, thisx->params);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
thisx->gravity = -2.0f;
|
thisx->gravity = -2.0f;
|
||||||
func_8001D234(this, thisx->params);
|
EnAObj_SetupWaitTalk(this, thisx->params);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thisx->params < 5) {
|
if (thisx->params <= A_OBJ_BLOCK_LARGE_ROT) { // A_OBJ_BLOCK_*
|
||||||
thisx->colChkInfo.mass = MASS_IMMOVABLE;
|
thisx->colChkInfo.mass = MASS_IMMOVABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->dyna.bgId != BGACTOR_NEG_ONE) {
|
if (this->dyna.bgId != BGACTOR_NEG_ONE) {
|
||||||
CollisionHeader_GetVirtual(D_8011546C[this->dyna.bgId], &colHeader);
|
CollisionHeader_GetVirtual(sColHeaders[this->dyna.bgId], &colHeader);
|
||||||
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
|
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,27 +194,29 @@ void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
case A_OBJ_SIGNPOST_OBLONG:
|
case A_OBJ_SIGNPOST_OBLONG:
|
||||||
case A_OBJ_SIGNPOST_ARROW:
|
case A_OBJ_SIGNPOST_ARROW:
|
||||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D204(EnAObj* this, GlobalContext* globalCtx) {
|
void EnAObj_WaitFinishedTalking(EnAObj* this, GlobalContext* globalCtx) {
|
||||||
if (func_8002F334(&this->dyna.actor, globalCtx)) {
|
if (func_8002F334(&this->dyna.actor, globalCtx)) {
|
||||||
func_8001D234(this, this->dyna.actor.params);
|
EnAObj_SetupWaitTalk(this, this->dyna.actor.params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D234(EnAObj* this, s16 params) {
|
void EnAObj_SetupWaitTalk(EnAObj* this, s16 type) {
|
||||||
EnAObj_SetupAction(this, func_8001D25C);
|
EnAObj_SetupAction(this, EnAObj_WaitTalk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) {
|
void EnAObj_WaitTalk(EnAObj* this, GlobalContext* globalCtx) {
|
||||||
s16 var;
|
s16 relYawTowardsPlayer;
|
||||||
|
|
||||||
if (this->dyna.actor.textId != 0) {
|
if (this->dyna.actor.textId != 0) {
|
||||||
var = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
|
relYawTowardsPlayer = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
|
||||||
if ((ABS(var) < 0x2800) || ((this->dyna.actor.params == 0xA) && (ABS(var) > 0x5800))) {
|
if (ABS(relYawTowardsPlayer) < 0x2800 ||
|
||||||
|
(this->dyna.actor.params == A_OBJ_SIGNPOST_ARROW && ABS(relYawTowardsPlayer) > 0x5800)) {
|
||||||
if (func_8002F194(&this->dyna.actor, globalCtx)) {
|
if (func_8002F194(&this->dyna.actor, globalCtx)) {
|
||||||
EnAObj_SetupAction(this, func_8001D204);
|
EnAObj_SetupAction(this, EnAObj_WaitFinishedTalking);
|
||||||
} else {
|
} else {
|
||||||
func_8002F2F4(&this->dyna.actor, globalCtx);
|
func_8002F2F4(&this->dyna.actor, globalCtx);
|
||||||
}
|
}
|
||||||
|
@ -217,45 +224,45 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D310(EnAObj* this, s16 params) {
|
void EnAObj_SetupBlockRot(EnAObj* this, s16 type) {
|
||||||
this->unk_16E = 0;
|
this->rotateState = 0;
|
||||||
this->unk_168 = 10;
|
this->rotateWaitTimer = 10;
|
||||||
this->dyna.actor.world.rot.y = 0;
|
this->dyna.actor.world.rot.y = 0;
|
||||||
this->dyna.actor.shape.rot = this->dyna.actor.world.rot;
|
this->dyna.actor.shape.rot = this->dyna.actor.world.rot;
|
||||||
EnAObj_SetupAction(this, func_8001D360);
|
EnAObj_SetupAction(this, EnAObj_BlockRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D360(EnAObj* this, GlobalContext* globalCtx) {
|
void EnAObj_BlockRot(EnAObj* this, GlobalContext* globalCtx) {
|
||||||
if (this->unk_16E == 0) {
|
if (this->rotateState == 0) {
|
||||||
if (this->dyna.unk_160 != 0) {
|
if (this->dyna.unk_160 != 0) {
|
||||||
this->unk_16E++;
|
this->rotateState++;
|
||||||
this->unk_170 = 20;
|
this->rotateForTimer = 20;
|
||||||
|
|
||||||
if ((s16)(this->dyna.actor.yawTowardsPlayer + 0x4000) < 0) {
|
if ((s16)(this->dyna.actor.yawTowardsPlayer + 0x4000) < 0) {
|
||||||
this->unk_174 = -1000;
|
this->rotSpeedX = -0x3E8;
|
||||||
} else {
|
} else {
|
||||||
this->unk_174 = 1000;
|
this->rotSpeedX = 0x3E8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->dyna.actor.yawTowardsPlayer < 0) {
|
if (this->dyna.actor.yawTowardsPlayer < 0) {
|
||||||
this->unk_172 = -this->unk_174;
|
this->rotSpeedY = -this->rotSpeedX;
|
||||||
} else {
|
} else {
|
||||||
this->unk_172 = this->unk_174;
|
this->rotSpeedY = this->rotSpeedX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this->unk_168 != 0) {
|
if (this->rotateWaitTimer != 0) {
|
||||||
this->unk_168--;
|
this->rotateWaitTimer--;
|
||||||
} else {
|
} else {
|
||||||
this->dyna.actor.shape.rot.y += this->unk_172;
|
this->dyna.actor.shape.rot.y += this->rotSpeedY;
|
||||||
this->dyna.actor.shape.rot.x += this->unk_174;
|
this->dyna.actor.shape.rot.x += this->rotSpeedX;
|
||||||
this->unk_170--;
|
this->rotateForTimer--;
|
||||||
this->dyna.actor.gravity = -1.0f;
|
this->dyna.actor.gravity = -1.0f;
|
||||||
|
|
||||||
if (this->unk_170 == 0) {
|
if (this->rotateForTimer == 0) {
|
||||||
this->dyna.actor.world.pos = this->dyna.actor.home.pos;
|
this->dyna.actor.world.pos = this->dyna.actor.home.pos;
|
||||||
this->unk_16E = 0;
|
this->rotateState = 0;
|
||||||
this->unk_168 = 10;
|
this->rotateWaitTimer = 10;
|
||||||
this->dyna.actor.velocity.y = 0.0f;
|
this->dyna.actor.velocity.y = 0.0f;
|
||||||
this->dyna.actor.gravity = 0.0f;
|
this->dyna.actor.gravity = 0.0f;
|
||||||
this->dyna.actor.shape.rot = this->dyna.actor.world.rot;
|
this->dyna.actor.shape.rot = this->dyna.actor.world.rot;
|
||||||
|
@ -264,19 +271,19 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D480(EnAObj* this, s16 params) {
|
void EnAObj_SetupBoulderFragment(EnAObj* this, s16 type) {
|
||||||
EnAObj_SetupAction(this, func_8001D4A8);
|
EnAObj_SetupAction(this, EnAObj_BoulderFragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx) {
|
void EnAObj_BoulderFragment(EnAObj* this, GlobalContext* globalCtx) {
|
||||||
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
|
Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
|
||||||
this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.world.rot.x >> 1);
|
this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x >> 1;
|
||||||
this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.world.rot.z >> 1);
|
this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z >> 1;
|
||||||
|
|
||||||
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & 0x8)) {
|
if (this->dyna.actor.speedXZ != 0.0f && this->dyna.actor.bgCheckFlags & 0x8) {
|
||||||
this->dyna.actor.world.rot.y =
|
this->dyna.actor.world.rot.y =
|
||||||
((this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw) - 0x8000;
|
this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y + this->dyna.actor.wallYaw - 0x8000;
|
||||||
if (1) {} // Necessary to match
|
if (1) {}
|
||||||
this->dyna.actor.bgCheckFlags &= ~0x8;
|
this->dyna.actor.bgCheckFlags &= ~0x8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,13 +298,13 @@ void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D5C8(EnAObj* this, s16 params) {
|
void EnAObj_SetupBlock(EnAObj* this, s16 type) {
|
||||||
this->dyna.actor.uncullZoneDownward = 1200.0f;
|
this->dyna.actor.uncullZoneDownward = 1200.0f;
|
||||||
this->dyna.actor.uncullZoneScale = 720.0f;
|
this->dyna.actor.uncullZoneScale = 720.0f;
|
||||||
EnAObj_SetupAction(this, func_8001D608);
|
EnAObj_SetupAction(this, EnAObj_Block);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_8001D608(EnAObj* this, GlobalContext* globalCtx) {
|
void EnAObj_Block(EnAObj* this, GlobalContext* globalCtx) {
|
||||||
this->dyna.actor.speedXZ += this->dyna.unk_150;
|
this->dyna.actor.speedXZ += this->dyna.unk_150;
|
||||||
this->dyna.actor.world.rot.y = this->dyna.unk_158;
|
this->dyna.actor.world.rot.y = this->dyna.unk_158;
|
||||||
this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f);
|
this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f);
|
||||||
|
@ -319,7 +326,7 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
Actor_MoveForward(&this->dyna.actor);
|
Actor_MoveForward(&this->dyna.actor);
|
||||||
|
|
||||||
if (this->dyna.actor.gravity != 0.0f) {
|
if (this->dyna.actor.gravity != 0.0f) {
|
||||||
if (this->dyna.actor.params != A_OBJ_KNOB) {
|
if (this->dyna.actor.params != A_OBJ_BOULDER_FRAGMENT) {
|
||||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D);
|
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D);
|
||||||
} else {
|
} else {
|
||||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D);
|
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D);
|
||||||
|
@ -327,13 +334,14 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this->dyna.actor.focus.pos = this->dyna.actor.world.pos;
|
this->dyna.actor.focus.pos = this->dyna.actor.world.pos;
|
||||||
this->dyna.actor.focus.pos.y += this->unk_178;
|
this->dyna.actor.focus.pos.y += this->focusYoffset;
|
||||||
|
|
||||||
switch (this->dyna.actor.params) {
|
switch (this->dyna.actor.params) {
|
||||||
case A_OBJ_SIGNPOST_OBLONG:
|
case A_OBJ_SIGNPOST_OBLONG:
|
||||||
case A_OBJ_SIGNPOST_ARROW:
|
case A_OBJ_SIGNPOST_ARROW:
|
||||||
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
|
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
|
||||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,17 +352,17 @@ void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
|
|
||||||
func_80093D18(globalCtx->state.gfxCtx);
|
func_80093D18(globalCtx->state.gfxCtx);
|
||||||
|
|
||||||
if (type > A_OBJ_KNOB) {
|
if (type >= A_OBJ_MAX) {
|
||||||
type = A_OBJ_KNOB;
|
type = A_OBJ_BOULDER_FRAGMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thisx->params == A_OBJ_KNOB) {
|
if (thisx->params == A_OBJ_BOULDER_FRAGMENT) {
|
||||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 60, 60, 60, 50);
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 60, 60, 60, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712),
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712),
|
||||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||||
gSPDisplayList(POLY_OPA_DISP++, D_80115484[type]);
|
gSPDisplayList(POLY_OPA_DISP++, sDLists[type]);
|
||||||
|
|
||||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
|
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue