mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-06 22:30: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:
parent
20206fba0d
commit
00a5edea71
697 changed files with 8157 additions and 7942 deletions
|
@ -28,7 +28,7 @@ extern Gfx D_05005380[];
|
|||
|
||||
const ActorInit Obj_Kibako_InitVars = {
|
||||
ACTOR_OBJ_KIBAKO,
|
||||
ACTORTYPE_PROP,
|
||||
ACTORCAT_PROP,
|
||||
FLAGS,
|
||||
OBJECT_GAMEPLAY_DANGEON_KEEP,
|
||||
sizeof(ObjKibako),
|
||||
|
@ -72,7 +72,7 @@ void ObjKibako_SpawnCollectible(ObjKibako* this, GlobalContext* globalCtx) {
|
|||
|
||||
collectible = this->actor.params & 0x1F;
|
||||
if ((collectible >= 0) && (collectible <= 0x19)) {
|
||||
Item_DropCollectible(globalCtx, &this->actor.posRot.pos,
|
||||
Item_DropCollectible(globalCtx, &this->actor.world.pos,
|
||||
collectible | (((this->actor.params >> 8) & 0x3F) << 8));
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ void ObjKibako_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
void ObjKibako_AirBreak(ObjKibako* this, GlobalContext* globalCtx) {
|
||||
s16 angle;
|
||||
s32 i;
|
||||
Vec3f* breakPos = &this->actor.posRot.pos;
|
||||
Vec3f* breakPos = &this->actor.world.pos;
|
||||
Vec3f pos;
|
||||
Vec3f velocity;
|
||||
|
||||
|
@ -147,13 +147,13 @@ void ObjKibako_AirBreak(ObjKibako* this, GlobalContext* globalCtx) {
|
|||
(Rand_ZeroOne() * 30.0f) + 10.0f, 0, 32, 60, KAKERA_COLOR_NONE,
|
||||
OBJECT_GAMEPLAY_DANGEON_KEEP, D_05005380);
|
||||
}
|
||||
func_80033480(globalCtx, &this->actor.posRot.pos, 40.0f, 3, 50, 140, 1);
|
||||
func_80033480(globalCtx, &this->actor.world.pos, 40.0f, 3, 50, 140, 1);
|
||||
}
|
||||
|
||||
void ObjKibako_WaterBreak(ObjKibako* this, GlobalContext* globalCtx) {
|
||||
s16 angle;
|
||||
s32 i;
|
||||
Vec3f* breakPos = &this->actor.posRot.pos;
|
||||
Vec3f* breakPos = &this->actor.world.pos;
|
||||
Vec3f pos;
|
||||
Vec3f velocity;
|
||||
|
||||
|
@ -196,28 +196,28 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) {
|
|||
ObjKibako_SetupHeld(this);
|
||||
} else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 19.0f)) {
|
||||
ObjKibako_WaterBreak(this, globalCtx);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK);
|
||||
ObjKibako_SpawnCollectible(this, globalCtx);
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (this->collider.base.acFlags & AC_HIT) {
|
||||
ObjKibako_AirBreak(this, globalCtx);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK);
|
||||
ObjKibako_SpawnCollectible(this, globalCtx);
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
Actor_MoveForward(&this->actor);
|
||||
func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5);
|
||||
if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToLink > 28.0f)) {
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5);
|
||||
if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 28.0f)) {
|
||||
this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER;
|
||||
}
|
||||
if (this->actor.xzDistToLink < 600.0f) {
|
||||
if (this->actor.xzDistToPlayer < 600.0f) {
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
if (this->actor.xzDistToLink < 180.0f) {
|
||||
if (this->actor.xzDistToPlayer < 180.0f) {
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
}
|
||||
}
|
||||
if (this->actor.xzDistToLink < 100.0f) {
|
||||
if (this->actor.xzDistToPlayer < 100.0f) {
|
||||
func_8002F580(&this->actor, globalCtx);
|
||||
}
|
||||
}
|
||||
|
@ -241,13 +241,13 @@ void ObjKibako_Held(ObjKibako* this, GlobalContext* globalCtx) {
|
|||
ObjKibako_ApplyGravity(this);
|
||||
func_8002D7EC(&this->actor);
|
||||
}
|
||||
func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjKibako_SetupThrown(ObjKibako* this) {
|
||||
this->actor.velocity.x = Math_SinS(this->actor.posRot.rot.y) * this->actor.speedXZ;
|
||||
this->actor.velocity.z = Math_CosS(this->actor.posRot.rot.y) * this->actor.speedXZ;
|
||||
this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ;
|
||||
this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ;
|
||||
this->actor.colChkInfo.mass = 240;
|
||||
this->actionFunc = ObjKibako_Thrown;
|
||||
}
|
||||
|
@ -258,18 +258,18 @@ void ObjKibako_Thrown(ObjKibako* this, GlobalContext* globalCtx) {
|
|||
|
||||
if ((this->actor.bgCheckFlags & 0xB) || (this->collider.base.atFlags & AT_HIT)) {
|
||||
ObjKibako_AirBreak(this, globalCtx);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK);
|
||||
ObjKibako_SpawnCollectible(this, globalCtx);
|
||||
Actor_Kill(&this->actor);
|
||||
} else if (this->actor.bgCheckFlags & 0x40) {
|
||||
ObjKibako_WaterBreak(this, globalCtx);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK);
|
||||
Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK);
|
||||
ObjKibako_SpawnCollectible(this, globalCtx);
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
ObjKibako_ApplyGravity(this);
|
||||
func_8002D7EC(&this->actor);
|
||||
func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue