1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-28 19:25:27 +00:00

Match more retail actors (#1711)

* More actors

* Format
This commit is contained in:
cadmic 2024-02-04 19:28:18 -08:00 committed by GitHub
parent d674dad3da
commit 454b1caa52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 75 additions and 51 deletions

View file

@ -469,7 +469,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) || (mREG(1) == 1)) {
if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) || (OOT_DEBUG && mREG(1) == 1)) {
path = (this->dyna.actor.params >> 8) & 0x1F;
if (path == 0x1F) {
PRINTF(VT_COL(RED, WHITE));
@ -504,7 +504,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) {
Actor_Kill(&this->dyna.actor);
return;
}
} else if ((Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) != 0) || (mREG(1) == 1)) {
} else if ((Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) != 0) || (OOT_DEBUG && mREG(1) == 1)) {
ObjBean_SetupWaitForWater(this);
} else {
ObjBean_SetupWaitForBean(this);

View file

@ -94,9 +94,11 @@ void ObjHsblock_Init(Actor* thisx, PlayState* play) {
}
}
#if OOT_DEBUG
mREG(13) = 255;
mREG(14) = 255;
mREG(15) = 255;
#endif
}
void ObjHsblock_Destroy(Actor* thisx, PlayState* play) {
@ -158,9 +160,16 @@ void ObjHsblock_Draw(Actor* thisx, PlayState* play) {
if (play->sceneId == SCENE_FIRE_TEMPLE) {
color = &sFireTempleColor;
} else {
#if OOT_DEBUG
defaultColor.r = mREG(13);
defaultColor.g = mREG(14);
defaultColor.b = mREG(15);
#else
defaultColor.r = 255;
defaultColor.g = 255;
defaultColor.b = 255;
#endif
color = &defaultColor;
}

View file

@ -125,8 +125,8 @@ void ObjKibako2_Init(Actor* thisx, PlayState* play) {
ObjKibako2_InitCollider(thisx, play);
CollisionHeader_GetVirtual(&gLargeCrateCol, &colHeader);
bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
this->collectibleFlag = this->dyna.actor.home.rot.z & 0x3F;
this->dyna.bgId = bgId;
this->collectibleFlag = this->dyna.actor.home.rot.z & 0x3F;
this->actionFunc = ObjKibako2_Idle;
this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z =
this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x = 0;

View file

@ -109,9 +109,12 @@ void ObjMure_Init(Actor* thisx, PlayState* play) {
this->actionFunc = ObjMure_InitialAction;
PRINTF("群れな敵 (arg_data 0x%04x)(chNum(%d) ptn(%d) svNum(%d) type(%d))\n", thisx->params, this->chNum, this->ptn,
this->svNum, this->type);
#if OOT_DEBUG
if (ObjMure_GetMaxChildSpawns(this) <= 0) {
PRINTF("Warning : 個体数が設定されていません(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 268, thisx->params);
}
#endif
}
void ObjMure_Destroy(Actor* thisx, PlayState* play) {
@ -125,48 +128,52 @@ s32 ObjMure_GetMaxChildSpawns(ObjMure* this) {
}
void ObjMure_GetSpawnPos(Vec3f* outPos, Vec3f* inPos, s32 ptn, s32 idx) {
#if OOT_DEBUG
if (ptn >= 4) {
PRINTF("おかしなの (%s %d)\n", "../z_obj_mure.c", 307);
}
#endif
*outPos = *inPos;
}
void ObjMure_SpawnActors0(ObjMure* this, PlayState* play) {
ActorContext* ac;
Actor* actor = &this->actor;
s32 i;
Vec3f pos;
s32 pad;
s32 maxChildren = ObjMure_GetMaxChildSpawns(this);
for (i = 0; i < maxChildren; i++) {
#if OOT_DEBUG
if (this->children[i] != NULL) {
// "Error: I already have a child(%s %d)(arg_data 0x%04x)"
PRINTF("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 333, this->actor.params);
PRINTF("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 333, actor->params);
}
#endif
switch (this->childrenStates[i]) {
case OBJMURE_CHILD_STATE_1:
break;
case OBJMURE_CHILD_STATE_2:
ac = &play->actorCtx;
ObjMure_GetSpawnPos(&pos, &this->actor.world.pos, this->ptn, i);
ObjMure_GetSpawnPos(&pos, &actor->world.pos, this->ptn, i);
this->children[i] =
Actor_Spawn(ac, play, sSpawnActorIds[this->type], pos.x, pos.y, pos.z, this->actor.world.rot.x,
this->actor.world.rot.y, this->actor.world.rot.z, sSpawnParams[this->type]);
Actor_Spawn(&play->actorCtx, play, sSpawnActorIds[this->type], pos.x, pos.y, pos.z,
actor->world.rot.x, actor->world.rot.y, actor->world.rot.z, sSpawnParams[this->type]);
if (this->children[i] != NULL) {
this->children[i]->flags |= ACTOR_FLAG_ENKUSA_CUT;
this->children[i]->room = this->actor.room;
this->children[i]->room = actor->room;
} else {
PRINTF("warning 発生失敗 (%s %d)\n", "../z_obj_mure.c", 359);
}
break;
default:
ac = &play->actorCtx;
ObjMure_GetSpawnPos(&pos, &this->actor.world.pos, this->ptn, i);
ObjMure_GetSpawnPos(&pos, &actor->world.pos, this->ptn, i);
this->children[i] =
Actor_Spawn(ac, play, sSpawnActorIds[this->type], pos.x, pos.y, pos.z, this->actor.world.rot.x,
this->actor.world.rot.y, this->actor.world.rot.z, sSpawnParams[this->type]);
Actor_Spawn(&play->actorCtx, play, sSpawnActorIds[this->type], pos.x, pos.y, pos.z,
actor->world.rot.x, actor->world.rot.y, actor->world.rot.z, sSpawnParams[this->type]);
if (this->children[i] != NULL) {
this->children[i]->room = this->actor.room;
this->children[i]->room = actor->room;
} else {
PRINTF("warning 発生失敗 (%s %d)\n", "../z_obj_mure.c", 382);
}
@ -175,21 +182,23 @@ void ObjMure_SpawnActors0(ObjMure* this, PlayState* play) {
}
}
void ObjMure_SpawnActors1(ObjMure* this, PlayState* play) {
ActorContext* ac = (ActorContext*)play; // fake match
void ObjMure_SpawnActors1(ObjMure* this, PlayState* play2) {
PlayState* play = play2;
Actor* actor = &this->actor;
Vec3f spawnPos;
s32 maxChildren = ObjMure_GetMaxChildSpawns(this);
s32 i;
for (i = 0; i < maxChildren; i++) {
#if OOT_DEBUG
if (this->children[i] != NULL) {
PRINTF("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 407, actor->params);
}
ac = &play->actorCtx;
#endif
ObjMure_GetSpawnPos(&spawnPos, &actor->world.pos, this->ptn, i);
this->children[i] = Actor_Spawn(ac, play, sSpawnActorIds[this->type], spawnPos.x, spawnPos.y, spawnPos.z,
actor->world.rot.x, actor->world.rot.y, actor->world.rot.z,
this->children[i] = Actor_Spawn(&play2->actorCtx, play, sSpawnActorIds[this->type], spawnPos.x, spawnPos.y,
spawnPos.z, actor->world.rot.x, actor->world.rot.y, actor->world.rot.z,
(this->type == 4 && i == 0) ? 1 : sSpawnParams[this->type]);
if (this->children[i] != NULL) {
this->childrenStates[i] = OBJMURE_CHILD_STATE_0;

View file

@ -106,9 +106,10 @@ void func_80B9ABA0(ObjMure3* this, PlayState* play) {
void func_80B9ACE4(ObjMure3* this, PlayState* play) {
s16 count = sRupeeCounts[(this->actor.params >> 13) & 7];
s32 i;
EnItem00** collectible;
for (i = 0; i < count; i++) {
EnItem00** collectible = &this->unk_150[i];
collectible = &this->unk_150[i];
if (!((this->unk_16C >> i) & 1) && (*collectible != NULL)) {
if (Actor_HasParent(&(*collectible)->actor, play) || ((*collectible)->actor.update == NULL)) {

View file

@ -283,6 +283,8 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) {
}
flameScale *= 0.0027f;
if (1) {}
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x08,

View file

@ -74,39 +74,37 @@ void ObjWarp2block_Spawn(ObjWarp2block* this, PlayState* play) {
}
s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) {
s32 pad;
Actor* temp_a3;
Player* player;
Vec3f sp20;
f32 temp_f2;
if (DynaPolyActor_IsPlayerAbove(&this->dyna)) {
return 0;
}
temp_a3 = this->dyna.actor.child;
player = GET_PLAYER(play);
if ((this->dyna.actor.xzDistToPlayer <= sDistances[(((this->dyna.actor.params >> 0xB) & 7))]) ||
(temp_a3->xzDistToPlayer <= sDistances[(((temp_a3->params >> 0xB) & 7))])) {
func_8002DBD0(&this->dyna.actor, &sp20, &player->actor.world.pos);
temp_f2 = (this->dyna.actor.scale.x * 50.0f) + 6.0f;
if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) {
return 0;
}
func_8002DBD0(temp_a3, &sp20, &player->actor.world.pos);
temp_f2 = (temp_a3->scale.x * 50.0f) + 6.0f;
if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) {
return 0;
}
} else {
return 0;
}
s32 pad;
Actor* temp_a3 = this->dyna.actor.child;
Player* player = GET_PLAYER(play);
Vec3f sp20;
f32 temp_f2;
return 1;
if ((this->dyna.actor.xzDistToPlayer <= sDistances[(((this->dyna.actor.params >> 0xB) & 7))]) ||
(temp_a3->xzDistToPlayer <= sDistances[(((temp_a3->params >> 0xB) & 7))])) {
func_8002DBD0(&this->dyna.actor, &sp20, &player->actor.world.pos);
temp_f2 = (this->dyna.actor.scale.x * 50.0f) + 6.0f;
if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) {
return 0;
}
func_8002DBD0(temp_a3, &sp20, &player->actor.world.pos);
temp_f2 = (temp_a3->scale.x * 50.0f) + 6.0f;
if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) {
return 0;
}
} else {
return 0;
}
return 1;
}
}
void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play) {

View file

@ -860,6 +860,8 @@ void ObjectKankyo_DrawSunGraveSpark(Actor* thisx, PlayState* play2) {
(u8)(255 * this->effects[0].amplitude), 255 - (u8)(255 * this->effects[0].amplitude),
this->effects[0].alpha);
if (1) {}
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_object_kankyo.c", 1416), G_MTX_LOAD);

View file

@ -124,5 +124,7 @@ void OceffWipe_Draw(Actor* thisx, PlayState* play) {
32, 1, 0 - scroll, scroll * (-2), 32, 32));
gSPDisplayList(POLY_XLU_DISP++, sFrustumDL);
if (1) {}
CLOSE_DISPS(play->state.gfxCtx, "../z_oceff_wipe.c", 398);
}

View file

@ -163,7 +163,6 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) {
Player* player = GET_PLAYER(play);
EnItem00* collectible;
s32 pad;
Vec3f spawnPos;
if (this->collider.base.acFlags & AC_HIT) {
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
@ -174,6 +173,8 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) {
if (1) {}
gSaveContext.cutsceneTrigger = 1;
} else {
Vec3f spawnPos;
spawnPos.x = 700.0f;
spawnPos.y = -800.0f;
spawnPos.z = 7261.0f;