diff options
| author | Garrett Cox <garrettjcox@gmail.com> | 2026-07-08 00:37:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-08 00:37:39 -0500 |
| commit | c20da56bd444a16053a868f4286522cd01fb0d8f (patch) | |
| tree | dc4136044070ffc367c2ea7052020ac240c185b2 | |
| parent | 2188b01ac1409c495c317719b68378fb66405597 (diff) | |
| parent | 29dfc79080839c6c507d36bdfe58011e178e7c84 (diff) | |
Merge pull request #1769 from garrettjoecox/souls-grayscale
Grayscale enemies that you're missing a soul for
| -rw-r--r-- | mm/2s2h/Rando/ActorBehavior/Souls.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mm/2s2h/Rando/ActorBehavior/Souls.cpp b/mm/2s2h/Rando/ActorBehavior/Souls.cpp index f1b58b94b..31ef420b6 100644 --- a/mm/2s2h/Rando/ActorBehavior/Souls.cpp +++ b/mm/2s2h/Rando/ActorBehavior/Souls.cpp @@ -3,6 +3,7 @@ #include <libultraship/bridge/consolevariablebridge.h> #include "Rando/DrawFuncs.h" #include "Rando/Logic/Logic.h" +#include "2s2h/Enhancements/FrameInterpolation/FrameInterpolation.h" extern "C" { #include "variables.h" @@ -11,6 +12,7 @@ extern "C" { #include "overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h" void BossHakugin_DrawIce(BossHakugin*, PlayState*); +extern PlayState* gPlayState; } bool shouldMajoraRegister() { @@ -122,6 +124,17 @@ void ShouldActorDraw(Actor* actor, bool* should, RandoInf randoInf) { } } +void SetEnemyInjureGrayscale(bool enable) { + OPEN_DISPS(gPlayState->state.gfxCtx); + if (enable) { + gDPSetGrayscaleColor(POLY_OPA_DISP++, 70, 70, 70, 255); + gDPSetGrayscaleColor(POLY_XLU_DISP++, 70, 70, 70, 255); + } + gSPGrayscale(POLY_OPA_DISP++, enable); + gSPGrayscale(POLY_XLU_DISP++, enable); + CLOSE_DISPS(gPlayState->state.gfxCtx); +} + void Rando::ActorBehavior::InitSoulsBehavior() { bool shouldBossRegister = IS_RANDO && RANDO_SAVE_OPTIONS[RO_SHUFFLE_BOSS_SOULS] == RO_GENERIC_YES; bool shouldEnemyInjure = IS_RANDO && RANDO_SAVE_OPTIONS[RO_SHUFFLE_ENEMY_SOULS] == RO_GENERIC_YES; @@ -201,4 +214,18 @@ void Rando::ActorBehavior::InitSoulsBehavior() { *should = false; } }); + + COND_HOOK(ShouldActorDraw, shouldEnemyInjure, [](Actor* actor, bool* should) { + ActorId actorId = (ActorId)actor->id; + if (actorId != ACTOR_EN_INVADEPOH && !HaveEnemySoul(actorId)) { + SetEnemyInjureGrayscale(true); + } + }); + + COND_HOOK(OnActorDraw, shouldEnemyInjure, [](Actor* actor) { + ActorId actorId = (ActorId)actor->id; + if (actorId != ACTOR_EN_INVADEPOH && !HaveEnemySoul(actorId)) { + SetEnemyInjureGrayscale(false); + } + }); } |
