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

@ -19,7 +19,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx);
const ActorInit En_Boom_InitVars = {
ACTOR_EN_BOOM,
ACTORTYPE_MISC,
ACTORCAT_MISC,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(EnBoom),
@ -50,7 +50,7 @@ static ColliderQuadInit sQuadInit = {
};
static InitChainEntry sInitChain[] = {
ICHAIN_S8(unk_1F, 5, ICHAIN_CONTINUE),
ICHAIN_S8(targetMode, 5, ICHAIN_CONTINUE),
ICHAIN_VEC3S(shape.rot, 0, ICHAIN_STOP),
};
@ -128,13 +128,13 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
// If the boomerang is moving toward a targeted actor, handle setting the proper x and y angle to fly toward it.
if (target != NULL) {
yawTarget = func_8002DAC0(&this->actor, &target->posRot2.pos);
yawDiff = this->actor.posRot.rot.y - yawTarget;
yawTarget = Actor_WorldYawTowardPoint(&this->actor, &target->focus.pos);
yawDiff = this->actor.world.rot.y - yawTarget;
pitchTarget = func_8002DB28(&this->actor, &target->posRot2.pos);
pitchDiff = this->actor.posRot.rot.x - pitchTarget;
pitchTarget = Actor_WorldPitchTowardPoint(&this->actor, &target->focus.pos);
pitchDiff = this->actor.world.rot.x - pitchTarget;
distXYZScale = (200.0f - Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &target->posRot2.pos)) * 0.005f;
distXYZScale = (200.0f - Math_Vec3f_DistXYZ(&this->actor.world.pos, &target->focus.pos)) * 0.005f;
if (distXYZScale < 0.12f) {
distXYZScale = 0.12f;
}
@ -145,8 +145,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
// the moveTo pointer is nulled and it flies off in a seemingly random direction.
this->moveTo = NULL;
} else {
Math_ScaledStepToS(&this->actor.posRot.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale));
Math_ScaledStepToS(&this->actor.posRot.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale));
Math_ScaledStepToS(&this->actor.world.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale));
Math_ScaledStepToS(&this->actor.world.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale));
}
}
@ -170,14 +170,14 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
// Decrement the return timer and check if its 0. If it is, check if Link can catch it and handle accordingly.
// Otherwise handle grabbing and colliding.
if (DECR(this->returnTimer) == 0) {
distFromLink = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &player->actor.posRot2.pos);
distFromLink = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.focus.pos);
this->moveTo = player;
// If the boomerang is less than 40 units away from Link, he can catch it.
if (distFromLink < 40.0f) {
target = this->grabbed;
if (target != NULL) {
Math_Vec3f_Copy(&target->posRot.pos, &player->actor.posRot.pos);
Math_Vec3f_Copy(&target->world.pos, &player->actor.world.pos);
// If the grabbed actor is EnItem00 (HP/Key etc) set gravity and flags so it falls in front of Link.
// Otherwise if its a Skulltula Token, just set flags so he collides with it to collect it.
@ -197,9 +197,9 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
collided = (!!(collided));
if (collided) {
// Copy the position from the prevous frame to the boomerang to start the bounce back.
Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.pos4);
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos);
} else {
collided = BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.pos4, &this->actor.posRot.pos,
collided = BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.prevPos, &this->actor.world.pos,
&hitPoint, &this->actor.wallPoly, 1, 1, 1, 1, &hitDynaID);
if (collided) {
@ -220,8 +220,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
// If the boomerang needs to bounce back, set x and y angle accordingly.
// Set timer to 0 and set return actor to player so it goes back to Link.
if (collided) {
this->actor.posRot.rot.x = -this->actor.posRot.rot.x;
this->actor.posRot.rot.y += 0x8000;
this->actor.world.rot.x = -this->actor.world.rot.x;
this->actor.world.rot.y += 0x8000;
this->moveTo = player;
this->returnTimer = 0;
}
@ -234,7 +234,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
if (target->update == NULL) {
this->grabbed = NULL;
} else {
Math_Vec3f_Copy(&target->posRot.pos, &this->actor.posRot.pos);
Math_Vec3f_Copy(&target->world.pos, &this->actor.world.pos);
}
}
}
@ -245,7 +245,7 @@ void EnBoom_Update(Actor* thisx, GlobalContext* globalCtx) {
if (!(player->stateFlags1 & 0x20000000)) {
this->actionFunc(this, globalCtx);
Actor_SetHeight(&this->actor, 0.0f);
Actor_SetFocus(&this->actor, 0.0f);
this->activeTimer = this->activeTimer + 1;
}
}
@ -259,9 +259,9 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_boom.c", 567);
Matrix_RotateY(this->actor.posRot.rot.y * 0.0000958738f, MTXMODE_APPLY);
Matrix_RotateY(this->actor.world.rot.y * 0.0000958738f, MTXMODE_APPLY);
Matrix_RotateZ(0.7669904f, MTXMODE_APPLY);
Matrix_RotateX(this->actor.posRot.rot.x * 0.0000958738f, MTXMODE_APPLY);
Matrix_RotateX(this->actor.world.rot.x * 0.0000958738f, MTXMODE_APPLY);
Matrix_MultVec3f(&sMultVec1, &vec1);
Matrix_MultVec3f(&sMultVec2, &vec2);