From bf5e4a6fa654e9182b7d529d111976b94b0d61a2 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Fri, 17 Nov 2023 10:17:15 -0500 Subject: [PATCH] Cucco Lady hat --- cucco-lady-hat.patch | Bin 0 -> 5148 bytes .../object_festivehats/gCuccoLadyHatDL | 11 +++++ .../object_festivehats/gCuccoLadyHatDL_tri_0 | 31 +++++++++++++ .../object_festivehats/gCuccoLadyHatDL_vtx_0 | 43 ++++++++++++++++++ .../mat_gCuccoLadyHatDL_f3dlite_hatcolour | 12 +++++ soh/assets/soh_assets.h | 3 ++ soh/src/code/z_player_lib.c | 22 +++++++++ .../actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 17 ++++++- 8 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 cucco-lady-hat.patch create mode 100644 soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL create mode 100644 soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL_tri_0 create mode 100644 soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL_vtx_0 create mode 100644 soh/assets/custom/objects/object_festivehats/mat_gCuccoLadyHatDL_f3dlite_hatcolour diff --git a/cucco-lady-hat.patch b/cucco-lady-hat.patch new file mode 100644 index 0000000000000000000000000000000000000000..9e6b406a5c077a60d5260005a3039850a4a02e01 GIT binary patch literal 5148 zcmd6rX-^wh6o${|O8pNbB2}a=U?3rh+D38AQcD!0LRv*tG%~gUrv_KHS<+2b8V^ivq>S{c9Irr?__^&@3*0N(pVoQt@R(<9*Td|&X?38znS=l%k;PopwO2DPr3uZbI{sgV8@LNUB#J)$CIuHq~j%)e?tx5+c?A5Hz z{Df5#og~)fEh}6wt25WFnw|M>Vpq(2?A3YavDAUq$>{)2*aNOMJ30}jBkr`I*I*s^ z%yZk}{5^1Ww|daiBe&DBb1MuDI4y&v&gj@Km>c%NzT@4uP1cDmSjwo{q5a^qn^;%4 zl~GBtxuorb|B~6Mj{7=gD4@W)LiYLQbq1iLEl+}tyuH!nsae;P~Wf$({ zOXD7-8XY5c5|vB5a~4eO2;{ZOn&;TN>GeoiNnWnXqk7(9w}lrs*^%!zkf#ky$|D%b zmU82ieRUtIOd0ipjdS=7(CSCVJCBz)>epz#-6pC^MreYCFZbbw8i zznk_YxPBe%sz-_V)s^UO#ciwFqthMicFi5#Y9L3bXFB;2Ty=O0G9~P2sG9Y?s;M7Q z&S*oSX)(k8k<)?d`R%gp;|Z$mpF*ad%d1M~!TzhBn(d8+)?2>=n zO8GmXw^*DA^*Dz)-(6(5)x*ob%jjO+%#Q0?_L5ysc)FY}FxwrR^s&2o&?|Ojvm!jJ z9~$L4S}#%<_XTmTzG#(NFbzY*RK@cYJ1M?cfs1{f#i8FV*-N)=@W^F2mY0>0Lt2f} zM_i-t6UVpdR*0S)JyRZEMgF%?77wKy2dWIx!t@?+HvKaAtMH&$pPzIgGBRt&wc;z= zogQBW%il`K4#96H`K5SQmR6Q15y_!%$$M+a0Mj!_<_npX6t!8e74{XT=R_WEdQ^1 z##e_>pr2Z!SIGK>Pi4U<^9eqp$W>04^q0hF$91JlGdt3XgRB#BkABz4AIc!3y3Htt zT%mlXZ(!xNyHUC(yXm_;@yOiaD_r?U6?v05RX>oDH!D>2Lu#_V7Z<1aW6bi(RH|a? zfwCI<4hjA%8OkohF*Q`3SBgwUxP8sgy9n1Y=S|O|kw5)wa&sKmFG$k{o4z}wRjQG>=rGBv}@W@Lv SBx$3J%0xGNta;R*i1lyv7cmC_ literal 0 HcmV?d00001 diff --git a/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL b/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL new file mode 100644 index 000000000..ab8fdf45f --- /dev/null +++ b/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL_tri_0 b/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL_tri_0 new file mode 100644 index 000000000..980452845 --- /dev/null +++ b/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL_tri_0 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL_vtx_0 b/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL_vtx_0 new file mode 100644 index 000000000..8a64cdf18 --- /dev/null +++ b/soh/assets/custom/objects/object_festivehats/gCuccoLadyHatDL_vtx_0 @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_festivehats/mat_gCuccoLadyHatDL_f3dlite_hatcolour b/soh/assets/custom/objects/object_festivehats/mat_gCuccoLadyHatDL_f3dlite_hatcolour new file mode 100644 index 000000000..d1d036f89 --- /dev/null +++ b/soh/assets/custom/objects/object_festivehats/mat_gCuccoLadyHatDL_f3dlite_hatcolour @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/soh_assets.h b/soh/assets/soh_assets.h index b31e3f388..95a3ec1b3 100644 --- a/soh/assets/soh_assets.h +++ b/soh/assets/soh_assets.h @@ -8,6 +8,9 @@ // On Mac, not using aligned resource names was causing crashes in release builds // objects +#define dgCuccoLadyHatDL "__OTR__objects/object_festivehats/gCuccoLadyHatDL" +static const ALIGN_ASSET(2) char gCuccoLadyHatDL[] = dgCuccoLadyHatDL; + #define dgChristmasGreenTreasureChestFrontTex "__OTR__objects/object_box/gChristmasGreenTreasureChestFrontTex" static const ALIGN_ASSET(2) char gChristmasGreenTreasureChestFrontTex[] = dgChristmasGreenTreasureChestFrontTex; diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 820f2c672..4370e6338 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -10,6 +10,7 @@ #include "soh/Enhancements/randomizer/draw.h" #include +#include typedef struct { /* 0x00 */ u8 flag; @@ -1672,6 +1673,27 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Ve Matrix_MultVec3f(&sZeroVec, D_80160000); } + if (CVarGetInteger("gLetItSnow", 0)) { + if (limbIndex == PLAYER_LIMB_HEAD) { + OPEN_DISPS(play->state.gfxCtx); + + Matrix_Push(); + Matrix_RotateZYX(0, 0, -0x4000, MTXMODE_APPLY); + if (LINK_IS_ADULT) { + Matrix_Translate(200.0f, 0.0f, 0.0f, MTXMODE_APPLY); + } else { + Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY); + } + Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gCuccoLadyHatDL); + Matrix_Pop(); + + CLOSE_DISPS(play->state.gfxCtx); + } + } + if (limbIndex == PLAYER_LIMB_L_HAND) { MtxF sp14C; Actor* hookedActor; diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 8ddf52fad..ac720f6f6 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -4,6 +4,7 @@ #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "vt.h" #include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) @@ -601,6 +602,20 @@ s32 EnNiwLady_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3 return false; } +s32 EnNiwLady_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { + EnNiwLady* this = (EnNiwLady*)thisx; + + if (CVarGetInteger("gLetItSnow", 0)) { + if (limbIndex == 15) { + OPEN_DISPS(play->state.gfxCtx); + gSPDisplayList(POLY_OPA_DISP++, gCuccoLadyHatDL); + CLOSE_DISPS(play->state.gfxCtx); + } + } + + return false; +} + void EnNiwLady_Draw(Actor* thisx, PlayState* play) { static void* sEyeTextures[] = { gCuccoLadyEyeOpenTex, gCuccoLadyEyeHalfTex, gCuccoLadyEyeClosedTex }; EnNiwLady* this = (EnNiwLady*)thisx; @@ -612,7 +627,7 @@ void EnNiwLady_Draw(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[this->faceState])); gSPSegment(POLY_OPA_DISP++, 0x0C, func_80ABB0A0(play->state.gfxCtx)); - SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, EnNiwLady_OverrideLimbDraw, NULL, this); + SkelAnime_DrawSkeletonOpa(play, &this->skelAnime, EnNiwLady_OverrideLimbDraw, EnNiwLady_PostLimbDraw, this); } CLOSE_DISPS(play->state.gfxCtx); }