summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormzxrules <mzxrules@gmail.com>2024-12-28 21:29:10 -0500
committerGitHub <noreply@github.com>2024-12-28 21:29:10 -0500
commit95d5f5b18da79f2fd4b04430da66a726311c542e (patch)
tree61e1cbcbc5f8d8f4a49d88b7a0a73ceba9f2212a /src
parenta590995c1a994f506ed3dfe4c2c1de6f241040b5 (diff)
Restructure event flags in z64save.h (3/?): Cursed Family Rewards (#2392)
* Cursed Family reward event flags * tunic -> shirt
Diffstat (limited to 'src')
-rw-r--r--src/overlays/actors/ovl_En_Sth/z_en_sth.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c
index 1c8a222c0..ac1065181 100644
--- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c
+++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c
@@ -75,23 +75,17 @@ static EnSthActionFunc sRewardObtainedWaitActions[6] = {
static u16 sEventFlags[6] = {
0,
- EVENTCHKINF_MASK(EVENTCHKINF_DA),
- EVENTCHKINF_MASK(EVENTCHKINF_DB),
- EVENTCHKINF_MASK(EVENTCHKINF_DC),
- EVENTCHKINF_MASK(EVENTCHKINF_DD),
- EVENTCHKINF_MASK(EVENTCHKINF_DE),
+ EVENTCHKINF_MASK(EVENTCHKINF_SKULLTULA_REWARD_10),
+ EVENTCHKINF_MASK(EVENTCHKINF_SKULLTULA_REWARD_20),
+ EVENTCHKINF_MASK(EVENTCHKINF_SKULLTULA_REWARD_30),
+ EVENTCHKINF_MASK(EVENTCHKINF_SKULLTULA_REWARD_40),
+ EVENTCHKINF_MASK(EVENTCHKINF_SKULLTULA_REWARD_50),
};
static s16 sGetItemIds[6] = {
GI_RUPEE_GOLD, GI_WALLET_ADULT, GI_STONE_OF_AGONY, GI_WALLET_GIANT, GI_BOMBCHUS_10, GI_HEART_PIECE,
};
-static Vec3f D_80B0B49C = { 700.0f, 400.0f, 0.0f };
-
-static Color_RGB8 sTunicColors[6] = {
- { 190, 110, 0 }, { 0, 180, 110 }, { 0, 255, 80 }, { 255, 160, 60 }, { 190, 230, 250 }, { 240, 230, 120 },
-};
-
void EnSth_SetupAction(EnSth* this, EnSthActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@@ -119,7 +113,7 @@ void EnSth_Init(Actor* thisx, PlayState* play) {
}
objectId = sObjectIds[params];
- if (objectId != 1) {
+ if (objectId != OBJECT_GAMEPLAY_KEEP) {
objectSlot = Object_GetSlot(&play->objectCtx, objectId);
} else {
objectSlot = 0;
@@ -159,9 +153,9 @@ void EnSth_SetupAfterObjectLoaded(EnSth* this, PlayState* play) {
16);
Animation_PlayLoop(&this->skelAnime, sAnimations[this->actor.params]);
- this->eventFlag = sEventFlags[this->actor.params];
params = &this->actor.params;
- if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_DA_DB_DC_DD_DE] & this->eventFlag) {
+ this->eventFlag = sEventFlags[*params];
+ if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_SKULLTULA_REWARD] & this->eventFlag) {
EnSth_SetupAction(this, sRewardObtainedWaitActions[*params]);
} else {
EnSth_SetupAction(this, EnSth_RewardUnobtainedWait);
@@ -261,7 +255,7 @@ void EnSth_GiveReward(EnSth* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
this->actor.parent = NULL;
EnSth_SetupAction(this, EnSth_RewardObtainedTalk);
- gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_DA_DB_DC_DD_DE] |= this->eventFlag;
+ gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_SKULLTULA_REWARD] |= this->eventFlag;
} else {
EnSth_GivePlayerItem(this, play);
}
@@ -363,6 +357,7 @@ s32 EnSth_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
}
void EnSth_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
+ static Vec3f D_80B0B49C = { 700.0f, 400.0f, 0.0f };
EnSth* this = (EnSth*)thisx;
if (limbIndex == 15) {
@@ -388,6 +383,9 @@ Gfx* EnSth_AllocColorDList(GraphicsContext* play, u8 envR, u8 envG, u8 envB, u8
}
void EnSth_Draw(Actor* thisx, PlayState* play) {
+ static Color_RGB8 sShirtColors[6] = {
+ { 190, 110, 0 }, { 0, 180, 110 }, { 0, 255, 80 }, { 255, 160, 60 }, { 190, 230, 250 }, { 240, 230, 120 },
+ };
EnSth* this = (EnSth*)thisx;
Color_RGB8* envColor1;
@@ -397,8 +395,8 @@ void EnSth_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL_37Opa(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08,
- EnSth_AllocColorDList(play->state.gfxCtx, sTunicColors[this->actor.params].r,
- sTunicColors[this->actor.params].g, sTunicColors[this->actor.params].b, 255));
+ EnSth_AllocColorDList(play->state.gfxCtx, sShirtColors[this->actor.params].r,
+ sShirtColors[this->actor.params].g, sShirtColors[this->actor.params].b, 255));
if (this->actor.params == 0) {
gSPSegment(POLY_OPA_DISP++, 0x09, EnSth_AllocColorDList(play->state.gfxCtx, 190, 110, 0, 255));