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

@ -46,7 +46,7 @@ void EnDns_Burrow(EnDns* this, GlobalContext* globalCtx);
const ActorInit En_Dns_InitVars = {
ACTOR_EN_DNS,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_SHOPNUTS,
sizeof(EnDns),
@ -117,8 +117,8 @@ DnsItemEntry* D_809F0500[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_S8(naviEnemyId, 78, ICHAIN_CONTINUE),
ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE),
ICHAIN_F32(unk_4C, 30, ICHAIN_STOP),
ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP),
};
typedef struct {
@ -157,7 +157,7 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060041A8, &D_060009A0, this->jointTable, this->morphTable, 18);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit);
ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 35.0f);
ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 35.0f);
this->actor.textId = D_809F040C[this->actor.params];
Actor_SetScale(&this->actor, 0.01f);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
@ -324,17 +324,17 @@ void EnDns_SetupWait(EnDns* this, GlobalContext* globalCtx) {
}
void EnDns_Wait(EnDns* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 2000, 0);
this->actor.posRot.rot.y = this->actor.shape.rot.y;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (func_8002F194(&this->actor, globalCtx)) {
this->actionFunc = EnDns_Talk;
} else {
if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->actor.unk_10C != 0)) {
if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isTargeted) {
this->actor.flags |= 0x10000;
} else {
this->actor.flags &= ~0x10000;
}
if (this->actor.xzDistToLink < 130.0f) {
if (this->actor.xzDistToPlayer < 130.0f) {
func_8002F2F4(&this->actor, globalCtx);
}
}
@ -444,7 +444,7 @@ void EnDns_SetupBurrow(EnDns* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
this->actionFunc = EnDns_Burrow;
this->standOnGround = 0;
this->yInitPos = this->actor.posRot.pos.y;
this->yInitPos = this->actor.world.pos.y;
}
}
@ -453,20 +453,20 @@ void EnDns_Burrow(EnDns* this, GlobalContext* globalCtx) {
Vec3f initPos;
s32 i;
depth = this->yInitPos - this->actor.posRot.pos.y;
depth = this->yInitPos - this->actor.world.pos.y;
if ((this->dustTimer & 3) == 0) {
initPos.x = this->actor.posRot.pos.x;
initPos.x = this->actor.world.pos.x;
initPos.y = this->yInitPos;
initPos.z = this->actor.posRot.pos.z;
initPos.z = this->actor.world.pos.z;
func_80028990(globalCtx, 20.0f, &initPos);
}
this->actor.shape.rot.y += 0x2000;
// Drops only if you bought its item
if (depth > 400.0f) {
if (this->dropCollectible) {
initPos.x = this->actor.posRot.pos.x;
initPos.x = this->actor.world.pos.x;
initPos.y = this->yInitPos;
initPos.z = this->actor.posRot.pos.z;
initPos.z = this->actor.world.pos.z;
for (i = 0; i < 3; i++) {
Item_DropCollectible(globalCtx, &initPos, ITEM00_HEART);
}
@ -481,13 +481,13 @@ void EnDns_Update(Actor* thisx, GlobalContext* globalCtx) {
this->dustTimer++;
this->actor.textId = D_809F040C[this->actor.params];
Actor_SetHeight(&this->actor, 60.0f);
Actor_SetFocus(&this->actor, 60.0f);
Actor_SetScale(&this->actor, 0.01f);
SkelAnime_Update(&this->skelAnime);
Actor_MoveForward(&this->actor);
this->actionFunc(this, globalCtx);
if (this->standOnGround) {
func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 4);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 4);
}
if (this->maintainCollider) {
Collider_UpdateCylinder(&this->actor, &this->collider);