1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 06:40:15 +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

@ -44,7 +44,7 @@ static s16 D_80AE1A50 = 0;
const ActorInit En_Poh_InitVars = {
ACTOR_EN_POH,
ACTORTYPE_ENEMY,
ACTORCAT_ENEMY,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(EnPoh),
@ -175,7 +175,7 @@ static Color_RGBA8 D_80AE1B54 = { 90, 85, 50, 255 };
static Color_RGBA8 D_80AE1B58 = { 100, 90, 100, 255 };
static InitChainEntry sInitChain[] = {
ICHAIN_F32(unk_4C, 3200, ICHAIN_STOP),
ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP),
};
static Vec3f D_80AE1B60 = { 0.0f, 3.0f, 0.0f };
@ -204,13 +204,13 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) {
EnPoh* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
Collider_InitJntSph(globalCtx, &this->colliderSph);
Collider_SetJntSph(globalCtx, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem);
this->colliderSph.elements[0].dim.worldSphere.radius = 0;
this->colliderSph.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x;
this->colliderSph.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y;
this->colliderSph.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z;
this->colliderSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
this->colliderSph.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
this->colliderSph.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
Collider_InitCylinder(globalCtx, &this->colliderCyl);
Collider_SetCylinder(globalCtx, &this->colliderCyl, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
@ -218,8 +218,8 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_195 = 32;
this->visibilityTimer = Rand_S16Offset(700, 300);
this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
Lights_PointGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y,
this->actor.initPosRot.pos.z, 255, 255, 255, 0);
Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
255, 255, 255, 0);
if (this->actor.params >= 4) {
this->actor.params = EN_POH_NORMAL;
}
@ -228,7 +228,7 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) {
if (D_80AE1A50 >= 3) {
Actor_Kill(&this->actor);
} else {
collectible = Item_DropCollectible(globalCtx, &this->actor.posRot.pos, 0x4000 | ITEM00_RUPEE_BLUE);
collectible = Item_DropCollectible(globalCtx, &this->actor.world.pos, 0x4000 | ITEM00_RUPEE_BLUE);
if (collectible != NULL) {
collectible->actor.speedXZ = 0.0f;
}
@ -311,9 +311,9 @@ void func_80ADE28C(EnPoh* this) {
Animation_PlayOnce(&this->skelAnime, &D_06000570);
}
if (this->colliderCyl.info.acHitInfo->toucher.dmgFlags & 0x0001F824) {
this->actor.posRot.rot.y = this->colliderCyl.base.ac->posRot.rot.y;
this->actor.world.rot.y = this->colliderCyl.base.ac->world.rot.y;
} else {
this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->colliderCyl.base.ac) + 0x8000;
this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->colliderCyl.base.ac) + 0x8000;
}
this->colliderCyl.base.acFlags &= ~AC_ON;
this->actor.speedXZ = 5.0f;
@ -324,7 +324,7 @@ void func_80ADE28C(EnPoh* this) {
void func_80ADE368(EnPoh* this) {
Animation_MorphToLoop(&this->skelAnime, this->info->unk_18, -5.0f);
this->actor.speedXZ = 5.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000;
this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000;
this->colliderCyl.base.acFlags |= AC_ON;
this->unk_198 = 200;
this->actionFunc = func_80ADF894;
@ -338,7 +338,7 @@ void EnPoh_SetupInitialAction(EnPoh* this) {
this->actionFunc = func_80ADEF38;
} else {
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06000FE4, 1.0f);
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f;
this->actor.world.pos.y = this->actor.home.pos.y + 20.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR);
this->actionFunc = EnPoh_ComposerAppear;
@ -347,7 +347,7 @@ void EnPoh_SetupInitialAction(EnPoh* this) {
void func_80ADE48C(EnPoh* this) {
this->actor.speedXZ = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->unk_198 = 0;
this->actor.naviEnemyId = 0xFF;
this->actor.flags &= ~1;
@ -362,7 +362,7 @@ void func_80ADE4C8(EnPoh* this) {
void func_80ADE514(EnPoh* this) {
Animation_PlayLoop(&this->skelAnime, this->info->unk_C);
this->unk_19C = this->actor.posRot.rot.y + 0x8000;
this->unk_19C = this->actor.world.rot.y + 0x8000;
this->actionFunc = func_80ADF5E0;
this->actor.speedXZ = 0.0f;
}
@ -370,7 +370,7 @@ void func_80ADE514(EnPoh* this) {
void EnPoh_SetupDisappear(EnPoh* this) {
this->unk_194 = 32;
this->actor.speedXZ = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH);
this->actionFunc = EnPoh_Disappear;
@ -387,28 +387,28 @@ void EnPoh_SetupAppear(EnPoh* this) {
void EnPoh_SetupDeath(EnPoh* this, GlobalContext* globalCtx) {
this->actor.update = EnPoh_UpdateDead;
this->actor.draw = EnPoh_DrawSoul;
this->actor.shape.shadowDrawFunc = NULL;
this->actor.shape.shadowDraw = NULL;
Actor_SetScale(&this->actor, 0.01f);
this->actor.flags |= 0x10;
this->actor.gravity = -1.0f;
this->actor.shape.unk_08 = 1500.0f;
this->actor.posRot.pos.y -= 15.0f;
this->actor.shape.yOffset = 1500.0f;
this->actor.world.pos.y -= 15.0f;
if (this->infoIdx != EN_POH_INFO_COMPOSER) {
this->actor.shape.rot.x = -0x8000;
}
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, 8);
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, 8);
this->unk_198 = 60;
this->actionFunc = EnPoh_Death;
}
void func_80ADE6D4(EnPoh* this) {
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, 0, 0, 0, 0);
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, 0);
this->visibilityTimer = 0;
this->actor.shape.rot.y = 0;
this->lightColor.r = 0;
this->lightColor.a = 0;
this->actor.shape.unk_08 = 0.0f;
this->actor.shape.yOffset = 0.0f;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
if (this->actor.params >= EN_POH_SHARP) {
@ -421,20 +421,20 @@ void func_80ADE6D4(EnPoh* this) {
this->actor.scale.x = 0.0f;
this->actor.scale.y = 0.0f;
this->actor.shape.rot.x = 0;
this->actor.initPosRot.pos.y = this->actor.posRot.pos.y;
this->actor.home.pos.y = this->actor.world.pos.y;
Audio_PlayActorSound2(&this->actor, NA_SE_EV_METAL_BOX_BOUND);
this->actionFunc = func_80ADFE28;
}
void EnPoh_Talk(EnPoh* this, GlobalContext* globalCtx) {
this->actor.initPosRot.pos.y = this->actor.posRot.pos.y;
Actor_SetHeight(&this->actor, -10.0f);
this->actor.home.pos.y = this->actor.world.pos.y;
Actor_SetFocus(&this->actor, -10.0f);
this->colliderCyl.dim.radius = 13;
this->colliderCyl.dim.height = 30;
this->colliderCyl.dim.yShift = 0;
this->colliderCyl.dim.pos.x = this->actor.posRot.pos.x;
this->colliderCyl.dim.pos.y = this->actor.posRot.pos.y - 20.0f;
this->colliderCyl.dim.pos.z = this->actor.posRot.pos.z;
this->colliderCyl.dim.pos.x = this->actor.world.pos.x;
this->colliderCyl.dim.pos.y = this->actor.world.pos.y - 20.0f;
this->colliderCyl.dim.pos.z = this->actor.world.pos.z;
this->colliderCyl.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER;
if (this->actor.params == EN_POH_FLAT || this->actor.params == EN_POH_SHARP) {
if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) {
@ -466,7 +466,7 @@ void func_80ADE950(EnPoh* this, s32 arg1) {
void func_80ADE998(EnPoh* this) {
this->actionFunc = EnPoh_TalkRegular;
this->actor.initPosRot.pos.y = this->actor.posRot.pos.y - 15.0f;
this->actor.home.pos.y = this->actor.world.pos.y - 15.0f;
}
void func_80ADE9BC(EnPoh* this) {
@ -476,8 +476,8 @@ void func_80ADE9BC(EnPoh* this) {
void EnPoh_MoveTowardsPlayerHeight(EnPoh* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
Math_StepToF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y, 1.0f);
this->actor.posRot.pos.y += 2.5f * Math_SinS(this->unk_195 * 0x800);
Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 1.0f);
this->actor.world.pos.y += 2.5f * Math_SinS(this->unk_195 * 0x800);
if (this->unk_195 != 0) {
this->unk_195 -= 1;
}
@ -487,10 +487,10 @@ void EnPoh_MoveTowardsPlayerHeight(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80ADEA5C(EnPoh* this) {
if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) > 400.0f) {
this->unk_19C = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos);
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 400.0f) {
this->unk_19C = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
}
Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_19C, 0x71C);
Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_19C, 0x71C);
}
void func_80ADEAC4(EnPoh* this, GlobalContext* globalCtx) {
@ -499,7 +499,7 @@ void func_80ADEAC4(EnPoh* this, GlobalContext* globalCtx) {
this->unk_198--;
}
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
if (this->actor.xzDistToLink < 200.0f) {
if (this->actor.xzDistToPlayer < 200.0f) {
func_80ADE1BC(this);
} else if (this->unk_198 == 0) {
EnPoh_SetupIdle(this);
@ -517,7 +517,7 @@ void EnPoh_Idle(EnPoh* this, GlobalContext* globalCtx) {
}
func_80ADEA5C(this);
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
if (this->actor.xzDistToLink < 200.0f && this->unk_198 < 19) {
if (this->actor.xzDistToPlayer < 200.0f && this->unk_198 < 19) {
func_80ADE1BC(this);
} else if (this->unk_198 == 0) {
if (Rand_ZeroOne() < 0.1f) {
@ -540,18 +540,18 @@ void func_80ADEC9C(EnPoh* this, GlobalContext* globalCtx) {
if (this->unk_198 != 0) {
this->unk_198--;
}
facingDiff = this->actor.yawTowardsLink - player->actor.shape.rot.y;
facingDiff = this->actor.yawTowardsPlayer - player->actor.shape.rot.y;
if (facingDiff >= 0x3001) {
Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x3000, 0x71C);
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C);
} else if (facingDiff < -0x3000) {
Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink - 0x3000, 0x71C);
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C);
} else {
Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x71C);
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C);
}
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
if (this->actor.xzDistToLink > 280.0f) {
if (this->actor.xzDistToPlayer > 280.0f) {
EnPoh_SetupIdle(this);
} else if (this->unk_198 == 0 && this->actor.xzDistToLink < 140.0f &&
} else if (this->unk_198 == 0 && this->actor.xzDistToPlayer < 140.0f &&
func_8002DFC8(&this->actor, 0x2AAA, globalCtx) == 0) {
EnPoh_SetupAttack(this);
}
@ -570,7 +570,7 @@ void EnPoh_Attack(EnPoh* this, GlobalContext* globalCtx) {
}
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
if (this->unk_198 >= 10) {
Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0xE38);
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xE38);
} else if (this->unk_198 == 9) {
this->actor.speedXZ = 5.0f;
this->skelAnime.playSpeed = 2.0f;
@ -600,7 +600,7 @@ void func_80ADEF38(EnPoh* this, GlobalContext* globalCtx) {
} else if (this->skelAnime.curFrame > 10.0f) {
this->lightColor.a = ((this->skelAnime.curFrame - 10.0f) * 0.05f) * 255.0f;
}
if (this->skelAnime.playSpeed < 0.5f && this->actor.xzDistToLink < 280.0f) {
if (this->skelAnime.playSpeed < 0.5f && this->actor.xzDistToPlayer < 280.0f) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR);
this->skelAnime.playSpeed = 1.0f;
}
@ -627,23 +627,23 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) {
this->unk_198++;
if (this->unk_198 < 8) {
if (this->unk_198 < 5) {
vec.y = Math_SinS((this->unk_198 * 0x1000) - 0x4000) * 23.0f + (this->actor.posRot.pos.y + 40.0f);
vec.y = Math_SinS((this->unk_198 * 0x1000) - 0x4000) * 23.0f + (this->actor.world.pos.y + 40.0f);
multiplier = Math_CosS((this->unk_198 * 0x1000) - 0x4000) * 23.0f;
vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.posRot.pos.x;
vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.posRot.pos.z;
vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.world.pos.x;
vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.world.pos.z;
} else {
vec.y = (this->actor.posRot.pos.y + 40.0f) + (15.0f * (this->unk_198 - 5));
vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.x;
vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.z;
vec.y = (this->actor.world.pos.y + 40.0f) + (15.0f * (this->unk_198 - 5));
vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.x;
vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.z;
}
EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255,
0, 0, 255, 1, 9, 1);
vec.x = (this->actor.posRot.pos.x + this->actor.posRot.pos.x) - vec.x;
vec.z = (this->actor.posRot.pos.z + this->actor.posRot.pos.z) - vec.z;
vec.x = (this->actor.world.pos.x + this->actor.world.pos.x) - vec.x;
vec.z = (this->actor.world.pos.z + this->actor.world.pos.z) - vec.z;
EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255,
0, 0, 255, 1, 9, 1);
vec.x = this->actor.posRot.pos.x;
vec.z = this->actor.posRot.pos.z;
vec.x = this->actor.world.pos.x;
vec.z = this->actor.world.pos.z;
EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255,
0, 0, 255, 1, 9, 1);
if (this->unk_198 == 1) {
@ -653,7 +653,7 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) {
EnPoh_SetupDeath(this, globalCtx);
} else if (this->unk_198 >= 19) {
newScale = (28 - this->unk_198) * 0.001f;
this->actor.posRot.pos.y += 5.0f;
this->actor.world.pos.y += 5.0f;
this->actor.scale.z = newScale;
this->actor.scale.y = newScale;
this->actor.scale.x = newScale;
@ -665,7 +665,7 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) {
void func_80ADF574(EnPoh* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
this->actor.posRot.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
EnPoh_SetupIdle(this);
this->unk_198 = 23;
} else {
@ -676,10 +676,10 @@ void func_80ADF574(EnPoh* this, GlobalContext* globalCtx) {
void func_80ADF5E0(EnPoh* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if (Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_19C, 1820) != 0) {
if (Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_19C, 1820) != 0) {
EnPoh_SetupIdle(this);
}
if (this->actor.xzDistToLink < 200.0f) {
if (this->actor.xzDistToPlayer < 200.0f) {
func_80ADE1BC(this);
}
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
@ -689,7 +689,7 @@ void EnPoh_Disappear(EnPoh* this, GlobalContext* globalCtx) {
if (this->unk_194 != 0) {
this->unk_194--;
}
this->actor.posRot.rot.y += 0x1000;
this->actor.world.rot.y += 0x1000;
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
this->lightColor.a = this->unk_194 * 7.96875f;
if (this->unk_194 == 0) {
@ -700,7 +700,7 @@ void EnPoh_Disappear(EnPoh* this, GlobalContext* globalCtx) {
void EnPoh_Appear(EnPoh* this, GlobalContext* globalCtx) {
this->unk_194++;
this->actor.posRot.rot.y -= 0x1000;
this->actor.world.rot.y -= 0x1000;
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
this->lightColor.a = this->unk_194 * 7.96875f;
if (this->unk_194 == 32) {
@ -715,12 +715,12 @@ void func_80ADF894(EnPoh* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
multiplier = Math_SinS(this->unk_195 * 0x800) * 3.0f;
this->actor.posRot.pos.x -= multiplier * Math_CosS(this->actor.shape.rot.y);
this->actor.posRot.pos.z += multiplier * Math_SinS(this->actor.shape.rot.y);
Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 0x71C);
this->actor.world.pos.x -= multiplier * Math_CosS(this->actor.shape.rot.y);
this->actor.world.pos.z += multiplier * Math_SinS(this->actor.shape.rot.y);
Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x71C);
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
if (this->unk_198 == 0 || this->actor.xzDistToLink > 250.0f) {
this->actor.posRot.rot.y = this->actor.shape.rot.y;
if (this->unk_198 == 0 || this->actor.xzDistToPlayer > 250.0f) {
this->actor.world.rot.y = this->actor.shape.rot.y;
EnPoh_SetupIdle(this);
}
func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG);
@ -734,14 +734,14 @@ void EnPoh_Death(EnPoh* this, GlobalContext* globalCtx) {
}
if (this->actor.bgCheckFlags & 1) {
objId = (this->infoIdx == EN_POH_INFO_COMPOSER) ? OBJECT_PO_COMPOSER : OBJECT_POH;
EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 6.0f, 0, 1, 1, 15, objId, 10, this->info->unk_1C);
EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, objId, 10, this->info->unk_1C);
func_80ADE6D4(this);
} else if (this->unk_198 == 0) {
Actor_Kill(&this->actor);
return;
}
Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4);
}
void func_80ADFA90(EnPoh* this, s32 arg1) {
@ -758,18 +758,18 @@ void func_80ADFA90(EnPoh* this, s32 arg1) {
this->actor.scale.z = this->lightColor.a * 2.7450982e-05f;
this->actor.scale.y = this->lightColor.a * 2.7450982e-05f;
this->actor.scale.x = this->lightColor.a * 2.7450982e-05f;
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 0.05882353f * this->lightColor.a;
this->actor.world.pos.y = this->actor.home.pos.y + 0.05882353f * this->lightColor.a;
}
this->lightColor.r = this->info->lightColor.r * multiplier;
this->lightColor.g = this->info->lightColor.g * multiplier;
this->lightColor.b = this->info->lightColor.b * multiplier;
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, this->info->lightColor.r, this->info->lightColor.g,
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, this->info->lightColor.r, this->info->lightColor.g,
this->info->lightColor.b, this->lightColor.a * 0.78431373f);
}
void func_80ADFE28(EnPoh* this, GlobalContext* globalCtx) {
this->actor.initPosRot.pos.y += 2.0f;
this->actor.home.pos.y += 2.0f;
func_80ADFA90(this, 20);
if (this->lightColor.a == 255) {
EnPoh_Talk(this, globalCtx);
@ -800,17 +800,17 @@ void func_80ADFE80(EnPoh* this, GlobalContext* globalCtx) {
this->actor.flags &= ~0x10000;
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base);
}
this->actor.posRot.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.initPosRot.pos.y;
this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.home.pos.y;
if (this->unk_195 != 0) {
this->unk_195 -= 1;
}
if (this->unk_195 == 0) {
this->unk_195 = 32;
}
this->colliderCyl.dim.pos.y = this->actor.posRot.pos.y - 20.0f;
Actor_SetHeight(&this->actor, -10.0f);
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, this->info->lightColor.r, this->info->lightColor.g,
this->colliderCyl.dim.pos.y = this->actor.world.pos.y - 20.0f;
Actor_SetFocus(&this->actor, -10.0f);
Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, this->info->lightColor.r, this->info->lightColor.g,
this->info->lightColor.b, this->lightColor.a * 0.78431373f);
}
@ -900,7 +900,7 @@ void EnPoh_UpdateVisibility(EnPoh* this) {
this->visibilityTimer--;
}
if (this->lightColor.a == 255) {
if (this->actor.unk_10C != 0) {
if (this->actor.isTargeted) {
this->unk_194++;
this->unk_194 = CLAMP_MAX(this->unk_194, 20);
} else {
@ -937,7 +937,7 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.draw = EnPoh_DrawComposer;
this->colliderSph.elements[0].dim.limb = 9;
this->colliderSph.elements[0].dim.modelSphere.center.y *= -1;
this->actor.shape.rot.y = this->actor.posRot.rot.y = -0x4000;
this->actor.shape.rot.y = this->actor.world.rot.y = -0x4000;
this->colliderCyl.dim.radius = 20;
this->colliderCyl.dim.height = 55;
this->colliderCyl.dim.yShift = 15;
@ -961,7 +961,7 @@ void func_80AE067C(EnPoh* this) {
temp_var = this->lightColor.b + 5;
this->lightColor.b = CLAMP_MAX(temp_var, 225);
} else if (this->actionFunc == func_80ADEECC) {
if (this->actor.dmgEffectTimer & 2) {
if (this->actor.colorFilterTimer & 2) {
this->lightColor.r = 0;
this->lightColor.g = 0;
this->lightColor.b = 0;
@ -1023,21 +1023,21 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) {
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base);
Actor_SetHeight(&this->actor, 42.0f);
Actor_SetFocus(&this->actor, 42.0f);
if (this->actionFunc != func_80ADEECC && this->actionFunc != func_80ADF574) {
if (this->actionFunc == func_80ADF894) {
this->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000;
this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000;
} else {
this->actor.shape.rot.y = this->actor.posRot.rot.y;
this->actor.shape.rot.y = this->actor.world.rot.y;
}
}
vec.x = this->actor.posRot.pos.x;
vec.y = this->actor.posRot.pos.y + 20.0f;
vec.z = this->actor.posRot.pos.z;
this->actor.groundY =
vec.x = this->actor.world.pos.x;
vec.y = this->actor.world.pos.y + 20.0f;
vec.z = this->actor.world.pos.z;
this->actor.floorHeight =
BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp38, &this->actor, &vec);
func_80AE089C(this);
this->actor.shape.unk_14 = this->lightColor.a;
this->actor.shape.shadowAlpha = this->lightColor.a;
}
s32 EnPoh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx,
@ -1073,9 +1073,9 @@ void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
}
Matrix_Get(&this->unk_368);
if (this->actionFunc == func_80ADF15C && this->unk_198 == 27) {
this->actor.posRot.pos.x = this->unk_368.wx;
this->actor.posRot.pos.y = this->unk_368.wy;
this->actor.posRot.pos.z = this->unk_368.wz;
this->actor.world.pos.x = this->unk_368.wx;
this->actor.world.pos.y = this->unk_368.wy;
this->actor.world.pos.z = this->unk_368.wz;
}
Lights_PointGlowSetInfo(&this->lightInfo, this->colliderSph.elements[0].dim.worldSphere.center.x,
this->colliderSph.elements[0].dim.worldSphere.center.y,
@ -1184,8 +1184,8 @@ void EnPoh_DrawSoul(Actor* thisx, GlobalContext* globalCtx) {
if (this->actionFunc == EnPoh_Death) {
func_80093D18(globalCtx->state.gfxCtx);
gDPSetEnvColor(POLY_OPA_DISP++, this->envColor.r, this->envColor.g, this->envColor.b, 255);
Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y,
this->actor.posRot.pos.z, this->envColor.r, this->envColor.g, this->envColor.b, 200);
Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, this->envColor.r, this->envColor.g, this->envColor.b, 200);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_poh.c", 2854),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, this->info->unk_1C);