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

@ -32,7 +32,7 @@ static s16 sPlayerCaught = 0;
const ActorInit En_Heishi3_InitVars = {
ACTOR_EN_HEISHI3,
ACTORTYPE_NPC,
ACTORCAT_NPC,
FLAGS,
OBJECT_SD,
sizeof(EnHeishi3),
@ -70,22 +70,22 @@ void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_278 = 0;
} else {
this->unk_278 = 1;
if (this->actor.posRot.pos.x < -290.0f) {
if (this->actor.world.pos.x < -290.0f) {
this->unk_278 = 2;
}
}
Actor_SetScale(&this->actor, 0.01f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.unk_1F = 6;
this->actor.targetMode = 6;
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
// "Castle Gate Soldier - Power Up"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 城門兵パワーアップ ☆☆☆☆☆ \n" VT_RST);
this->actor.gravity = -3.0f;
this->actor.posRot2.pos = this->actor.posRot.pos;
this->actor.focus.pos = this->actor.world.pos;
this->actionFunc = EnHeishi3_SetupGuardType;
}
@ -117,7 +117,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx)
player = PLAYER;
SkelAnime_Update(&this->skelAnime);
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
yawDiffNew = ABS(yawDiff);
if (yawDiffNew < 0x4300) {
if (gSaveContext.nightFlag == 0) {
@ -132,8 +132,8 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx)
sightRange = 100.0f;
}
}
if ((this->actor.xzDistToLink < sightRange) &&
(fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f) && (sPlayerCaught == 0)) {
if ((this->actor.xzDistToPlayer < sightRange) &&
(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f) && (sPlayerCaught == 0)) {
sPlayerCaught = 1;
func_8010B680(globalCtx, 0x702D, &this->actor); // "Hey you! Stop! You, kid, over there!"
func_80078884(NA_SE_SY_FOUND);
@ -150,15 +150,15 @@ void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, GlobalContext* globalCtx)
Player* player = PLAYER;
SkelAnime_Update(&this->skelAnime);
if ((player->actor.posRot.pos.x < -190.0f) && (player->actor.posRot.pos.x > -380.0f) &&
(fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f) &&
(player->actor.posRot.pos.z < 1020.0f) && (player->actor.posRot.pos.z > 700.0f) && (sPlayerCaught == 0)) {
if ((player->actor.world.pos.x < -190.0f) && (player->actor.world.pos.x > -380.0f) &&
(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f) &&
(player->actor.world.pos.z < 1020.0f) && (player->actor.world.pos.z > 700.0f) && (sPlayerCaught == 0)) {
if (this->unk_278 == 1) {
if ((player->actor.posRot.pos.x < -290.0f)) {
if ((player->actor.world.pos.x < -290.0f)) {
return;
}
} else {
if (player->actor.posRot.pos.x > -290.0f) {
if (player->actor.world.pos.x > -290.0f) {
return;
}
}
@ -190,7 +190,7 @@ void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx) {
this->actionFunc = EnHeishi3_ResetAnimationToIdle;
this->actor.speedXZ = 0.0f;
} else {
Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 5, 3000, 0);
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 3000, 0);
}
}
@ -218,15 +218,15 @@ void EnHeishi3_Update(Actor* thisx, GlobalContext* globalCtx) {
EnHeishi3* this = THIS;
s32 pad;
Actor_SetHeight(&this->actor, 60.0f);
Actor_SetFocus(&this->actor, 60.0f);
this->unk_274 += 1;
if (this->caughtTimer != 0) {
this->caughtTimer -= 1;
}
this->actionFunc(this, globalCtx);
this->actor.shape.rot = this->actor.posRot.rot;
this->actor.shape.rot = this->actor.world.rot;
Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C);
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}