mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
ovl_Shot_Sun Decompiled (#905)
* matching functions, warnings and data pending. * ovl_Shot_Sun Decompiled * space * pr review * unk1202E -> lastPlayedSong Rename * defines * OCARINA_SONG enums * format * OCARINA_SONG Enums * pr review * pr review
This commit is contained in:
@@ -121,7 +121,7 @@ typedef struct MessageContext {
|
||||
/* 0x12028 */ u16 songPlayed;
|
||||
/* 0x1202A */ u16 ocarinaMode;
|
||||
/* 0x1202C */ u16 ocarinaAction;
|
||||
/* 0x1202E */ u16 unk1202E;
|
||||
/* 0x1202E */ u16 lastPlayedSong;
|
||||
/* 0x12030 */ s16 unk_12030;
|
||||
/* 0x12032 */ UNK_TYPE1 unk_12032[0x2];
|
||||
/* 0x12034 */ s16 unk12034;
|
||||
|
||||
@@ -1721,8 +1721,7 @@ beginseg
|
||||
name "ovl_Shot_Sun"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.o"
|
||||
include "build/data/ovl_Shot_Sun/ovl_Shot_Sun.data.o"
|
||||
include "build/data/ovl_Shot_Sun/ovl_Shot_Sun.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Shot_Sun/ovl_Shot_Sun_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
||||
@@ -176,7 +176,7 @@ void func_80AA8698(DmChar01* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if ((player->transformation == PLAYER_FORM_DEKU) && (play->msgCtx.ocarinaMode == 3) &&
|
||||
(play->msgCtx.unk1202E == 0)) {
|
||||
(play->msgCtx.lastPlayedSong == OCARINA_SONG_SONATA)) {
|
||||
|
||||
if ((player2->actor.world.pos.x > -40.0f) && (player2->actor.world.pos.x < 40.0f) &&
|
||||
(player2->actor.world.pos.z > 1000.0f) && (player2->actor.world.pos.z < 1078.0f)) {
|
||||
|
||||
@@ -412,7 +412,7 @@ void func_80B3EEDC(EnDai* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if ((player->transformation == PLAYER_FORM_GORON) && (play->msgCtx.ocarinaMode == 3) &&
|
||||
(play->msgCtx.unk1202E == 1)) {
|
||||
(play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY)) {
|
||||
func_80B3E5DC(this, 1);
|
||||
this->actionFunc = func_80B3EE8C;
|
||||
} else if (!(player->stateFlags2 & 0x08000000)) {
|
||||
|
||||
@@ -49,6 +49,17 @@ typedef struct EnElf {
|
||||
/* 0x270 */ EnElfActionFunc actionFunc;
|
||||
} EnElf; // size = 0x274
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ ENELF_TYPE_0,
|
||||
/* 0x01 */ ENELF_TYPE_1,
|
||||
/* 0x02 */ ENELF_TYPE_2,
|
||||
/* 0x03 */ ENELF_TYPE_3,
|
||||
/* 0x04 */ ENELF_TYPE_4,
|
||||
/* 0x05 */ ENELF_TYPE_5,
|
||||
/* 0x06 */ ENELF_TYPE_6,
|
||||
/* 0x07 */ ENELF_TYPE_7
|
||||
} FairyType;
|
||||
|
||||
extern const ActorInit En_Elf_InitVars;
|
||||
|
||||
#endif // Z_EN_ELF_H
|
||||
|
||||
@@ -370,7 +370,7 @@ void func_80B0FE7C(PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80B0FEBC(EnGb2* this, PlayState* play) {
|
||||
if ((play->msgCtx.ocarinaMode == 3) && (play->msgCtx.unk1202E == 7)) {
|
||||
if ((play->msgCtx.ocarinaMode == OCARINA_SONG_ELEGY) && (play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING)) {
|
||||
play->msgCtx.ocarinaMode = 4;
|
||||
gSaveContext.eventInf[4] |= 0x80;
|
||||
this->unk_26E = 0x14D1;
|
||||
|
||||
@@ -399,7 +399,7 @@ void func_80B359DC(EnGg* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if ((player->transformation == PLAYER_FORM_HUMAN) && (play->msgCtx.ocarinaMode == 3) &&
|
||||
(play->msgCtx.unk1202E == 7)) {
|
||||
(play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING)) {
|
||||
if (!(gSaveContext.save.weekEventReg[19] & 0x80)) {
|
||||
gSaveContext.save.weekEventReg[19] |= 0x80;
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ s32 func_80B50854(EnGk* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if ((player->transformation == PLAYER_FORM_GORON) && (play->msgCtx.ocarinaMode == 3) &&
|
||||
(play->msgCtx.unk1202E == 1)) {
|
||||
(play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY)) {
|
||||
Flags_SetSwitch(play, ENGK_GET_3F00(&this->actor));
|
||||
this->unk_2E4 = 3;
|
||||
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
|
||||
@@ -506,7 +506,7 @@ void func_80B51410(EnGk* this, PlayState* play) {
|
||||
|
||||
if (this->actor.xzDistToPlayer < 100.0f) {
|
||||
if ((player->transformation == PLAYER_FORM_GORON) && (play->msgCtx.ocarinaMode == 3) &&
|
||||
(play->msgCtx.unk1202E == 0xE)) {
|
||||
(play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY_INTRO)) {
|
||||
this->unk_1E4 |= 0x20;
|
||||
}
|
||||
|
||||
|
||||
@@ -535,7 +535,8 @@ s32 func_80A1222C(EnGo* this, PlayState* play) {
|
||||
s32 ret = false;
|
||||
|
||||
if (((player->transformation == PLAYER_FORM_GORON) && (play->msgCtx.ocarinaMode == 3) &&
|
||||
(play->msgCtx.unk1202E == 1) && (this->unk_3EC == 0) && (this->actor.xzDistToPlayer < 400.0f)) ||
|
||||
(play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY) && (this->unk_3EC == 0) &&
|
||||
(this->actor.xzDistToPlayer < 400.0f)) ||
|
||||
(!(gSaveContext.save.weekEventReg[22] & 4) && (play->sceneNum == SCENE_16GORON_HOUSE) &&
|
||||
(gSaveContext.sceneSetupIndex == 0) && (this->unk_3EC == 0) && (play->csCtx.currentCsIndex == 1))) {
|
||||
ret = true;
|
||||
|
||||
@@ -275,9 +275,9 @@ void func_80998040(EnGs* this, PlayState* play) {
|
||||
void func_8099807C(EnGs* this, PlayState* play) {
|
||||
switch (play->msgCtx.ocarinaMode) {
|
||||
case 3:
|
||||
switch (play->msgCtx.unk1202E) {
|
||||
case 7:
|
||||
case 8:
|
||||
switch (play->msgCtx.lastPlayedSong) {
|
||||
case OCARINA_SONG_HEALING:
|
||||
case OCARINA_SONG_EPONAS:
|
||||
if (!Flags_GetSwitch(play, this->unk_196)) {
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, 2);
|
||||
@@ -286,7 +286,7 @@ void func_8099807C(EnGs* this, PlayState* play) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case OCARINA_SONG_STORMS:
|
||||
if (!Flags_GetSwitch(play, this->unk_196)) {
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, 7);
|
||||
@@ -295,7 +295,7 @@ void func_8099807C(EnGs* this, PlayState* play) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 0:
|
||||
case OCARINA_SONG_SONATA:
|
||||
if ((this->actor.params == ENGS_1) && (gSaveContext.save.playerForm == PLAYER_FORM_DEKU)) {
|
||||
this->unk_194 = 1;
|
||||
this->unk_19C = 5;
|
||||
@@ -305,7 +305,7 @@ void func_8099807C(EnGs* this, PlayState* play) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case OCARINA_SONG_NEW_WAVE:
|
||||
if ((this->actor.params == ENGS_1) && (gSaveContext.save.playerForm == PLAYER_FORM_ZORA)) {
|
||||
this->unk_194 = 3;
|
||||
this->unk_19C = 5;
|
||||
@@ -315,7 +315,7 @@ void func_8099807C(EnGs* this, PlayState* play) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case OCARINA_SONG_GORON_LULLABY:
|
||||
if ((this->actor.params == ENGS_1) && (gSaveContext.save.playerForm == PLAYER_FORM_GORON)) {
|
||||
this->unk_194 = 2;
|
||||
this->unk_19C = 5;
|
||||
|
||||
@@ -357,7 +357,8 @@ void func_80BCFC0C(EnHg* this, PlayState* play) {
|
||||
D_80BD00C8 = false;
|
||||
}
|
||||
if (play->msgCtx.ocarinaMode == 3) {
|
||||
if (play->msgCtx.unk1202E == 7 && gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
|
||||
if (play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING &&
|
||||
gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
|
||||
if (INV_CONTENT(ITEM_MASK_GIBDO) == ITEM_MASK_GIBDO) {
|
||||
this->unk218 = 3;
|
||||
} else {
|
||||
|
||||
@@ -182,7 +182,7 @@ void func_80BDB2B8(EnHiddenNuts* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (!(this->actor.xzDistToPlayer > 120.0f)) {
|
||||
if ((play->msgCtx.ocarinaMode == 3) && (play->msgCtx.unk1202E == 0)) {
|
||||
if ((play->msgCtx.ocarinaMode == 3) && (play->msgCtx.lastPlayedSong == OCARINA_SONG_SONATA)) {
|
||||
play->msgCtx.ocarinaMode = 4;
|
||||
func_80BDB788(this);
|
||||
} else if (func_801A5100() == 2) {
|
||||
|
||||
@@ -831,7 +831,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play) {
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if ((play->msgCtx.ocarinaMode == 4) && (play->msgCtx.unk1202E == 7)) {
|
||||
if ((play->msgCtx.ocarinaMode == 4) && (play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING)) {
|
||||
this->actionState = ENKANBAN_REPAIR;
|
||||
this->bounceX = 1;
|
||||
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
|
||||
|
||||
@@ -370,26 +370,26 @@ s32 EnRuppecrow_CheckPlayedMatchingSong(PlayState* play) {
|
||||
if (play->msgCtx.ocarinaMode == 0x3) {
|
||||
switch (player->transformation) {
|
||||
case PLAYER_FORM_DEKU:
|
||||
if (play->msgCtx.unk1202E == OCARINA_SONG_SONATA) {
|
||||
if (play->msgCtx.lastPlayedSong == OCARINA_SONG_SONATA) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case PLAYER_FORM_GORON:
|
||||
if (play->msgCtx.unk1202E == OCARINA_SONG_GORON_LULLABY) {
|
||||
if (play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case PLAYER_FORM_ZORA:
|
||||
if (play->msgCtx.unk1202E == OCARINA_SONG_NEW_WAVE) {
|
||||
if (play->msgCtx.lastPlayedSong == OCARINA_SONG_NEW_WAVE) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case PLAYER_FORM_HUMAN:
|
||||
if (play->msgCtx.unk1202E == OCARINA_SONG_SONATA) {
|
||||
if (play->msgCtx.lastPlayedSong == OCARINA_SONG_SONATA) {
|
||||
return true;
|
||||
} else if (play->msgCtx.unk1202E == OCARINA_SONG_GORON_LULLABY) {
|
||||
} else if (play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY) {
|
||||
return true;
|
||||
} else if (play->msgCtx.unk1202E == OCARINA_SONG_NEW_WAVE) {
|
||||
} else if (play->msgCtx.lastPlayedSong == OCARINA_SONG_NEW_WAVE) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -103,7 +103,7 @@ void func_80AC9FE4(EnTimeTag* this, PlayState* play) {
|
||||
void func_80ACA0A8(EnTimeTag* this, PlayState* play) {
|
||||
EnTimeTag* this2 = this;
|
||||
|
||||
if ((play->msgCtx.ocarinaMode == 3) && (play->msgCtx.unk1202E == 4)) {
|
||||
if ((play->msgCtx.ocarinaMode == 3) && (play->msgCtx.lastPlayedSong == OCARINA_SONG_OATH)) {
|
||||
if (this->actor.cutscene != -1) {
|
||||
this->actionFunc = func_80AC9FE4;
|
||||
ActorCutscene_SetIntentToPlay(this2->actor.cutscene);
|
||||
|
||||
@@ -352,7 +352,7 @@ void EnYb_Idle(EnYb* this, PlayState* play) {
|
||||
|
||||
EnYb_UpdateAnimation(this, play);
|
||||
if (this->actor.xzDistToPlayer < 180.0f && fabsf(this->actor.playerHeightRel) < 50.0f &&
|
||||
play->msgCtx.ocarinaMode == 3 && play->msgCtx.unk1202E == 7 &&
|
||||
play->msgCtx.ocarinaMode == 3 && play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING &&
|
||||
gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
|
||||
this->actionFunc = EnYb_TeachingDance;
|
||||
this->teachingCutsceneTimer = 200;
|
||||
|
||||
@@ -629,7 +629,8 @@ void func_80B9451C(EnZog* this, PlayState* play) {
|
||||
this->unk_300 = 2;
|
||||
this->actionFunc = func_80B94470;
|
||||
} else if ((play->msgCtx.ocarinaMode == 3) && (this->actor.xzDistToPlayer < 120.0f)) {
|
||||
if ((play->msgCtx.unk1202E == 7) && (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN)) {
|
||||
if ((play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING) &&
|
||||
(gSaveContext.save.playerForm == PLAYER_FORM_HUMAN)) {
|
||||
func_80B93BA8(this, 2);
|
||||
this->actionFunc = func_80B943C0;
|
||||
this->actor.shape.shadowDraw = NULL;
|
||||
@@ -717,7 +718,8 @@ void func_80B948A8(EnZog* this, PlayState* play) {
|
||||
this->unk_300 = 2;
|
||||
this->actionFunc = func_80B946FC;
|
||||
} else if ((play->msgCtx.ocarinaMode == 3) && (this->actor.xzDistToPlayer < 120.0f)) {
|
||||
if ((play->msgCtx.unk1202E == 7) && (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN)) {
|
||||
if ((play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING) &&
|
||||
(gSaveContext.save.playerForm == PLAYER_FORM_HUMAN)) {
|
||||
func_80B93BA8(this, 2);
|
||||
this->actionFunc = func_80B943C0;
|
||||
this->actor.shape.shadowDraw = NULL;
|
||||
|
||||
@@ -217,7 +217,7 @@ void func_80AC9B48(ObjOcarinalift* this) {
|
||||
void func_80AC9B5C(ObjOcarinalift* this, PlayState* play) {
|
||||
if (func_800B886C(&this->dyna.actor, play)) {
|
||||
if (play->msgCtx.ocarinaMode == 4) {
|
||||
if (play->msgCtx.unk1202E == 0) {
|
||||
if (play->msgCtx.lastPlayedSong == 0) {
|
||||
if (OBJOCARINALIFT_GET_C(&this->dyna.actor) != OBJOCARINALIFT_PARAMSC_1) {
|
||||
Flags_SetSwitch(play, OBJOCARINALIFT_GET_SWITCH_FLAG(&this->dyna.actor));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* File: z_shot_sun.c
|
||||
* Overlay: ovl_Shot_Sun
|
||||
* Description:
|
||||
* Description: Leftover sun hitbox from OOT and fairy spawner
|
||||
*/
|
||||
|
||||
#include "z_shot_sun.h"
|
||||
#include "overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h"
|
||||
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
|
||||
|
||||
@@ -14,12 +16,9 @@ void ShotSun_Init(Actor* thisx, PlayState* play);
|
||||
void ShotSun_Destroy(Actor* thisx, PlayState* play);
|
||||
void ShotSun_Update(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80973740(ShotSun* this, PlayState* play);
|
||||
void func_80973804(ShotSun* this, PlayState* play);
|
||||
void func_809738D0(ShotSun* this, PlayState* play);
|
||||
void func_80973960(ShotSun* this, PlayState* play);
|
||||
void ShotSun_UpdateForOcarina(ShotSun* this, PlayState* play);
|
||||
void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play2);
|
||||
|
||||
#if 0
|
||||
const ActorInit Shot_Sun_InitVars = {
|
||||
ACTOR_SHOT_SUN,
|
||||
ACTORCAT_PROP,
|
||||
@@ -32,27 +31,156 @@ const ActorInit Shot_Sun_InitVars = {
|
||||
(ActorFunc)NULL,
|
||||
};
|
||||
|
||||
// static ColliderCylinderInit sCylinderInit = {
|
||||
static ColliderCylinderInit D_80973BA0 = {
|
||||
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
|
||||
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000020, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
{
|
||||
COLTYPE_NONE,
|
||||
AT_NONE,
|
||||
AC_ON | AC_TYPE_PLAYER,
|
||||
OC1_ON | OC1_TYPE_ALL,
|
||||
OC2_TYPE_1,
|
||||
COLSHAPE_CYLINDER,
|
||||
},
|
||||
{
|
||||
ELEMTYPE_UNK0,
|
||||
{ 0x00000000, 0x00, 0x00 },
|
||||
{ 0x00000020, 0x00, 0x00 },
|
||||
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
||||
BUMP_ON,
|
||||
OCELEM_ON,
|
||||
},
|
||||
{ 30, 60, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
#endif
|
||||
void ShotSun_Init(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
ShotSun* this = THIS;
|
||||
|
||||
extern ColliderCylinderInit D_80973BA0;
|
||||
if ((SHOTSUN_GET_FF(thisx) == SHOTSUN_FAIRY_SPAWNER_SUNS) ||
|
||||
(SHOTSUN_GET_FF(thisx) == SHOTSUN_FAIRY_SPAWNER_STORMS)) {
|
||||
this->unk_19C = 0;
|
||||
this->actor.flags |= ACTOR_FLAG_10;
|
||||
this->actor.flags |= ACTOR_FLAG_2000000;
|
||||
this->actionFunc = ShotSun_UpdateForOcarina;
|
||||
this->actor.flags |= ACTOR_FLAG_8000000;
|
||||
} else {
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->actionFunc = ShotSun_UpdateHyliaSun;
|
||||
this->actor.flags &= ~ACTOR_FLAG_1;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Shot_Sun/ShotSun_Init.s")
|
||||
void ShotSun_Destroy(Actor* thisx, PlayState* play) {
|
||||
ShotSun* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Shot_Sun/ShotSun_Destroy.s")
|
||||
if ((SHOTSUN_GET_FF(thisx) != SHOTSUN_FAIRY_SPAWNER_SUNS) &&
|
||||
(SHOTSUN_GET_FF(thisx) != SHOTSUN_FAIRY_SPAWNER_STORMS)) {
|
||||
Collider_DestroyCylinder(play, &this->collider);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Shot_Sun/func_80973740.s")
|
||||
void ShotSun_SpawnFairy(ShotSun* this, PlayState* play2) {
|
||||
s32 params = SHOTSUN_GET_FF(&this->actor);
|
||||
s32 fairyType = 0;
|
||||
PlayState* play = play2;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Shot_Sun/func_80973804.s")
|
||||
if (this->timer > 0) {
|
||||
this->timer--;
|
||||
} else {
|
||||
ActorCutscene_Stop(this->actor.cutscene);
|
||||
switch (params) {
|
||||
case SHOTSUN_FAIRY_SPAWNER_SUNS:
|
||||
fairyType = ENELF_TYPE_7;
|
||||
break;
|
||||
case SHOTSUN_FAIRY_SPAWNER_STORMS:
|
||||
fairyType = ENELF_TYPE_7;
|
||||
break;
|
||||
}
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, this->actor.home.pos.x, this->actor.home.pos.y,
|
||||
this->actor.home.pos.z, 0, 0, 0, fairyType);
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Shot_Sun/func_809738D0.s")
|
||||
void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) {
|
||||
if ((this->actor.cutscene == -1) || ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
|
||||
if (this->actor.cutscene != -1) {
|
||||
ActorCutscene_Start(this->actor.cutscene, &this->actor);
|
||||
}
|
||||
this->actionFunc = ShotSun_SpawnFairy;
|
||||
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);
|
||||
Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_APPEAR);
|
||||
} else {
|
||||
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Shot_Sun/func_80973960.s")
|
||||
void ShotSun_UpdateForOcarina(ShotSun* this, PlayState* play) {
|
||||
s32 params = SHOTSUN_GET_FF(&this->actor);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Shot_Sun/ShotSun_Update.s")
|
||||
if (play->msgCtx.ocarinaMode == 3) {
|
||||
switch (play->msgCtx.lastPlayedSong) {
|
||||
case OCARINA_SONG_STORMS:
|
||||
if (params == SHOTSUN_FAIRY_SPAWNER_STORMS) {
|
||||
this->actionFunc = ShotSun_TriggerFairy;
|
||||
play->msgCtx.ocarinaMode = 4;
|
||||
}
|
||||
break;
|
||||
case OCARINA_SONG_SUNS:
|
||||
if (params == SHOTSUN_FAIRY_SPAWNER_SUNS) {
|
||||
this->actionFunc = ShotSun_TriggerFairy;
|
||||
play->msgCtx.ocarinaMode = 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) {
|
||||
Vec3s cylinderPos;
|
||||
Player* player = GET_PLAYER(play);
|
||||
EnItem00* collectible;
|
||||
s32 pad;
|
||||
Vec3f spawnPos;
|
||||
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
play_sound(NA_SE_SY_CORRECT_CHIME);
|
||||
if (1) {}
|
||||
if (INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE) {
|
||||
Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_ETCETERA, 700.0f, -800.0f, 7261.0f, 0, 0, 0,
|
||||
ITEM_ETC_ARROW_FIRE);
|
||||
if (1) {}
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
} else {
|
||||
spawnPos.x = 700.0f;
|
||||
spawnPos.y = -800.0f;
|
||||
spawnPos.z = 7261.0f;
|
||||
collectible = (EnItem00*)Item_DropCollectible(play, &spawnPos, ITEM00_MAGIC_LARGE);
|
||||
if (collectible != NULL) {
|
||||
collectible->unk152 = 0x1770;
|
||||
collectible->actor.speedXZ = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
} else if (!(this->actor.xzDistToPlayer > 120.0f)) {
|
||||
if ((gSaveContext.save.time >= CLOCK_TIME(6, 30)) && (gSaveContext.save.time < CLOCK_TIME(7, 30))) {
|
||||
cylinderPos.x = player->bodyPartsPos[7].x + (play->envCtx.unk_4 * (1.0f / 6.0f));
|
||||
cylinderPos.y = (player->bodyPartsPos[7].y - 30.0f) + (play->envCtx.unk_8 * (1.0f / 6.0f));
|
||||
cylinderPos.z = player->bodyPartsPos[7].z + (play->envCtx.unk_C * (1.0f / 6.0f));
|
||||
|
||||
this->hitboxPos = cylinderPos;
|
||||
|
||||
Collider_SetCylinderPosition(&this->collider, &cylinderPos);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShotSun_Update(Actor* thisx, PlayState* play) {
|
||||
ShotSun* this = THIS;
|
||||
|
||||
this->actionFunc(this, play);
|
||||
}
|
||||
|
||||
@@ -3,16 +3,22 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#define SHOTSUN_GET_FF(thisx) ((thisx)->params & 0xFF)
|
||||
#define SHOTSUN_FAIRY_SPAWNER_SUNS 0x40
|
||||
#define SHOTSUN_FAIRY_SPAWNER_STORMS 0x41
|
||||
|
||||
struct ShotSun;
|
||||
|
||||
typedef void (*ShotSunActionFunc)(struct ShotSun*, PlayState*);
|
||||
|
||||
typedef struct ShotSun {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x4C];
|
||||
/* 0x144 */ ColliderCylinder collider;
|
||||
/* 0x190 */ ShotSunActionFunc actionFunc;
|
||||
/* 0x194 */ char unk_194[0xC];
|
||||
} ShotSun; // size = 0x1A0
|
||||
/* 0x194 */ Vec3s hitboxPos;
|
||||
/* 0x19A */ s16 timer;
|
||||
/* 0x19C */ s8 unk_19C; // leftover from OOT secret ocarina occurrence function.
|
||||
} ShotSun; // size = 0x1A0
|
||||
|
||||
extern const ActorInit Shot_Sun_InitVars;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user