diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 587e17e9be2..e5f2533769b 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -851,6 +851,12 @@ namespace SohImGui { EnhancementSliderInt("Text Speed: %dx", "##TEXTSPEED", "gTextSpeed", 1, 5, ""); EnhancementSliderInt("King Zora Speed: %dx", "##WEEPSPEED", "gMweepSpeed", 1, 5, ""); EnhancementSliderInt("Vine/Ladder Climb speed +%d", "##CLIMBSPEED", "gClimbSpeed", 0, 12, ""); + EnhancementSliderInt("Damage Multiplier %dx", "##DAMAGEMUL", "gDamageMul", 1, 4, ""); + Tooltip("Modifies all sources of damage not affected by other sliders"); + EnhancementSliderInt("Fall Damage Multiplier %dx", "##FALLDAMAGEMUL", "gFallDamageMul", 1, 4, ""); + Tooltip("Modifies all fall damage"); + EnhancementSliderInt("Void Damage Multiplier %dx", "##VOIDDAMAGEMUL", "gVoidDamageMul", 1, 4, ""); + Tooltip("Modifies all void out damage"); EnhancementCheckbox("Skip Text", "gSkipText"); Tooltip("Holding down B skips text"); diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index cf1736cb935..a7fc2939138 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -351,6 +351,7 @@ s32 func_80852F38(GlobalContext* globalCtx, Player* this); s32 func_80852FFC(GlobalContext* globalCtx, Actor* actor, s32 csMode); void func_80853080(Player* this, GlobalContext* globalCtx); s32 Player_InflictDamage(GlobalContext* globalCtx, s32 damage); +s32 Player_InflictDamageModified(GlobalContext* globalCtx, s32 damage, u8 modified); void func_80853148(GlobalContext* globalCtx, Actor* actor); // .bss part 1 @@ -3516,12 +3517,22 @@ void func_80837AFC(Player* this, s32 timer) { this->unk_88F = 0; } -s32 func_80837B18(GlobalContext* globalCtx, Player* this, s32 damage) { +s32 func_80837B18_modified(GlobalContext* globalCtx, Player* this, s32 damage, u8 modified) { if ((this->invincibilityTimer != 0) || (this->actor.category != ACTORCAT_PLAYER)) { return 1; } - return Health_ChangeBy(globalCtx, damage); + s32 modifiedDamage = damage; + if (modified) + { + modifiedDamage *= CVar_GetS32("gDamageMul", 1); + } + + return Health_ChangeBy(globalCtx, modifiedDamage); +} + +s32 func_80837B18(GlobalContext* globalCtx, Player* this, s32 damage) { + return func_80837B18_modified(globalCtx, this, damage, true); } void func_80837B60(Player* this) { @@ -3747,7 +3758,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { if (this->unk_A86 != 0) { if (!Player_InBlockingCsMode(globalCtx, this)) { - Player_InflictDamage(globalCtx, -16); + Player_InflictDamageModified(globalCtx, -16 * CVar_GetS32("gVoidDamageMul", 1), false); this->unk_A86 = 0; } } @@ -8279,7 +8290,7 @@ s32 func_80843E64(GlobalContext* globalCtx, Player* this) { impactInfo = &D_80854600[impactIndex]; - if (Player_InflictDamage(globalCtx, impactInfo->damage)) { + if (Player_InflictDamageModified(globalCtx, impactInfo->damage * CVar_GetS32("gFallDamageMul", 1), false)) { return -1; } @@ -14829,9 +14840,13 @@ void func_80853080(Player* this, GlobalContext* globalCtx) { } s32 Player_InflictDamage(GlobalContext* globalCtx, s32 damage) { + return Player_InflictDamageModified(globalCtx, damage, true); +} + +s32 Player_InflictDamageModified(GlobalContext* globalCtx, s32 damage, u8 modified) { Player* this = GET_PLAYER(globalCtx); - if (!Player_InBlockingCsMode(globalCtx, this) && !func_80837B18(globalCtx, this, damage)) { + if (!Player_InBlockingCsMode(globalCtx, this) && !func_80837B18_modified(globalCtx, this, damage, modified)) { this->stateFlags2 &= ~PLAYER_STATE2_7; return 1; }