You've already forked Shipwright
mirror of
https://github.com/CraftyBoss/Shipwright.git
synced 2026-07-14 05:07:46 -07:00
Enemy rando cleanup 2 (#6365)
Move stuff to main file, delete header & refactor lists
This commit is contained in:
+394
-465
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship/libultra/types.h>
|
||||
#include "item-tables/ItemTableTypes.h"
|
||||
|
||||
#define RANDOMIZED_ENEMY_SPAWN_TABLE_SIZE 59
|
||||
|
||||
extern const char* enemyCVarList[];
|
||||
extern const char* enemyNameList[];
|
||||
extern void GetSelectedEnemies();
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <soh/Enhancements/game-interactor/GameInteractor.h>
|
||||
#include <soh/OTRGlobals.h>
|
||||
#include <soh/Enhancements/cosmetics/authenticGfxPatches.h>
|
||||
#include <soh/Enhancements/enemyrandomizer.h>
|
||||
#include <soh/Enhancements/TimeDisplay/TimeDisplay.h>
|
||||
|
||||
extern "C" {
|
||||
@@ -136,12 +135,6 @@ static const std::map<int32_t, const char*> mirroredWorldModes = {
|
||||
{ MIRRORED_WORLD_DUNGEONS_RANDOM_SEEDED, "Dungeons Random (Seeded)" },
|
||||
};
|
||||
|
||||
static const std::map<int32_t, const char*> enemyRandomizerModes = {
|
||||
{ ENEMY_RANDOMIZER_OFF, "Disabled" },
|
||||
{ ENEMY_RANDOMIZER_RANDOM, "Random" },
|
||||
{ ENEMY_RANDOMIZER_RANDOM_SEEDED, "Random (Seeded)" },
|
||||
};
|
||||
|
||||
void SohMenu::AddMenuEnhancements() {
|
||||
// Add Enhancements Menu
|
||||
AddMenuEntry("Enhancements", CVAR_SETTING("Menu.EnhancementsSidebarSection"));
|
||||
@@ -1684,52 +1677,6 @@ void SohMenu::AddMenuEnhancements() {
|
||||
.PreFunc(
|
||||
[](WidgetInfo& info) { info.isHidden = CVarGetInteger(CVAR_ENHANCEMENT("ExtraTraps.Enabled"), 0) == 0; });
|
||||
|
||||
path.column = SECTION_COLUMN_2;
|
||||
AddWidget(path, "Enemy Randomizer", WIDGET_CVAR_COMBOBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("RandomizedEnemies"))
|
||||
.Callback([](WidgetInfo& info) { GetSelectedEnemies(); })
|
||||
.Options(
|
||||
ComboboxOptions()
|
||||
.DefaultIndex(ENEMY_RANDOMIZER_OFF)
|
||||
.ComboMap(enemyRandomizerModes)
|
||||
.Tooltip("Replaces fixed enemies throughout the game with a random enemy. Bosses, Mini-Bosses and a "
|
||||
"few specific regular enemies are excluded.\n"
|
||||
"Enemies that need more than Deku Nuts & either Deku Sticks or a sword to kill are excluded "
|
||||
"from spawning in \"clear enemy\" rooms.\n\n"
|
||||
"- Random: Enemies are randomized every time you load a room.\n"
|
||||
"- Random (Seeded): Enemies are randomized based on the current randomizer seed/file."));
|
||||
AddWidget(path, "Randomized Enemy Sizes", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("RandomizedEnemySizes"))
|
||||
.Options(CheckboxOptions().Tooltip("Enemies and Bosses spawn with random sizes."));
|
||||
AddWidget(path, "Scale Health with Size", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("EnemySizeScalesHealth"))
|
||||
.PreFunc([](WidgetInfo& info) {
|
||||
info.options->disabled = !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemySizes"), 0);
|
||||
})
|
||||
.Options(CheckboxOptions().Tooltip(
|
||||
"Scales normal enemies Health with their randomized size. *This will NOT affect Bosses!*"));
|
||||
AddWidget(path, "Enemy List", WIDGET_SEPARATOR_TEXT).PreFunc([](WidgetInfo& info) {
|
||||
info.isHidden = !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0);
|
||||
});
|
||||
AddWidget(path, "Select all Enemies", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("RandomizedEnemyList.All"))
|
||||
.PreFunc([](WidgetInfo& info) { info.isHidden = !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0); })
|
||||
.Callback([](WidgetInfo& info) { GetSelectedEnemies(); });
|
||||
AddWidget(path, "Enemy List", WIDGET_SEPARATOR).PreFunc([](WidgetInfo& info) {
|
||||
info.isHidden = !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0);
|
||||
});
|
||||
for (int i = 0; i < RANDOMIZED_ENEMY_SPAWN_TABLE_SIZE; i++) {
|
||||
AddWidget(path, enemyNameList[i], WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(enemyCVarList[i])
|
||||
.Options(CheckboxOptions().DefaultValue(true))
|
||||
.PreFunc([](WidgetInfo& info) {
|
||||
info.isHidden = !CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0);
|
||||
info.options->disabled = CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemyList.All"), 0);
|
||||
info.options->disabledTooltip = "These options are disabled because \"Select All Enemies\" is enabled.";
|
||||
})
|
||||
.Callback([](WidgetInfo& info) { GetSelectedEnemies(); });
|
||||
}
|
||||
|
||||
// Cheats
|
||||
path.sidebarName = "Cheats";
|
||||
AddSidebarEntry("Enhancements", path.sidebarName, 3);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "soh/ObjectExtension/ActorListIndex.h"
|
||||
#include "soh/frame_interpolation.h"
|
||||
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
|
||||
#include "soh/Enhancements/enemyrandomizer.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/Enhancements/nametag.h"
|
||||
|
||||
Reference in New Issue
Block a user