Skip to content

Commit b356f40

Browse files
committed
design update, ai stuffs, run cheats
1 parent e5286b0 commit b356f40

9 files changed

+2958
-216
lines changed

MKXHook/MKXHook.rc

0 Bytes
Binary file not shown.

MKXHook/code/PlayerInfo.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,22 @@ void PlayerInfo::SetDamageMult(float value)
1212
*(float*)(this + 660) = value;
1313
}
1414

15+
void PlayerInfo::SetEnergy(float value)
16+
{
17+
((void(__fastcall*)(PlayerInfo*, float))_addr(0x14055DC50))(this, value);
18+
}
19+
1520
const char* PlayerInfo::GetName()
1621
{
1722
return ((const char* (__fastcall*)(PlayerInfo*))_addr(0x140553FF0))(this);
1823
}
24+
25+
AIDrone* PlayerInfo::GetDrone()
26+
{
27+
return ((AIDrone * (__fastcall*)(PlayerInfo*))_addr(0x140552530))(this);
28+
}
29+
30+
void AIDrone::Set(const char* script)
31+
{
32+
((void(__fastcall*)(AIDrone*, const char*))_addr(0x140140430))(this, script);
33+
}

MKXHook/code/PlayerInfo.h

+8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
#pragma once
22
#include "unreal/FName.h"
33

4+
class AIDrone {
5+
public:
6+
void Set(const char* script);
7+
};
8+
49
class PlayerInfo {
510
public:
611
void SetMeter(float value);
712
void SetDamageMult(float value);
13+
void SetEnergy(float value);
814
const char* GetName();
15+
16+
AIDrone* GetDrone();
917
};

MKXHook/code/mk10.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,17 @@ void __fastcall MK10Hooks::HookProcessStuff()
157157
if (TheMenu->m_bNoHealthP1) p1->SetLife(0.0f);
158158
if (TheMenu->m_bOneHealthP1) p1->SetLife(0.01f);
159159
if (TheMenu->m_bInfiniteMeterP1) p1_info->SetMeter(1.0f);
160+
if (TheMenu->m_bZeroMeterP1) p1_info->SetMeter(0.0f);
160161
if (TheMenu->m_bDisableHeadTracking) p1->KillHeadTracking();
162+
if (TheMenu->m_bInfiniteRunP1) p1_info->SetEnergy(100.0f);
163+
if (TheMenu->m_bNoRunP1) p1_info->SetEnergy(0.0f);
164+
165+
166+
if (TheMenu->m_bAIDroneModifierP1)
167+
{
168+
if (AIDrone* drone = p1_info->GetDrone())
169+
drone->Set(TheMenu->szPlayer1AI);
170+
}
161171

162172
if (TheMenu->m_bDisableComboScaling)
163173
{
@@ -181,6 +191,14 @@ void __fastcall MK10Hooks::HookProcessStuff()
181191
if (TheMenu->m_bOneHealthP2) p2->SetLife(0.01f);
182192
if (TheMenu->m_bInfiniteMeterP2) p2_info->SetMeter(1.0f);
183193
if (TheMenu->m_bDisableHeadTracking) p2->KillHeadTracking();
194+
if (TheMenu->m_bInfiniteRunP2) p2_info->SetEnergy(100.0f);
195+
if (TheMenu->m_bNoRunP2) p2_info->SetEnergy(0.0f);
196+
197+
if (TheMenu->m_bAIDroneModifierP2)
198+
{
199+
if (AIDrone* drone = p2_info->GetDrone())
200+
drone->Set(TheMenu->szPlayer2AI);
201+
}
184202

185203
if (TheMenu->m_bDisableComboScaling)
186204
{

MKXHook/code/mk10.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#define GFG_GAME_INFO 0x1430DBA00
99

10-
#define MKXHOOK_VERSION "0.6.0"
10+
#define MKXHOOK_VERSION "0.6.1"
1111

1212
const char* GetGameName();
1313
void SetCharacter(PLAYER_NUM plr, const char* character);

MKXHook/code/mk10menu.cpp

+90-8
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,18 @@ const char* szCameraModes[TOTAL_CUSTOM_CAMERAS] = {
228228
"Head Perspective"
229229
};
230230

231+
const char* szAI[] = {
232+
"AI_ButtonMasher.mko",
233+
"AI_DebugOnlineButtonMasher.mko",
234+
"AI_Dummy.mko",
235+
"AI_Flying.mko",
236+
"AI_Normal.mko",
237+
"AI_SingleMove.mko",
238+
"AI_Test.mko",
239+
"AI_Training.mko",
240+
"AI_Verifier.mko",
241+
};
242+
231243
int GetCamMode(const char* mode)
232244
{
233245
for (int i = 0; i < TOTAL_CUSTOM_CAMERAS; i++)
@@ -271,6 +283,8 @@ void MK10Menu::Initialize()
271283
sprintf(szPlayer2Trait, szTraits[0]);
272284
sprintf(szPlayer1Bone, szBones[0]);
273285
sprintf(szPlayer2Bone, szBones[0]);
286+
sprintf(szPlayer1AI, szAI[0]);
287+
sprintf(szPlayer2AI, szAI[0]);
274288
}
275289

276290
void MK10Menu::Process()
@@ -301,32 +315,32 @@ void MK10Menu::Draw()
301315

302316
if (ImGui::BeginTabBar("##tabs"))
303317
{
304-
if (ImGui::BeginTabItem("Character Modifier"))
318+
if (ImGui::BeginTabItem("Character"))
305319
{
306320
DrawCharacterTab();
307321
ImGui::EndTabItem();
308322
}
309-
if (ImGui::BeginTabItem("Variation Manager"))
323+
if (ImGui::BeginTabItem("Variation"))
310324
{
311325
DrawVariationsTab();
312326
ImGui::EndTabItem();
313327
}
314-
if (ImGui::BeginTabItem("Stage Modifier"))
328+
if (ImGui::BeginTabItem("Stage"))
315329
{
316330
DrawStageTab();
317331
ImGui::EndTabItem();
318332
}
319-
if (ImGui::BeginTabItem("Player Control"))
333+
if (ImGui::BeginTabItem("Player"))
320334
{
321335
DrawPlayerTab();
322336
ImGui::EndTabItem();
323337
}
324-
if (ImGui::BeginTabItem("Speed Modifier"))
338+
if (ImGui::BeginTabItem("Speed"))
325339
{
326340
DrawSpeedTab();
327341
ImGui::EndTabItem();
328342
}
329-
if (ImGui::BeginTabItem("Camera Control"))
343+
if (ImGui::BeginTabItem("Camera"))
330344
{
331345
DrawCameraTab();
332346
ImGui::EndTabItem();
@@ -341,6 +355,11 @@ void MK10Menu::Draw()
341355
DrawScriptTab();
342356
ImGui::EndTabItem();
343357
}
358+
if (ImGui::BeginTabItem("AI"))
359+
{
360+
DrawAITab();
361+
ImGui::EndTabItem();
362+
}
344363
if (ImGui::BeginTabItem("Misc."))
345364
{
346365
DrawMiscTab();
@@ -764,7 +783,6 @@ void MK10Menu::DrawCameraTab()
764783

765784
void MK10Menu::DrawCheatsTab()
766785
{
767-
ImGui::Separator();
768786
ImGui::Columns(2);
769787
ImGui::SetColumnWidth(0, 11.5f * ImGui::GetFontSize());
770788

@@ -798,9 +816,31 @@ void MK10Menu::DrawCheatsTab()
798816
ImGui::Checkbox("P2##super", &m_bInfiniteMeterP2);
799817
ImGui::NextColumn();
800818

819+
ImGui::Text("Zero Meter\n");
820+
ImGui::NextColumn();
821+
ImGui::Checkbox("P1##0super", &m_bZeroMeterP1);
822+
ImGui::SameLine();
823+
ImGui::Checkbox("P2##0super", &m_bZeroMeterP2);
824+
ImGui::NextColumn();
825+
826+
827+
ImGui::Text("Infinite Energy\n");
828+
ImGui::NextColumn();
829+
ImGui::Checkbox("P1##run", &m_bInfiniteRunP1);
830+
ImGui::SameLine();
831+
ImGui::Checkbox("P2##run", &m_bInfiniteRunP2);
832+
ImGui::NextColumn();
833+
834+
ImGui::Text("Zero Energy\n");
835+
ImGui::NextColumn();
836+
ImGui::Checkbox("P1##nrun", &m_bNoRunP1);
837+
ImGui::SameLine();
838+
ImGui::Checkbox("P2##nrun", &m_bNoRunP2);
839+
ImGui::NextColumn();
840+
801841
ImGui::Text("Freeze Timer\n");
802842
ImGui::NextColumn();
803-
ImGui::Checkbox("Enable##time", &m_bStopTimer);
843+
ImGui::Checkbox("##time", &m_bStopTimer);
804844
ImGui::NextColumn();
805845

806846
ImGui::Columns(1);
@@ -832,6 +872,11 @@ void MK10Menu::DrawMiscTab()
832872
Notifications->SetNotificationTime(5500);
833873
Notifications->PushNotification("Costumes should be unlocked now, check costumes list in select screen.");
834874
}
875+
else
876+
{
877+
Notifications->SetNotificationTime(3500);
878+
Notifications->PushNotification("Execute this option in the Crypt.");
879+
}
835880

836881
}
837882

@@ -912,6 +957,43 @@ void MK10Menu::DrawScriptTab()
912957
m_vKeyBinds.clear();
913958
}
914959

960+
void MK10Menu::DrawAITab()
961+
{
962+
ImGui::Checkbox("Change Player 1 AI", &m_bAIDroneModifierP1);
963+
964+
if (ImGui::BeginCombo("Player 1 AI", szPlayer1AI))
965+
{
966+
for (int n = 0; n < IM_ARRAYSIZE(szAI); n++)
967+
{
968+
bool is_selected = (szPlayer1AI == szAI[n]);
969+
if (ImGui::Selectable(szAI[n], is_selected))
970+
sprintf(szPlayer1AI, szAI[n]);
971+
if (is_selected)
972+
ImGui::SetItemDefaultFocus();
973+
974+
}
975+
ImGui::EndCombo();
976+
}
977+
978+
ImGui::Separator();
979+
ImGui::Checkbox("Change Player 2 AI", &m_bAIDroneModifierP2);
980+
981+
if (ImGui::BeginCombo("Player 2 AI", szPlayer2AI))
982+
{
983+
for (int n = 0; n < IM_ARRAYSIZE(szAI); n++)
984+
{
985+
bool is_selected = (szPlayer2AI == szAI[n]);
986+
if (ImGui::Selectable(szAI[n], is_selected))
987+
sprintf(szPlayer2AI, szAI[n]);
988+
if (is_selected)
989+
ImGui::SetItemDefaultFocus();
990+
991+
}
992+
ImGui::EndCombo();
993+
}
994+
ImGui::Separator();
995+
}
996+
915997
void MK10Menu::DrawSettings()
916998
{
917999
ImGui::SetNextWindowPos({ ImGui::GetIO().DisplaySize.x / 2.0f, ImGui::GetIO().DisplaySize.y / 2.0f }, ImGuiCond_Once, { 0.5f, 0.5f });

MKXHook/code/mk10menu.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,24 @@ class MK10Menu {
6262
bool m_bInfiniteHealthP2 = false;
6363
bool m_bInfiniteMeterP1 = false;
6464
bool m_bInfiniteMeterP2 = false;
65+
bool m_bZeroMeterP1 = false;
66+
bool m_bZeroMeterP2 = false;
6567
bool m_bNoHealthP1 = false;
6668
bool m_bNoHealthP2 = false;
6769
bool m_bOneHealthP1 = false;
6870
bool m_bOneHealthP2 = false;
69-
70-
71+
bool m_bInfiniteRunP1 = false;
72+
bool m_bInfiniteRunP2 = false;
73+
bool m_bNoRunP1 = false;
74+
bool m_bNoRunP2 = false;
7175
bool m_bChangePlayerSpeed = false;
7276
bool m_bChangePlayerScale = false;
7377
bool m_bPlayer1Modifier = false;
7478
bool m_bPlayer2Modifier = false;
7579
bool m_bPlayer1CustomTrait = false;
7680
bool m_bPlayer2CustomTrait = false;
81+
bool m_bAIDroneModifierP1 = false;
82+
bool m_bAIDroneModifierP2 = false;
7783

7884
bool m_bDisableComboScaling = false;
7985

@@ -117,6 +123,9 @@ class MK10Menu {
117123
char szPlayer2Trait[128] = {};
118124
char szPlayer1Bone[128] = {};
119125
char szPlayer2Bone[128] = {};
126+
char szPlayer1AI[128] = {};
127+
char szPlayer2AI[128] = {};
128+
120129

121130
void Initialize();
122131
void Process();
@@ -133,7 +142,7 @@ class MK10Menu {
133142
void DrawCheatsTab();
134143
void DrawMiscTab();
135144
void DrawScriptTab();
136-
145+
void DrawAITab();
137146

138147
void DrawSettings();
139148

MKXHook/eDirectX11Hook.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void eDirectX11Hook::ReloadImGuiFont()
106106
{
107107
if (!(SettingsMgr->fMenuScale < 1.0f))
108108
{
109-
float fontSize = 13.0f;
109+
float fontSize = 16.0f;
110110
ImGuiStyle * style = &ImGui::GetStyle();
111111
ImGuiIO io = ImGui::GetIO();
112112
io.Fonts->Clear();

0 commit comments

Comments
 (0)