Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Convert ocarina buttons & skip scarecrow song to VB

* Move most of boss rush & rupee/key counters to VB

* Move BossRush_HandleCompleteBoss to VB

* Convert boss timestamps to VB

* Move being able to open doors to VB

* Convert Entrance_OverrideWeatherState to VB

* Move boss souls to hook_handlers.cpp

* Update hook_handlers.cpp

* Move infinite upgrades to hook_handlers.cpp

* Move skeleton key to hook_handlers.cpp

* Move swim and child wallet to hook_handlers.cpp

* Move ganons boss key to hook_handlers.cpp

* Move triforce hunt to hook_handlers.cpp

* Move randomizer sheik spawn to hook_handlers.cpp

* Update BossRush.h

* Convert spoiling items to VB

* Move load game stuff to hook_handlers.cpp

* Move warp song handling to hook_handlers.cpp

* Convert being able to play bowling to VB

* Move shooting gallery man handling to hook_handlers.cpp

* Move spirit temple silver block removal to hook_handlers.cpp

* Fix build

* Move last beehive stuff to hook_handlers.cpp

* Fix build

* Add VB_CLOSE_PAUSE_MENU

* Add VB_BE_ABLE_TO_SAVE

* Add VB_RENDER_YES_ON_CONTINUE_PROMPT

* Add VB_SPAWN_BLUE_WARP

* Add VB_BLUE_WARP_ADULT_WARP_OUT

* Add VB_BG_BREAKWALL_BREAK

* Convert Saria stuff to VB

* Remove now unused check

* Add VB_GANON_HEAL_BEFORE_FIGHT

* Update hook_handlers.cpp

* Fix blue warp offsets

* Fixes from review

* Improve documentation

* Update BossRush.cpp

* Fix my stupidity

* Fix HarbourMasters#4327

* Update hook_handlers.cpp

* Fix blue warps

* Use ultralib types & clean header

* Replace options amount macro with BR_OPTIONS_MAX

* Remove unused includes

* Remove accidental line doubling

* Tweaks to boss rush (#6)

* Update GameInteractor_HookTable.h

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
  • Loading branch information
Pepe20129 and garrettjoecox authored Oct 7, 2024
1 parent 7450cee commit 2822dfc
Show file tree
Hide file tree
Showing 45 changed files with 958 additions and 616 deletions.
2 changes: 1 addition & 1 deletion soh/include/z64save.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ typedef struct {
/* */ u16 pendingSaleMod;
/* */ uint8_t questId;
/* */ uint32_t isBossRushPaused;
/* */ uint8_t bossRushOptions[BOSSRUSH_OPTIONS_AMOUNT];
/* */ uint8_t bossRushOptions[BR_OPTIONS_MAX];
/* */ u8 pendingIceTrapCount;
/* */ SohStats sohStats;
/* */ FaroresWindData backupFW;
Expand Down
306 changes: 264 additions & 42 deletions soh/soh/Enhancements/boss-rush/BossRush.cpp

Large diffs are not rendered by default.

18 changes: 7 additions & 11 deletions soh/soh/Enhancements/boss-rush/BossRush.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
#pragma once

#include "BossRushTypes.h"
#include "variables.h"
#include "z64.h"

#ifdef __cplusplus
extern "C" {
#endif
void BossRush_SpawnBlueWarps(PlayState* play);
void BossRush_HandleBlueWarp(PlayState* play, f32 warpPosX, f32 warpPosZ);
void BossRush_HandleBlueWarpHeal(PlayState* play);
void BossRush_InitSave();
void BossRush_SetEquipment(uint8_t linkAge);
void BossRush_HandleCompleteBoss(PlayState* play);
const char* BossRush_GetSettingName(uint8_t optionIndex, uint8_t language);
const char* BossRush_GetSettingChoiceName(uint8_t optionIndex, uint8_t choiceIndex, uint8_t language);
uint8_t BossRush_GetSettingOptionsAmount(uint8_t optionIndex);
void BossRush_HandleBlueWarpHeal(PlayState* play);
void BossRush_InitSave();
const char* BossRush_GetSettingName(u8 optionIndex, u8 language);
const char* BossRush_GetSettingChoiceName(u8 optionIndex, u8 choiceIndex, u8 language);
u8 BossRush_GetSettingOptionsAmount(u8 optionIndex);
void BossRush_RegisterHooks();
#ifdef __cplusplus
};
#endif
4 changes: 2 additions & 2 deletions soh/soh/Enhancements/boss-rush/BossRushTypes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#define BOSSRUSH_OPTIONS_AMOUNT 12
#define BOSSRUSH_MAX_OPTIONS_ON_SCREEN 6

typedef enum {
Expand All @@ -15,7 +14,8 @@ typedef enum {
BR_OPTIONS_LONGSHOT,
BR_OPTIONS_HOVERBOOTS,
BR_OPTIONS_BUNNYHOOD,
BR_OPTIONS_TIMER
BR_OPTIONS_TIMER,
BR_OPTIONS_MAX,
} BossRushOptionEnums;

typedef enum {
Expand Down
40 changes: 40 additions & 0 deletions soh/soh/Enhancements/game-interactor/GameInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,46 @@ typedef enum {
```
*/
VB_DRAW_AMMO_COUNT,
// Vanilla condition: true
VB_HAVE_OCARINA_NOTE_D4,
// Vanilla condition: true
VB_HAVE_OCARINA_NOTE_D5,
// Vanilla condition: true
VB_HAVE_OCARINA_NOTE_F4,
// Vanilla condition: true
VB_HAVE_OCARINA_NOTE_B4,
// Vanilla condition: true
VB_HAVE_OCARINA_NOTE_A4,
// Vanilla condition: false
VB_SKIP_SCARECROWS_SONG,
// Vanilla condition: true
VB_RENDER_RUPEE_COUNTER,
// Vanilla condition: true
VB_RENDER_KEY_COUNTER,
// Vanilla condition: true
VB_SPAWN_HEART_CONTAINER,
// Vanilla condition: true
VB_BE_ABLE_TO_OPEN_DOORS,
// Vanilla condition: true
VB_REVERT_SPOILING_ITEMS,
// Vanilla condition: Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) || BREG(2)
VB_BE_ABLE_TO_PLAY_BOMBCHU_BOWLING,
// Vanilla condition: true
VB_BE_ABLE_TO_SAVE,
// Vanilla condition: true
VB_TRANSITION_TO_SAVE_SCREEN_ON_DEATH,
// Vanilla condition: true
VB_RENDER_YES_ON_CONTINUE_PROMPT,
// Vanilla condition: CHECK_BTN_ALL(input->press.button, BTN_START)
VB_CLOSE_PAUSE_MENU,
// Vanilla condition: true
VB_SPAWN_BLUE_WARP,
// Vanilla condition: this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == 0xFFEF
VB_BLUE_WARP_APPLY_ENTRANCE_AND_CUTSCENE,
// Vanilla condition: this->collider.base.acFlags & 2
VB_BG_BREAKWALL_BREAK,
// Vanilla condition: true
VB_GANON_HEAL_BEFORE_FIGHT,
VB_FREEZE_LINK_FOR_BLOCK_THROW,
VB_MOVE_THROWN_ACTOR,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DEFINE_HOOK(OnActorInit, (void* actor));
DEFINE_HOOK(OnActorUpdate, (void* actor));
DEFINE_HOOK(OnActorKill, (void* actor));
DEFINE_HOOK(OnEnemyDefeat, (void* actor));
DEFINE_HOOK(OnBossDefeat, (void* actor));
DEFINE_HOOK(OnPlayerBonk, ());
DEFINE_HOOK(OnPlayDestroy, ());
DEFINE_HOOK(OnPlayDrawEnd, ());
Expand Down
7 changes: 7 additions & 0 deletions soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ void GameInteractor_ExecuteOnEnemyDefeat(void* actor) {
GameInteractor::Instance->ExecuteHooksForFilter<GameInteractor::OnEnemyDefeat>(actor);
}

void GameInteractor_ExecuteOnBossDefeat(void* actor) {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnBossDefeat>(actor);
GameInteractor::Instance->ExecuteHooksForID<GameInteractor::OnBossDefeat>(((Actor*)actor)->id, actor);
GameInteractor::Instance->ExecuteHooksForPtr<GameInteractor::OnBossDefeat>((uintptr_t)actor, actor);
GameInteractor::Instance->ExecuteHooksForFilter<GameInteractor::OnBossDefeat>(actor);
}

void GameInteractor_ExecuteOnPlayerBonk() {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnPlayerBonk>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void GameInteractor_ExecuteOnActorInit(void* actor);
void GameInteractor_ExecuteOnActorUpdate(void* actor);
void GameInteractor_ExecuteOnActorKill(void* actor);
void GameInteractor_ExecuteOnEnemyDefeat(void* actor);
void GameInteractor_ExecuteOnBossDefeat(void* actor);
void GameInteractor_ExecuteOnPlayerBonk();
void GameInteractor_ExecuteOnOcarinaSongAction();
void GameInteractor_ExecuteOnShopSlotChangeHooks(uint8_t cursorIndex, int16_t price);
Expand Down
Loading

0 comments on commit 2822dfc

Please sign in to comment.