1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Fix misc 15 (#1298)

* Use `SCENE_` enum more

* Decimal for pos in `D_8011F9B8`

* `__osEventStateTab`: length `OS_NUM_EVENTS + 1` -> `OS_NUM_EVENTS`

* thone -> throne

* `s` on local data

* minor sfxId cleanup

* Run formatter

* Fixup 0x19 + 1 = 0x1A, not 0x20 lol

* Tlut -> TLUT

* DemoKankyo params usage cleanup

* Some proofreading (up to z_actor.c)

* Revert 0 -> sfxId, add todo comment (sfxId=0 is weird apparently)

* `sZdWaterBox` -> `sZorasDomainWaterBox`

* `msgMode == MSGMODE_`, not `GAMEMODE_` (my bad Sadge)
This commit is contained in:
Dragorn421 2022-06-24 16:45:05 -07:00 committed by GitHub
parent fe7afb9b07
commit 397e481f9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 60 additions and 54 deletions

View file

@ -253,7 +253,7 @@ void func_8088B79C(BgHidanRock* this, PlayState* play) {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
Audio_PlayActorSound2(
&this->dyna.actor,
SurfaceType_GetSfx(&play->colCtx, this->dyna.actor.floorPoly, this->dyna.actor.floorBgId) + 0x800);
SurfaceType_GetSfx(&play->colCtx, this->dyna.actor.floorPoly, this->dyna.actor.floorBgId) + SFX_FLAG);
}
this->unk_16C -= 0.5f;

View file

@ -20,7 +20,7 @@ void func_808992D8(BgJyaIronobj* this);
void func_808992E8(BgJyaIronobj* this, PlayState* play);
void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk* enIk);
void BgJyaIronobj_SpawnThoneParticles(BgJyaIronobj* this, PlayState* play, EnIk* enIk);
void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk* enIk);
static int sUnused = 0;
@ -157,7 +157,7 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk
/*
* Spawns particles for the destroyed throne
*/
void BgJyaIronobj_SpawnThoneParticles(BgJyaIronobj* this, PlayState* play, EnIk* enIk) {
void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk* enIk) {
s32 i;
s32 j;
s16 unkArg5;
@ -238,7 +238,7 @@ void func_808992D8(BgJyaIronobj* this) {
}
void func_808992E8(BgJyaIronobj* this, PlayState* play) {
static BgJyaIronobjIkFunc particleFunc[] = { BgJyaIronobj_SpawnPillarParticles, BgJyaIronobj_SpawnThoneParticles };
static BgJyaIronobjIkFunc particleFunc[] = { BgJyaIronobj_SpawnPillarParticles, BgJyaIronobj_SpawnThroneParticles };
Actor* actor;
Vec3f dropPos;
s32 i;

View file

@ -370,10 +370,10 @@ void DemoKankyo_DoNothing2(DemoKankyo* this, PlayState* play) {
DemoKankyo_SetupAction(this, DemoKankyo_DoNothing);
}
void DemoKankyo_SetRockPos(DemoKankyo* this, PlayState* play, s32 params) {
void DemoKankyo_SetRockPos(DemoKankyo* this, PlayState* play, s32 npcActionIndex) {
Vec3f startPos;
Vec3f endPos;
CsCmdActorAction* csAction = play->csCtx.npcActions[params];
CsCmdActorAction* csAction = play->csCtx.npcActions[npcActionIndex];
f32 temp_f0;
startPos.x = csAction->startPos.x;
@ -389,8 +389,8 @@ void DemoKankyo_SetRockPos(DemoKankyo* this, PlayState* play, s32 params) {
}
void DemoKankyo_UpdateRock(DemoKankyo* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[this->actor.params - 2] != NULL) {
DemoKankyo_SetRockPos(this, play, this->actor.params - 2);
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[this->actor.params - DEMOKANKYO_ROCK_1] != NULL) {
DemoKankyo_SetRockPos(this, play, this->actor.params - DEMOKANKYO_ROCK_1);
}
this->unk_150[0].unk_C.x += this->unk_150[0].unk_0.x;
this->unk_150[0].unk_C.y += this->unk_150[0].unk_0.y;

View file

@ -1,4 +1,5 @@
#include "z_en_box.h"
#include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h"
#include "assets/objects/object_box/object_box.h"
#define FLAGS 0
@ -359,7 +360,7 @@ void EnBox_AppearInit(EnBox* this, PlayState* play) {
EnBox_SetupAction(this, EnBox_AppearAnimation);
this->unk_1A8 = 0;
Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y,
this->dyna.actor.home.pos.z, 0, 0, 0, 0x0011);
this->dyna.actor.home.pos.z, 0, 0, 0, DEMOKANKYO_SPARKLES);
Audio_PlaySoundGeneral(NA_SE_EV_TRE_BOX_APPEAR, &this->dyna.actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}

View file

@ -298,7 +298,7 @@ void EnDu_Init(Actor* thisx, PlayState* play) {
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDarunia01Cs);
gSaveContext.cutsceneTrigger = 1;
EnDu_SetupAction(this, func_809FE890);
} else if (play->sceneNum == 4) {
} else if (play->sceneNum == SCENE_HIDAN) {
EnDu_SetupAction(this, func_809FE638);
} else if (!LINK_IS_ADULT) {
EnDu_SetupAction(this, func_809FE3C0);

View file

@ -174,7 +174,8 @@ void EnJs_Update(Actor* thisx, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
if (SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1) {
if (SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) ==
(NA_SE_PL_WALK_SAND - SFX_FLAG)) {
Math_ApproachF(&this->actor.shape.yOffset, sREG(80) + -2000.0f, 1.0f, (sREG(81) / 10.0f) + 50.0f);
}
} else {

View file

@ -5,6 +5,7 @@
*/
#include "z_shot_sun.h"
#include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "assets/scenes/overworld/spot06/spot06_scene.h"
#include "vt.h"
@ -112,7 +113,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) {
this->timer = 50;
Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, this->actor.home.pos.x, this->actor.home.pos.y,
this->actor.home.pos.z, 0, 0, 0, 0x11);
this->actor.home.pos.z, 0, 0, 0, DEMOKANKYO_SPARKLES);
func_80078914(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_APPEAR);
}

View file

@ -8,6 +8,7 @@
#include "global.h"
#include "overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h"
#include "overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h"
#include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h"
#include "overlays/actors/ovl_En_Boom/z_en_boom.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
@ -12184,7 +12185,8 @@ void func_8084E3C4(Player* this, PlayState* play) {
this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29;
this->stateFlags2 |= PLAYER_STATE2_27;
if (Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0xF) == NULL) {
if (Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, 0.0f, 0.0f, 0.0f, 0, 0, 0, DEMOKANKYO_WARP_OUT) ==
NULL) {
Environment_WarpSongLeave(play);
}
@ -12653,7 +12655,7 @@ void func_8084F608(Player* this, PlayState* play) {
void func_8084F698(Player* this, PlayState* play) {
func_80835C58(play, this, func_8084F608, 0);
this->unk_850 = 40;
Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0x10);
Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, 0.0f, 0.0f, 0.0f, 0, 0, 0, DEMOKANKYO_WARP_IN);
}
void func_8084F710(Player* this, PlayState* play) {
@ -12697,7 +12699,7 @@ void func_8084F88C(Player* this, PlayState* play) {
if ((this->unk_850++ > 8) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) {
if (this->unk_84F != 0) {
if (play->sceneNum == 9) {
if (play->sceneNum == SCENE_ICE_DOUKUTO) {
Play_TriggerRespawn(play);
play->nextEntranceIndex = ENTR_ICE_DOUKUTO_0;
} else if (this->unk_84F < 0) {