1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-10 08:50:23 +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

@ -25,7 +25,7 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx);
const ActorInit En_Vm_InitVars = {
ACTOR_EN_VM,
ACTORTYPE_ENEMY,
ACTORCAT_ENEMY,
FLAGS,
OBJECT_VM,
sizeof(EnVm),
@ -185,19 +185,19 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) {
switch (this->unk_25E) {
case 0:
Math_SmoothStepToS(&this->beamRot.x, 0, 10, 1500, 0);
headRot = this->actor.yawTowardsLink - this->headRotY - this->actor.shape.rot.y;
pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos);
headRot = this->actor.yawTowardsPlayer - this->headRotY - this->actor.shape.rot.y;
pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos);
if (pitch > 0x1B91) {
pitch = 0x1B91;
}
dist = this->beamSightRange - this->actor.xzDistToLink;
dist = this->beamSightRange - this->actor.xzDistToPlayer;
if (this->actor.xzDistToLink <= this->beamSightRange && ABS(headRot) <= 0x2710 && pitch >= 0xE38 &&
this->actor.yDistToLink <= 80.0f && this->actor.yDistToLink >= -160.0f) {
if (this->actor.xzDistToPlayer <= this->beamSightRange && ABS(headRot) <= 0x2710 && pitch >= 0xE38 &&
this->actor.yDistToPlayer <= 80.0f && this->actor.yDistToPlayer >= -160.0f) {
Math_SmoothStepToS(&this->beamRot.x, pitch, 10, 0xFA0, 0);
if (Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1,
if (Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1,
(ABS((s16)(dist * 180.0f)) / 3) + 0xFA0, 0) <= 5460) {
this->timer--;
if (this->timer == 0) {
@ -220,7 +220,7 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) {
return;
}
Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, 0x1F40, 0);
Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1, 0x1F40, 0);
if (SkelAnime_Update(&this->skelAnime)) {
this->unk_260++;
@ -228,8 +228,8 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) {
}
if (this->unk_260 == 2) {
this->beamRot.y = this->actor.yawTowardsLink;
this->beamRot.x = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos);
this->beamRot.y = this->actor.yawTowardsPlayer;
this->beamRot.x = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos);
if (this->beamRot.x > 0x1B91) {
this->beamRot.x = 0x1B91;
@ -261,7 +261,7 @@ void EnVm_SetupAttack(EnVm* this) {
void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
s16 pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos);
s16 pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos);
f32 dist;
Vec3f playerPos;
@ -291,13 +291,13 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) {
return;
}
Math_SmoothStepToS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsLink, 10, 0xDAC, 0);
Math_SmoothStepToS(&this->beamRot.y, this->actor.yawTowardsLink, 10, 0xDAC, 0);
Math_SmoothStepToS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsPlayer, 10, 0xDAC, 0);
Math_SmoothStepToS(&this->beamRot.y, this->actor.yawTowardsPlayer, 10, 0xDAC, 0);
Math_SmoothStepToS(&this->beamRot.x, pitch, 10, 0xDAC, 0);
playerPos = player->actor.posRot.pos;
playerPos = player->actor.world.pos;
if (player->actor.groundY > BGCHECK_Y_MIN) {
playerPos.y = player->actor.groundY;
if (player->actor.floorHeight > BGCHECK_Y_MIN) {
playerPos.y = player->actor.floorHeight;
}
dist = Math_Vec3f_DistXYZ(&this->beamPos1, &playerPos);
@ -360,12 +360,12 @@ void EnVm_SetupDie(EnVm* this) {
this->unk_21C = 3;
this->beamScale.z = 0.0f;
this->beamScale.y = 0.0f;
this->actor.shape.unk_08 = -5000.0f;
this->actor.posRot.pos.y += 5000.0f * this->actor.scale.y;
this->actor.shape.yOffset = -5000.0f;
this->actor.world.pos.y += 5000.0f * this->actor.scale.y;
this->actor.velocity.y = 8.0f;
this->actor.gravity = -0.5f;
this->actor.speedXZ = Rand_ZeroOne() + 1.0f;
this->actor.posRot.rot.y = Rand_CenteredFloat(65535.0f);
this->actor.world.rot.y = Rand_CenteredFloat(65535.0f);
EnVm_SetupAction(this, EnVm_Die);
}
@ -377,14 +377,14 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx) {
Actor_MoveForward(&this->actor);
if (--this->timer == 0) {
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0x6FF, BOMB_BODY);
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x6FF, BOMB_BODY);
if (bomb != NULL) {
bomb->timer = 0;
}
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xA0);
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xA0);
Actor_Kill(&this->actor);
}
}
@ -406,8 +406,8 @@ void EnVm_CheckHealth(EnVm* this, GlobalContext* globalCtx) {
func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8);
EnVm_SetupStun(this);
} else {
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x,
this->actor.posRot.pos.y + 20.0f, this->actor.posRot.pos.z, 0, 0, 0x601, BOMB_BODY);
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x,
this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 0, 0, 0x601, BOMB_BODY);
if (bomb != NULL) {
bomb->timer = 0;
@ -441,13 +441,13 @@ void EnVm_Update(Actor* thisx, GlobalContext* globalCtx) {
Collider_UpdateCylinder(&this->actor, &this->colliderCylinder);
CollisionCheck_SetOC(globalCtx, colChkCtx, &this->colliderCylinder.base);
if (this->actor.dmgEffectTimer == 0 && this->actor.colChkInfo.health != 0) {
if (this->actor.colorFilterTimer == 0 && this->actor.colChkInfo.health != 0) {
CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderCylinder.base);
}
CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderQuad2.base);
this->actor.posRot2.pos = this->actor.posRot.pos;
this->actor.posRot2.pos.y += (6500.0f + this->actor.shape.unk_08) * this->actor.scale.y;
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += (6500.0f + this->actor.shape.yOffset) * this->actor.scale.y;
}
s32 EnVm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
@ -527,7 +527,7 @@ void EnVm_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D84(globalCtx->state.gfxCtx);
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnVm_OverrideLimbDraw,
EnVm_PostLimbDraw, this);
actorPos = this->actor.posRot.pos;
actorPos = this->actor.world.pos;
func_80033C30(&actorPos, &D_80B2EB7C, 255, globalCtx);
if (this->unk_260 >= 3) {