-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Minigame] Bombers Required for Hide-and-Seek (#980)
* Bombers Required * Changed to Minigames
- Loading branch information
1 parent
4304508
commit eec2be4
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <libultraship/bridge.h> | ||
#include "2s2h/GameInteractor/GameInteractor.h" | ||
#include "2s2h/ShipInit.hpp" | ||
|
||
extern "C" { | ||
#include "overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.h" | ||
void func_80C02CA4(EnBomjimb* thisx, PlayState* play); | ||
void func_80C02A14(EnBomjimb* thisx, PlayState* play); | ||
} | ||
|
||
#define CVAR_NAME "gEnhancements.Minigames.BombersHideAndSeek" | ||
#define CVAR CVarGetInteger(CVAR_NAME, 5) | ||
|
||
void RegisterBombersHideAndSeek() { | ||
COND_ID_HOOK(ShouldActorUpdate, ACTOR_EN_BOMJIMB, CVAR < 5, [](Actor* actor, bool* should) { | ||
EnBomjimb* bomberKids = (EnBomjimb*)actor; | ||
|
||
if (bomberKids->actionFunc != func_80C02A14) { | ||
return; | ||
} | ||
|
||
if (gSaveContext.save.saveInfo.bombersCaughtNum >= CVAR) { | ||
SET_WEEKEVENTREG(WEEKEVENTREG_76_01); | ||
SET_WEEKEVENTREG(WEEKEVENTREG_76_02); | ||
SET_WEEKEVENTREG(WEEKEVENTREG_76_04); | ||
SET_WEEKEVENTREG(WEEKEVENTREG_76_08); | ||
SET_WEEKEVENTREG(WEEKEVENTREG_76_10); | ||
func_80C02CA4(bomberKids, gPlayState); | ||
} | ||
}); | ||
} | ||
|
||
static RegisterShipInitFunc initFunc(RegisterBombersHideAndSeek, { CVAR_NAME }); |