Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions mm/2s2h/BenGui/BenMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ static const std::unordered_map<int32_t, const char*> damageMultiplierOptions =
{ 0, "1x" }, { 1, "2x" }, { 2, "4x" }, { 3, "8x" }, { 4, "16x" }, { 10, "1 Hit KO" },
};

static const std::vector<const char*> disableMagicDropsOptions = {
"Off",
"Recovery Heart",
"Green Rupee",
Comment on lines +164 to +166
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Off",
"Recovery Heart",
"Green Rupee",
"Off", // DISABLE_MAGIC_DROPS_OFF
"Recovery Heart", // DISABLE_MAGIC_DROPS_RECOVERY_HEART,
"Green Rupee", // DISABLE_MAGIC_DROPS_GREEN_RUPEE

};

namespace BenGui {
extern std::shared_ptr<BenMenu> mBenMenu;
void FreeLookPitchMinMax() {
Expand Down Expand Up @@ -1112,6 +1118,12 @@ void BenMenu::AddEnhancements() {
AddWidget(path, "Oceanside wallet any day", WIDGET_CVAR_CHECKBOX)
.CVar("gEnhancements.Cycle.OceansideWalletAnyDay")
.Options(CheckboxOptions().Tooltip("Allows the wallet reward to be collected on any day."));
AddWidget(path, "Disable Magic Drops with Chateau Romani", WIDGET_CVAR_COMBOBOX)
.CVar("gEnhancements.Cycle.DisableMagicDropsWithChateau")
.Options(ComboboxOptions()
.Tooltip("When Chateau Romani is active, Magic Jar drops are replaced.")
.DefaultIndex(DisableMagicDropsOptions::DISABLE_MAGIC_DROPS_OFF)
.ComboVec(&disableMagicDropsOptions));
AddWidget(path, "Unstable", WIDGET_SEPARATOR_TEXT).Options(WidgetOptions().Color(Colors::Orange));
AddWidget(path, "Disable Save Delay", WIDGET_CVAR_CHECKBOX)
.CVar("gEnhancements.Saving.DisableSaveDelay")
Expand Down
27 changes: 27 additions & 0 deletions mm/2s2h/Enhancements/Cycle/DisableMagicDropsWithChateau.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <libultraship/bridge/consolevariablebridge.h>
#include "2s2h/GameInteractor/GameInteractor.h"
#include "2s2h/ShipInit.hpp"
#include "2s2h/Enhancements/Enhancements.h"

#define CVAR_NAME "gEnhancements.Cycle.DisableMagicDropsWithChateau"
#define CVAR CVarGetInteger(CVAR_NAME, DISABLE_MAGIC_DROPS_OFF)

void RegisterDisableMagicDropsWithChateau() {
COND_VB_SHOULD(VB_ITEM00_GET_DROP_ID, CVAR != DISABLE_MAGIC_DROPS_OFF, {
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_DRANK_CHATEAU_ROMANI)) {
return;
}

s16* dropId = va_arg(args, s16*);

if (*dropId == ITEM00_MAGIC_JAR_SMALL || *dropId == ITEM00_MAGIC_JAR_BIG) {
if (CVAR == DISABLE_MAGIC_DROPS_RECOVERY_HEART) {
*dropId = ITEM00_RECOVERY_HEART;
} else if (CVAR == DISABLE_MAGIC_DROPS_GREEN_RUPEE) {
*dropId = ITEM00_RUPEE_GREEN;
}
}
});
}

static RegisterShipInitFunc initFunc(RegisterDisableMagicDropsWithChateau, { CVAR_NAME });
6 changes: 6 additions & 0 deletions mm/2s2h/Enhancements/Enhancements.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ enum GoronRaceDifficultyOptions {
GORON_RACE_DIFFICULTY_SKIP,
};

enum DisableMagicDropsOptions {
DISABLE_MAGIC_DROPS_OFF,
DISABLE_MAGIC_DROPS_RECOVERY_HEART,
DISABLE_MAGIC_DROPS_GREEN_RUPEE,
};

// Old Entry Point
void InitEnhancements();

Expand Down
8 changes: 8 additions & 0 deletions mm/2s2h/GameInteractor/GameInteractor_VanillaBehavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,14 @@ typedef enum {
// - `*EnFu`
VB_HONEY_AND_DARLING_MINIGAME_FINISH,

// #### `result`
// ```c
// dropId
// ```
// #### `args`
// - `s16*` (dropId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// - `s16*` (dropId)
// - `*s16` (dropId)

VB_ITEM00_GET_DROP_ID,

// #### `result`
// ```c
// !gPlayerFormItemRestrictions[GET_PLAYER_FORM][itemId]
Expand Down
2 changes: 2 additions & 0 deletions mm/src/code/z_en_item00.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,8 @@ void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) {
}

s16 func_800A7650(s16 dropId) {
GameInteractor_Should(VB_ITEM00_GET_DROP_ID, true, &dropId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I know you're not directly pre-empting vanilla behavior in the enhancement, maybe this should wrap everything before the final return.


if ((((dropId == ITEM00_BOMBS_A) || (dropId == ITEM00_BOMBS_0) || (dropId == ITEM00_BOMBS_B)) &&
(INV_CONTENT(ITEM_BOMB) == ITEM_NONE)) ||
(((dropId == ITEM00_ARROWS_10) || (dropId == ITEM00_ARROWS_30) || (dropId == ITEM00_ARROWS_40) ||
Expand Down
Loading