1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 06:10:21 +00:00

Actor Struct Changes (and a few related things) (#617)

* reformat header

* type -> category

* done for now i think

* some more stuff

* first -> head

* focus

* flag comment

* ground -> floor

* remove asm, name wrapper funcs

* name func, format

* review

* targetPriority, format

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "0305ec2c2"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "0305ec2c2"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* comment

* review

* feet flags

* horse shadow
This commit is contained in:
fig02 2021-01-18 16:04:04 -05:00 committed by GitHub
parent 20206fba0d
commit 00a5edea71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
697 changed files with 8157 additions and 7942 deletions

View file

@ -58,7 +58,7 @@ extern Gfx D_06002C10[]; // 2D Guard in Window
const ActorInit En_Heishi2_InitVars = {
ACTOR_EN_HEISHI2,
ACTORTYPE_NPC,
ACTORCAT_NPC,
FLAGS,
OBJECT_SD,
sizeof(EnHeishi2),
@ -99,7 +99,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
if ((this->initParams == 6) || (this->initParams == 9)) {
this->actor.draw = func_80A54C6C;
this->actor.flags &= -2;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, 6);
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, 6);
if (this->initParams == 6) {
this->actionFunc = func_80A531CC;
@ -110,12 +110,12 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.02f);
this->unk_274 = this->actor.posRot.pos;
this->actor.posRot.rot.y = 0x7918;
this->actor.posRot.pos.x += 90.0f;
this->actor.posRot.pos.y -= 60.0f;
this->actor.posRot.pos.z += 90.0f;
this->actor.shape.rot.y = this->actor.posRot.rot.y;
this->unk_274 = this->actor.world.pos;
this->actor.world.rot.y = 0x7918;
this->actor.world.pos.x += 90.0f;
this->actor.world.pos.y -= 60.0f;
this->actor.world.pos.z += 90.0f;
this->actor.shape.rot.y = this->actor.world.rot.y;
Collider_DestroyCylinder(globalCtx, &this->collider);
func_8002DF54(globalCtx, 0, 8);
this->actor.flags |= 0x11;
@ -123,7 +123,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
}
} else {
this->unk_2E0 = 60.0f;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17);
collider = &this->collider;
Collider_InitCylinder(globalCtx, collider);
@ -131,7 +131,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->collider.dim.yShift = 0;
this->collider.dim.radius = 0xF;
this->collider.dim.height = 0x46;
this->actor.unk_1F = 6;
this->actor.targetMode = 6;
switch (this->initParams) {
@ -291,7 +291,7 @@ void func_80A53638(EnHeishi2* this, GlobalContext* globalCtx) {
frameCount = this->skelAnime.curFrame;
thisx = &this->actor;
actor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first;
actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head;
SkelAnime_Update(&this->skelAnime);
if ((frameCount >= 12.0f) && (!this->audioFlag)) {
Audio_PlayActorSound2(thisx, NA_SE_EV_SPEAR_HIT);
@ -423,9 +423,9 @@ void func_80A53AD4(EnHeishi2* this, GlobalContext* globalCtx) {
player->actor.textId = 0x200F; // "I don't want that!"
}
} else {
yawDiffTemp = this->actor.yawTowardsLink - this->actor.shape.rot.y;
yawDiffTemp = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
yawDiff = ABS(yawDiffTemp);
if (!(120.0f < this->actor.xzDistToLink) && (yawDiff < 0x4300)) {
if (!(120.0f < this->actor.xzDistToPlayer) && (yawDiff < 0x4300)) {
func_8002F298(&this->actor, globalCtx, 100.0f, EXCH_ITEM_LETTER_ZELDA);
}
}
@ -456,7 +456,7 @@ void func_80A53D0C(EnHeishi2* this, GlobalContext* globalCtx) {
BgGateShutter* gate;
frameCount = this->skelAnime.curFrame;
gate = (BgGateShutter*)globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first;
gate = (BgGateShutter*)globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head;
SkelAnime_Update(&this->skelAnime);
if (12.0f <= frameCount) {
if (this->audioFlag == 0) {
@ -621,7 +621,7 @@ void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx) {
frameCount = this->skelAnime.curFrame;
thisx = &this->actor;
gate = (BgGateShutter*)(globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first);
gate = (BgGateShutter*)(globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head);
SkelAnime_Update(&this->skelAnime);
if ((frameCount >= 12.0f) && (!this->audioFlag)) {
Audio_PlayActorSound2(thisx, NA_SE_EV_SPEAR_HIT);
@ -651,7 +651,7 @@ void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx) {
void func_80A544AC(EnHeishi2* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.z, -6100, 5, this->unk_2E4, 0);
Math_ApproachF(&this->unk_2E4, 3000.0f, 1.0f, 500.0f);
this->actor.posRot.rot.z = this->actor.shape.rot.z;
this->actor.world.rot.z = this->actor.shape.rot.z;
if (this->actor.shape.rot.z < -6000) {
func_8010B680(globalCtx, 0x708F, NULL);
this->actor.flags |= 0x10000;
@ -673,7 +673,7 @@ void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) {
pos.x = Rand_CenteredFloat(20.0f) + this->unk_274.x;
pos.y = Rand_CenteredFloat(20.0f) + (this->unk_274.y - 40.0f);
pos.z = Rand_CenteredFloat(20.0f) + (this->unk_274.z - 20.0f);
rotY = Rand_CenteredFloat(7000.0f) + thisx->yawTowardsLink;
rotY = Rand_CenteredFloat(7000.0f) + thisx->yawTowardsPlayer;
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, pos.x, pos.y, pos.z, 0, rotY, 0, 0);
if (bomb != NULL) {
bomb->actor.speedXZ = Rand_CenteredFloat(5.0f) + 10.0f;
@ -689,7 +689,7 @@ void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) {
void func_80A546DC(EnHeishi2* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.z, 200, 5, this->unk_2E4, 0);
Math_ApproachF(&this->unk_2E4, 3000.0f, 1.0f, 500.0f);
this->actor.posRot.rot.z = this->actor.shape.rot.z;
this->actor.world.rot.z = this->actor.shape.rot.z;
if (this->actor.shape.rot.z > 0) {
Actor_Kill(&this->actor);
}
@ -750,8 +750,8 @@ void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) {
}
if (((this->initParams != 2) && (this->initParams != 5)) ||
((yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)),
!(this->actor.xzDistToLink > 120.0f)) &&
((yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)),
!(this->actor.xzDistToPlayer > 120.0f)) &&
(yawDiff < 0x4300))) {
func_8002F2F4(&this->actor, globalCtx);
}
@ -784,11 +784,11 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) {
EnHeishi2* this = THIS;
s32 i;
Actor_SetHeight(&this->actor, this->unk_2E0);
Actor_SetFocus(&this->actor, this->unk_2E0);
if ((this->initParams == 2) || (this->initParams == 5)) {
this->actor.posRot2.pos.y = 70.0f;
Actor_SetHeight(&this->actor, 70.0f);
func_80038290(globalCtx, &this->actor, &this->unk_260, &this->unk_26C, this->actor.posRot2.pos);
this->actor.focus.pos.y = 70.0f;
Actor_SetFocus(&this->actor, 70.0f);
func_80038290(globalCtx, &this->actor, &this->unk_260, &this->unk_26C, this->actor.focus.pos);
}
this->unk_2FC++;
@ -806,7 +806,7 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) {
case 9:
break;
default:
func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 0x1D);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 0x1D);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
break;