mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
spicy
This commit is contained in:
parent
e7cae9bfd6
commit
867d7010cb
7 changed files with 85 additions and 24 deletions
|
@ -1,23 +0,0 @@
|
|||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
extern "C" {
|
||||
extern PlayState* gPlayState;
|
||||
#include "src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h"
|
||||
}
|
||||
|
||||
#define CVAR_NO_DAMPE_FIRE_NAME CVAR_CHEAT("NoDampeFire")
|
||||
#define CVAR_NO_DAMPE_FIRE_DEFAULT 0
|
||||
#define CVAR_NO_DAMPE_FIRE_VALUE CVarGetInteger(CVAR_NO_DAMPE_FIRE_NAME, CVAR_NO_DAMPE_FIRE_DEFAULT)
|
||||
|
||||
void OnHonoTrapInit(void* actor) {
|
||||
if (gPlayState->sceneNum == SCENE_WINDMILL_AND_DAMPES_GRAVE) {
|
||||
Actor_Kill((Actor*)actor);
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterNoDampeFire() {
|
||||
COND_ID_HOOK(OnActorInit, ACTOR_EN_HONOTRAP, CVAR_NO_DAMPE_FIRE_VALUE, OnHonoTrapInit);
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterNoDampeFire, { CVAR_NO_DAMPE_FIRE_NAME });
|
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,
|
||||
|
|
|
@ -331,6 +331,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, "Normal" },
|
||||
{ DAMPE_JALAPENO, "Jalapeño" },
|
||||
{ DAMPE_CHIPOTLE, "Chipotle" },
|
||||
{ DAMPE_SCOTCH_BONNET, "Scotch Bonnet" },
|
||||
{ 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)
|
||||
|
|
|
@ -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