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

@ -24,7 +24,7 @@ void EnBombf_SetupGrowBomb(EnBombf* this, s16 params);
const ActorInit En_Bombf_InitVars = {
ACTOR_EN_BOMBF,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_BOMBF,
sizeof(EnBombf),
@ -105,22 +105,22 @@ void EnBombf_Init(Actor* thisx, GlobalContext* globalCtx) {
shapeUnk10 = 1000.0f;
}
ActorShape_Init(&thisx->shape, shapeUnk10, ActorShadow_DrawFunc_Circle, 12.0f);
thisx->posRot2.pos = thisx->posRot.pos;
ActorShape_Init(&thisx->shape, shapeUnk10, ActorShadow_DrawCircle, 12.0f);
thisx->focus.pos = thisx->world.pos;
if (Actor_FindNearby(globalCtx, thisx, ACTOR_BG_DDAN_KD, ACTORTYPE_BG, 10000.0f) != NULL) {
if (Actor_FindNearby(globalCtx, thisx, ACTOR_BG_DDAN_KD, ACTORCAT_BG, 10000.0f) != NULL) {
thisx->flags |= 0x20;
}
thisx->colChkInfo.unk_10 = 10.0f;
thisx->colChkInfo.unk_12 = 10;
thisx->unk_1F = 0;
thisx->colChkInfo.cylRadius = 10.0f;
thisx->colChkInfo.cylHeight = 10;
thisx->targetMode = 0;
if (thisx->params == BOMBFLOWER_BODY) {
this->timer = 140;
this->flashSpeedScale = 15;
thisx->gravity = -1.5f;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_EXPLOSIVES);
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_EXPLOSIVE);
thisx->colChkInfo.mass = 200;
thisx->flags &= ~1;
EnBombf_SetupAction(this, EnBombf_Move);
@ -155,9 +155,8 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
if (this->flowerBombScale >= 1.0f) {
if (Actor_HasParent(&this->actor, globalCtx)) {
bombFlower =
(EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0);
bombFlower = (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
if (bombFlower != NULL) {
func_8002F5C4(&this->actor, &bombFlower->actor, globalCtx);
this->timer = 180;
@ -174,10 +173,10 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
} else if (this->bombCollider.base.acFlags & AC_HIT) {
this->bombCollider.base.acFlags &= ~AC_HIT;
if (this->bombCollider.base.ac->type != ACTORTYPE_BOSS) {
if (this->bombCollider.base.ac->category != ACTORCAT_BOSS) {
bombFlower =
(EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0);
(EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
if (bombFlower != NULL) {
bombFlower->unk_200 = 1;
bombFlower->timer = 0;
@ -187,10 +186,10 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
}
}
} else {
if (Player_IsBurningStickInRange(globalCtx, &this->actor.posRot.pos, 30.0f, 50.0f)) {
if (Player_IsBurningStickInRange(globalCtx, &this->actor.world.pos, 30.0f, 50.0f)) {
bombFlower =
(EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0);
(EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
if (bombFlower != NULL) {
bombFlower->timer = 100;
this->timer = 180;
@ -206,7 +205,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
player->interactRangeActor = NULL;
this->actor.parent = NULL;
player->stateFlags1 &= ~0x800;
this->actor.posRot.pos = this->actor.initPosRot.pos;
this->actor.world.pos = this->actor.home.pos;
}
}
}
@ -224,7 +223,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) {
player->interactRangeActor = NULL;
this->actor.parent = NULL;
player->stateFlags1 &= ~0x800;
this->actor.posRot.pos = this->actor.initPosRot.pos;
this->actor.world.pos = this->actor.home.pos;
}
}
}
@ -269,7 +268,7 @@ void EnBombf_Explode(EnBombf* this, GlobalContext* globalCtx) {
if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) {
this->actor.flags |= 0x20;
func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96);
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
}
this->explosionCollider.elements[0].dim.modelSphere.radius += 8;
@ -333,7 +332,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if ((!this->bumpOn) && (!Actor_HasParent(thisx, globalCtx)) &&
((thisx->xzDistToLink >= 20.0f) || (ABS(thisx->yDistToLink) >= 80.0f))) {
((thisx->xzDistToPlayer >= 20.0f) || (ABS(thisx->yDistToPlayer) >= 80.0f))) {
this->bumpOn = true;
}
@ -345,7 +344,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->gravity != 0.0f) {
DREG(6) = 1;
func_8002E4B4(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F);
Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F);
DREG(6) = 0;
}
@ -358,33 +357,33 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
// rebound bomb off the wall it hits
if ((thisx->speedXZ != 0.0f) && (thisx->bgCheckFlags & 8)) {
if (ABS((s16)(thisx->wallPolyRot - thisx->posRot.rot.y)) > 0x4000) {
if (ABS((s16)(thisx->wallYaw - thisx->world.rot.y)) > 0x4000) {
if (1) {}
thisx->posRot.rot.y = ((thisx->wallPolyRot - thisx->posRot.rot.y) + thisx->wallPolyRot) - 0x8000;
thisx->world.rot.y = ((thisx->wallYaw - thisx->world.rot.y) + thisx->wallYaw) - 0x8000;
}
Audio_PlayActorSound2(thisx, NA_SE_EV_BOMB_BOUND);
Actor_MoveForward(thisx);
DREG(6) = 1;
func_8002E4B4(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F);
Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F);
DREG(6) = 0;
thisx->speedXZ *= 0.7f;
thisx->bgCheckFlags &= ~8;
}
if ((this->bombCollider.base.acFlags & AC_HIT) ||
((this->bombCollider.base.ocFlags1 & OC1_HIT) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) {
if ((this->bombCollider.base.acFlags & AC_HIT) || ((this->bombCollider.base.ocFlags1 & OC1_HIT) &&
(this->bombCollider.base.oc->category == ACTORCAT_ENEMY))) {
this->unk_200 = 1;
this->timer = 0;
} else {
// if a lit stick touches the bomb, set timer to 100
if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) {
if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->world.pos, 30.0f, 50.0f)) {
this->timer = 100;
}
}
if (this->unk_200 != 0) {
dustAccel.y = 0.2f;
effPos = thisx->posRot.pos;
effPos = thisx->world.pos;
effPos.y += 25.0f;
if (this->timer < 127) {
// spawn spark effect on even frames
@ -413,7 +412,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->timer == 0) {
effPos = thisx->posRot.pos;
effPos = thisx->world.pos;
effPos.y += 10.0f;
@ -423,8 +422,8 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
EffectSsBomb2_SpawnLayered(globalCtx, &effPos, &effVelocity, &bomb2Accel, 100, 19);
effPos.y = thisx->groundY;
if (thisx->groundY > BGCHECK_Y_MIN) {
effPos.y = thisx->floorHeight;
if (thisx->floorHeight > BGCHECK_Y_MIN) {
EffectSsBlast_SpawnWhiteShockwave(globalCtx, &effPos, &effVelocity, &effAccel);
}
@ -440,8 +439,8 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
thisx->posRot2.pos = thisx->posRot.pos;
thisx->posRot2.pos.y += 10.0f;
thisx->focus.pos = thisx->world.pos;
thisx->focus.pos.y += 10.0f;
if (thisx->params <= BOMBFLOWER_BODY) {