Skip to content

Commit

Permalink
damage scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
ermaccer committed Feb 8, 2022
1 parent 9c9e31d commit cd475e0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
Binary file modified I2Hook/I2Hook.rc
Binary file not shown.
2 changes: 2 additions & 0 deletions I2Hook/code/PlayerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ void PlayerInfo::SetMeter(float value)

void PlayerInfo::SetDamageMult(float value)
{
*(float*)(this + 0x338) = value;
*(float*)(this + 0x338 + 4) = value;
}
13 changes: 13 additions & 0 deletions I2Hook/code/dcf2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ void __fastcall Hooks::HookProcessStuff()
if (TheMenu->m_bZeroMeterP1)
p1_info->SetMeter(0.0f);

if (TheMenu->m_bDisableComboScaling)
{
if (p1_info)
p1_info->SetDamageMult(1.0f);
}

if (TheMenu->m_bDisableHeadTracking)
p1->KillHeadTracking();

Expand Down Expand Up @@ -77,6 +83,13 @@ void __fastcall Hooks::HookProcessStuff()
HideHUD();
if (TheMenu->m_bDisableHeadTracking)
p2->KillHeadTracking();

if (TheMenu->m_bDisableComboScaling)
{
if (p2_info)
p2_info->SetDamageMult(1.0f);
}

if (TheMenu->m_bP1CustomAbilities)
{
TheMenu->m_nP2Abilities = 0;
Expand Down
8 changes: 7 additions & 1 deletion I2Hook/code/dcf2menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ void DCF2Menu::UpdateControls()
{
if (GetTickCount64() - timer <= 150) return;
timer = GetTickCount64();
m_bSlowMotion ^= 1;
TheMenu->m_bSlowMotion ^= 1;
if (TheMenu->m_bSlowMotion)
SlowGameTimeForXTicks(m_fSlowMotionSpeed, 0x7FFFFFFF);
else
SlowGameTimeForXTicks(1.0, 10);
}

if (GetAsyncKeyState(SettingsMgr->iToggleFreezeWorldKey))
Expand Down Expand Up @@ -852,6 +856,8 @@ void DCF2Menu::DrawMiscTab()
ImGui::Checkbox("Disable Head Tracking", &m_bDisableHeadTracking);
ImGui::SameLine();
ShowHelpMarker("Disables P1 head looking at P2. Automatically enabled with 'Head Perspective' custom camera.");

ImGui::Checkbox("Disable Combo Scaling", &m_bDisableComboScaling);
}

void DCF2Menu::DrawSettings()
Expand Down
2 changes: 2 additions & 0 deletions I2Hook/code/dcf2menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class DCF2Menu {
bool m_bPlayer1Modifier = false;
bool m_bPlayer2Modifier = false;

bool m_bDisableComboScaling = false;

float m_fSlowMotionSpeed = 0.5f;
float m_fP1Speed = 1.0f;
float m_fP2Speed = 1.0f;
Expand Down
2 changes: 0 additions & 2 deletions I2Hook/code/eSettingsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ void eSettingsManager::Init()
if (iFreeCameraKeyPitchMinus == 0xFF)
iFreeCameraKeyPitchMinus = ini.ReadInteger("Settings", "iFreeCameraKeyPitchMinus", 0);


CIniReader user("i2hook_user.ini");
fMenuScale = user.ReadFloat("MenuSettings", "fMenuScale", 1.0f);

if (fMenuScale < 1.0f)
Expand Down

0 comments on commit cd475e0

Please sign in to comment.