Skip to content

Commit

Permalink
Enhancement: MM-Style Static Explosion Radius (HarbourMasters#2322)
Browse files Browse the repository at this point in the history
* Adds Static Explosion Radius Enhancement

* Changed default value

* Update libultraship

* Update CVar Syntax

* Revert "Update libultraship"

This reverts commit d0e2435.
  • Loading branch information
splemb authored Jan 21, 2023
1 parent a58705e commit 643a982
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion soh/soh/Enhancements/presets.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ const std::vector<const char*> enhancementsCvars = {
"gBombchuBowlingNoBigCucco",
"gBombchuBowlingAmmunition",
"gCreditsFix",
"gSilverRupeeJingleExtend"
"gSilverRupeeJingleExtend",
"gStaticExplosionRadius"
};

const std::vector<const char*> randomizerCvars = {
Expand Down
2 changes: 2 additions & 0 deletions soh/soh/GameMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ namespace GameMenuBar {
UIWidgets::Tooltip("Makes nuts explode bombs, similar to how they interact with bombchus. This does not affect bombflowers.");
UIWidgets::PaddedEnhancementCheckbox("Equip Multiple Arrows at Once", "gSeparateArrows", true, false);
UIWidgets::Tooltip("Allow the bow and magic arrows to be equipped at the same time on different slots");
UIWidgets::PaddedEnhancementCheckbox("Static Explosion Radius", "gStaticExplosionRadius", true, false);
UIWidgets::Tooltip("Explosions are now a static size, like in Majora's Mask and OoT3D. Makes bombchu hovering much easier.");
ImGui::EndMenu();
}

Expand Down
7 changes: 6 additions & 1 deletion soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ void EnBom_Explode(EnBom* this, PlayState* play) {
func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96);
}

this->explosionCollider.elements[0].dim.worldSphere.radius += this->actor.shape.rot.z + 8;
if (CVarGetInteger("gStaticExplosionRadius", 0)) {
this->explosionCollider.elements[0].dim.worldSphere.radius = 40;
} else {
this->explosionCollider.elements[0].dim.worldSphere.radius += this->actor.shape.rot.z + 8;
}


if (this->actor.params == BOMB_EXPLOSION) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->explosionCollider.base);
Expand Down

0 comments on commit 643a982

Please sign in to comment.