mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-16 10:02:59 -07:00
parent
24013e2e5c
commit
ca32dfd246
6 changed files with 88 additions and 1 deletions
48
soh/soh/Enhancements/DampeFire.cpp
Normal file
48
soh/soh/Enhancements/DampeFire.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
#include "soh/Enhancements/enhancementTypes.h"
|
||||
|
||||
extern "C" {
|
||||
extern PlayState* gPlayState;
|
||||
#include "src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h"
|
||||
}
|
||||
|
||||
void RegisterDampeFire() {
|
||||
COND_VB_SHOULD(VB_DAMPE_DROP_FLAME, CVarGetInteger(CVAR_ENHANCEMENT("DampeDropRate"), DAMPE_NORMAL) != DAMPE_NORMAL,
|
||||
{
|
||||
double chance;
|
||||
int cooldown = 9;
|
||||
switch (CVarGetInteger(CVAR_ENHANCEMENT("DampeDropRate"), DAMPE_NORMAL)) {
|
||||
case DAMPE_NONE:
|
||||
*should = false;
|
||||
return;
|
||||
default:
|
||||
case DAMPE_NORMAL:
|
||||
return;
|
||||
case DAMPE_JALAPENO:
|
||||
chance = 0.03;
|
||||
break;
|
||||
case DAMPE_CHIPOTLE:
|
||||
chance = 0.1;
|
||||
break;
|
||||
case DAMPE_SCOTCH_BONNET:
|
||||
chance = 0.2;
|
||||
break;
|
||||
case DAMPE_GHOST_PEPPER:
|
||||
chance = 0.5;
|
||||
cooldown = 4;
|
||||
break;
|
||||
case DAMPE_INFERNO:
|
||||
*should = true;
|
||||
return;
|
||||
}
|
||||
|
||||
EnPoRelay* actor = va_arg(args, EnPoRelay*);
|
||||
if (actor->actionTimer > cooldown) {
|
||||
actor->actionTimer = cooldown;
|
||||
}
|
||||
*should = actor->actionTimer == 0 && Rand_ZeroOne() < chance;
|
||||
});
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterDampeFire, { CVAR_ENHANCEMENT("DampeDropRate") });
|
|
@ -87,6 +87,16 @@ typedef enum {
|
|||
DAMAGE_OHKO
|
||||
} DamageMultType;
|
||||
|
||||
typedef enum {
|
||||
DAMPE_NONE,
|
||||
DAMPE_NORMAL,
|
||||
DAMPE_JALAPENO,
|
||||
DAMPE_CHIPOTLE,
|
||||
DAMPE_SCOTCH_BONNET,
|
||||
DAMPE_GHOST_PEPPER,
|
||||
DAMPE_INFERNO,
|
||||
} DampeDropRate;
|
||||
|
||||
typedef enum {
|
||||
DEKU_STICK_NORMAL,
|
||||
DEKU_STICK_UNBREAKABLE,
|
||||
|
|
|
@ -339,6 +339,14 @@ typedef enum {
|
|||
// - None
|
||||
VB_CRAWL_SPEED_INCREASE,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// this->actionTimer == 0 && Rand_ZeroOne() < 0.03f
|
||||
// ```
|
||||
// #### `args`
|
||||
// - `*EnPoRelay`
|
||||
VB_DAMPE_DROP_FLAME,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// !Flags_GetItemGetInf(ITEMGETINF_1C)
|
||||
|
|
|
@ -135,6 +135,16 @@ static const std::unordered_map<int32_t, const char*> bonkDamageValues = {
|
|||
{ BONK_DAMAGE_8_HEARTS, "8 Hearts" }, { BONK_DAMAGE_OHKO, "OHKO" },
|
||||
};
|
||||
|
||||
static const std::unordered_map<int32_t, const char*> dampeDropRates = {
|
||||
{ DAMPE_NONE, "None" },
|
||||
{ DAMPE_NORMAL, "Vanilla" },
|
||||
{ DAMPE_JALAPENO, "Jalapeño" },
|
||||
{ DAMPE_CHIPOTLE, "Serrano" },
|
||||
{ DAMPE_SCOTCH_BONNET, "Habanero" },
|
||||
{ DAMPE_GHOST_PEPPER, "Ghost Pepper" },
|
||||
{ DAMPE_INFERNO, "Dampe's Inferno" },
|
||||
};
|
||||
|
||||
static const std::unordered_map<int32_t, const char*> cursorAnywhereValues = {
|
||||
{ PAUSE_ANY_CURSOR_RANDO_ONLY, "Only in Rando" },
|
||||
{ PAUSE_ANY_CURSOR_ALWAYS_ON, "Always" },
|
||||
|
|
|
@ -1150,6 +1150,12 @@ void SohMenu::AddMenuEnhancements() {
|
|||
.CVar(CVAR_ENHANCEMENT("TreesDropSticks"))
|
||||
.Options(CheckboxOptions().Tooltip(
|
||||
"Bonking into Trees will have a chance to drop up to 3 Sticks. Must have obtained sticks previously."));
|
||||
AddWidget(path, "Dampe Drop Rate", WIDGET_CVAR_COMBOBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("DampeDropRate"))
|
||||
.Options(ComboboxOptions()
|
||||
.ComboMap(dampeDropRates)
|
||||
.DefaultIndex(DAMPE_NORMAL)
|
||||
.Tooltip("Adjusts rate Dampe drops flames during race."));
|
||||
|
||||
AddWidget(path, "Miscellaneous", WIDGET_SEPARATOR_TEXT);
|
||||
AddWidget(path, "Delete File on Death", WIDGET_CVAR_CHECKBOX)
|
||||
|
@ -1615,6 +1621,9 @@ void SohMenu::AddMenuEnhancements() {
|
|||
.Options(CheckboxOptions().Tooltip(
|
||||
"Keese and Guay no longer target you and simply ignore you as if you were wearing the "
|
||||
"Skull Mask."));
|
||||
AddWidget(path, "No Dampe Fire", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_CHEAT("NoDampeFire"))
|
||||
.Options(CheckboxOptions().Tooltip("Dampe won't drop fireballs during race."));
|
||||
|
||||
AddWidget(path, "Glitch Aids", WIDGET_SEPARATOR_TEXT);
|
||||
AddWidget(path, "Easy Frame Advancing with Pause", WIDGET_CVAR_CHECKBOX)
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h"
|
||||
#include "objects/object_tk/object_tk.h"
|
||||
#include "soh/ResourceManagerHelpers.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
#define FLAGS \
|
||||
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
|
||||
|
@ -197,7 +199,7 @@ void EnPoRelay_Race(EnPoRelay* this, PlayState* play) {
|
|||
if (this->actionTimer != 0) {
|
||||
this->actionTimer--;
|
||||
}
|
||||
if (this->actionTimer == 0 && Rand_ZeroOne() < 0.03f) {
|
||||
if (GameInteractor_Should(VB_DAMPE_DROP_FLAME, this->actionTimer == 0 && Rand_ZeroOne() < 0.03f, this)) {
|
||||
this->actionTimer = 32;
|
||||
if (this->pathIndex < 23) {
|
||||
speed = Rand_ZeroOne() * 3.0f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue