This commit is contained in:
LHY1339
2025-11-16 15:27:35 +08:00
parent c6330a9ce7
commit 0149b2bba2
16 changed files with 679 additions and 29 deletions
+6 -3
View File
@@ -10,6 +10,7 @@
#include "visual.h"
#include "gui.h"
#include "player.h"
#include "gdefine.h"
#pragma warning(disable:4996)
@@ -23,8 +24,10 @@ void cheat::main()
void cheat::console()
{
AllocConsole();
FILE* value = freopen("CONOUT$", "w+", stdout);
#ifdef MY_DEBUG
AllocConsole();
FILE* value = freopen("CONOUT$", "w+", stdout);
#endif
}
void cheat::init()
@@ -72,8 +75,8 @@ void cheat::hk_post_render(void* thisptr, SDK::UCanvas* canvas)
gui::main();
visual::main();
menu::main();
player::main();
menu::main();
gvalue::def_post_render(thisptr, canvas);
+7
View File
@@ -145,10 +145,13 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="cheat.h" />
<ClInclude Include="entity.h" />
<ClInclude Include="gconst.h" />
<ClInclude Include="gdefine.h" />
<ClInclude Include="glanguage.h" />
<ClInclude Include="gui.h" />
<ClInclude Include="gvalue.h" />
<ClInclude Include="item.h" />
<ClInclude Include="menu.h" />
<ClInclude Include="player.h" />
<ClInclude Include="render.h" />
@@ -158,12 +161,16 @@
<ItemGroup>
<ClCompile Include="cheat.cpp" />
<ClCompile Include="dll_main.cpp" />
<ClCompile Include="entity.cpp" />
<ClCompile Include="gui.cpp" />
<ClCompile Include="item.cpp" />
<ClCompile Include="menu.cpp" />
<ClCompile Include="player.cpp" />
<ClCompile Include="render.cpp" />
<ClCompile Include="sdk\SDK\Backrooms_functions.cpp" />
<ClCompile Include="sdk\SDK\Basic.cpp" />
<ClCompile Include="sdk\SDK\BPCharacter_Demo_functions.cpp" />
<ClCompile Include="sdk\SDK\BP_DroppedItem_functions.cpp" />
<ClCompile Include="sdk\SDK\CoreUObject_functions.cpp" />
<ClCompile Include="sdk\SDK\Engine_functions.cpp" />
<ClCompile Include="visual.cpp" />
+27
View File
@@ -35,6 +35,12 @@
<Filter Include="source\cheat\player">
<UniqueIdentifier>{4c36d6e9-ecfb-4f77-b43d-5d3ea5689945}</UniqueIdentifier>
</Filter>
<Filter Include="source\cheat\item">
<UniqueIdentifier>{9c6d5773-dd07-4da9-a052-965dd73dc20f}</UniqueIdentifier>
</Filter>
<Filter Include="source\cheat\entity">
<UniqueIdentifier>{bdbb1be1-af55-47a3-a36e-cb5f7aaffdbd}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cheat.h">
@@ -67,6 +73,15 @@
<ClInclude Include="glanguage.h">
<Filter>source\global</Filter>
</ClInclude>
<ClInclude Include="gdefine.h">
<Filter>source\global</Filter>
</ClInclude>
<ClInclude Include="item.h">
<Filter>source\cheat\item</Filter>
</ClInclude>
<ClInclude Include="entity.h">
<Filter>source\cheat\entity</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cheat.cpp">
@@ -102,5 +117,17 @@
<ClCompile Include="sdk\SDK\BPCharacter_Demo_functions.cpp">
<Filter>third_party\sdk</Filter>
</ClCompile>
<ClCompile Include="item.cpp">
<Filter>source\cheat\item</Filter>
</ClCompile>
<ClCompile Include="sdk\SDK\Backrooms_functions.cpp">
<Filter>third_party\sdk</Filter>
</ClCompile>
<ClCompile Include="sdk\SDK\BP_DroppedItem_functions.cpp">
<Filter>third_party\sdk</Filter>
</ClCompile>
<ClCompile Include="entity.cpp">
<Filter>source\cheat\entity</Filter>
</ClCompile>
</ItemGroup>
</Project>
+30
View File
@@ -0,0 +1,30 @@
#include "entity.h"
#include "gvalue.h"
void entity::kill_all()
{
SDK::TArray<SDK::AActor*> list;
SDK::UGameplayStatics::GetAllActorsOfClass(gvalue::world, SDK::ACharacter::StaticClass(), &list);
for (SDK::AActor* actor : list)
{
if (actor->IsA(SDK::ABP_Explorer_C::StaticClass()) || actor->IsA(SDK::ABPCharacter_Demo_C::StaticClass()))
{
continue;
}
actor->K2_DestroyActor();
}
}
void entity::kill(const std::string& name)
{
SDK::TArray<SDK::AActor*> list;
SDK::UGameplayStatics::GetAllActorsOfClass(gvalue::world, SDK::ACharacter::StaticClass(), &list);
for (SDK::AActor* actor : list)
{
if (actor->Class->Name.ToString() == name)
{
actor->K2_DestroyActor();
}
}
}
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include "_sdk.h"
#include <string>
class entity
{
public:
static void kill_all();
static void kill(const std::string& name);
};
+7
View File
@@ -0,0 +1,7 @@
#pragma once
#if 1
#define MY_DEBUG
#else
#define MY_RELEASE
#endif
+6 -1
View File
@@ -9,8 +9,8 @@ namespace glanguage
inline constexpr wchar_t visual[] = L"视觉";
inline constexpr wchar_t player[] = L"玩家";
inline constexpr wchar_t item[] = L"物品";
inline constexpr wchar_t misc[] = L"杂项";
inline constexpr wchar_t entity[] = L"实体";
inline constexpr wchar_t misc[] = L"杂项";
inline constexpr wchar_t interact[] = L"互动";
inline constexpr wchar_t enable[] = L"启用";
inline constexpr wchar_t box[] = L"方框";
@@ -32,7 +32,12 @@ namespace glanguage
inline constexpr wchar_t inf_sanity[] = L"无限San值";
inline constexpr wchar_t auto_balance[] = L"自动平衡";
inline constexpr wchar_t inf_jump[] = L"无限跳跃";
inline constexpr wchar_t fly_mode[] = L"飞天遁地";
inline constexpr wchar_t x_delete[] = L"X键删除";
inline constexpr wchar_t ghost_mode[] = L"灵魂出窍(多人)";
inline constexpr wchar_t walk_speed[] = L"行走速度:";
inline constexpr wchar_t run_speed[] = L"跑步速度:";
inline constexpr wchar_t crouch_speed[] = L"蹲下速度:";
inline constexpr wchar_t all_speedup[] = L"通用加速:";
inline constexpr wchar_t speed[] = L"速度:";
}
+6 -1
View File
@@ -57,8 +57,13 @@ namespace gvalue
inline bool no_balance = true;
inline bool inf_jump = false;
inline int walk_speed = 250;
inline int run_speed = 450;
inline int run_speed = 500;
inline int crouch_speed = 100;
inline float speedup_multi = 1;
inline bool ghost_mode = false;
inline bool fly_mode = false;
inline float fly_speed = 5.0f;
inline bool x_delete = false;
inline SDK::UWorld* world;
inline SDK::APlayerController* controller;
+31
View File
@@ -0,0 +1,31 @@
#include "item.h"
#include "gvalue.h"
void item::spawn(SDK::TSubclassOf<SDK::AActor> actor_class)
{
if (!gvalue::world || !gvalue::controller)
{
return;
}
if (!gvalue::controller->Pawn || !gvalue::controller->Pawn->IsA(SDK::ABPCharacter_Demo_C::StaticClass()))
{
return;
}
SDK::ABPCharacter_Demo_C* my_player = static_cast<SDK::ABPCharacter_Demo_C*>(gvalue::controller->Pawn);
SDK::FTransform trans;
trans.Translation = gvalue::controller->PlayerCameraManager->GetCameraLocation();
SDK::AActor* new_actor = SDK::UGameplayStatics::BeginDeferredActorSpawnFromClass(
gvalue::world,
actor_class,
trans,
SDK::ESpawnActorCollisionHandlingMethod::AlwaysSpawn,
nullptr
);
SDK::UGameplayStatics::FinishSpawningActor(new_actor, trans);
SDK::ABP_DroppedItem_C* item = static_cast<SDK::ABP_DroppedItem_C*>(new_actor);
my_player->InvAdd(item);
}
+9
View File
@@ -0,0 +1,9 @@
#pragma once
#include "_sdk.h"
class item
{
public:
static void spawn(SDK::TSubclassOf<SDK::AActor> actor_class);
};
+306 -21
View File
@@ -5,13 +5,19 @@
#include "gvalue.h"
#include "gui.h"
#include "glanguage.h"
#include "item.h"
#include "entity.h"
#include <sstream>
#include <iomanip>
enum class e_page
{
visual,
player,
item,
misc
entity,
misc,
};
float menu_x = 100.0f;
@@ -118,6 +124,9 @@ void menu::base_draw()
case e_page::item:
item();
break;
case e_page::entity:
entity();
break;
case e_page::misc:
misc();
break;
@@ -195,7 +204,12 @@ void menu::left_bar()
page = e_page::item;
}
if (button_01(glanguage::misc, SDK::FVector2D(menu_x + 10, menu_y + 100)))
if (button_01(glanguage::entity, SDK::FVector2D(menu_x + 10, menu_y + 100)))
{
page = e_page::entity;
}
if (button_01(glanguage::misc, SDK::FVector2D(menu_x + 10, menu_y + 130)))
{
page = e_page::misc;
}
@@ -451,7 +465,13 @@ void menu::player()
render::fill_box(
SDK::FVector2D(menu_x + 90, menu_y + 10),
SDK::FVector2D(140, menu_h - 20),
SDK::FVector2D(170, menu_h - 20),
SDK::FLinearColor(0.02f, 0.02f, 0.02f, 1.0f)
);
render::fill_box(
SDK::FVector2D(menu_x + 270, menu_y + 10),
SDK::FVector2D(120, menu_h - 20),
SDK::FLinearColor(0.02f, 0.02f, 0.02f, 1.0f)
);
@@ -464,10 +484,10 @@ void menu::player()
text_01(glanguage::auto_balance, SDK::FVector2D(menu_x + 100, menu_y + 82), false, false);
check_box_01(SDK::FVector2D(menu_x + 160, menu_y + 82), &gvalue::no_balance);
text_01(glanguage::inf_jump, SDK::FVector2D(menu_x + 100, menu_y + 112), false, false);
check_box_01(SDK::FVector2D(menu_x + 160, menu_y + 112), &gvalue::inf_jump);
text_01(glanguage::ghost_mode, SDK::FVector2D(menu_x + 100, menu_y + 112), false, false);
check_box_01(SDK::FVector2D(menu_x + 200, menu_y + 112), &gvalue::ghost_mode);
if (button_01(std::wstring(glanguage::walk_speed + std::to_wstring(gvalue::walk_speed)).c_str(), SDK::FVector2D(menu_x + 100, menu_y + 140), SDK::FVector2D(120, 20)))
if (button_01(std::wstring(glanguage::walk_speed + std::to_wstring(gvalue::walk_speed)).c_str(), SDK::FVector2D(menu_x + 100, menu_y + 140), SDK::FVector2D(150, 20)))
{
const int list[10] = {
250,300,350,400,500,
@@ -484,7 +504,7 @@ void menu::player()
}
}
if (button_01(std::wstring(glanguage::run_speed + std::to_wstring(gvalue::run_speed)).c_str(), SDK::FVector2D(menu_x + 100, menu_y + 170), SDK::FVector2D(120, 20)))
if (button_01(std::wstring(glanguage::run_speed + std::to_wstring(gvalue::run_speed)).c_str(), SDK::FVector2D(menu_x + 100, menu_y + 170), SDK::FVector2D(150, 20)))
{
const int list[10] = {
450,500,550,600,800,
@@ -501,7 +521,7 @@ void menu::player()
}
}
if (button_01(std::wstring(glanguage::crouch_speed + std::to_wstring(gvalue::crouch_speed)).c_str(), SDK::FVector2D(menu_x + 100, menu_y + 200), SDK::FVector2D(120, 20)))
if (button_01(std::wstring(glanguage::crouch_speed + std::to_wstring(gvalue::crouch_speed)).c_str(), SDK::FVector2D(menu_x + 100, menu_y + 200), SDK::FVector2D(150, 20)))
{
const int list[10] = {
100,150,200,300,400,
@@ -517,24 +537,282 @@ void menu::player()
}
}
}
if (button_01(std::wstring(glanguage::all_speedup + f_to_ws(gvalue::speedup_multi)).c_str(), SDK::FVector2D(menu_x + 100, menu_y + 230), SDK::FVector2D(150, 20)))
{
const float list[10] = {
1.0f,1.1f,1.2f,1.5f,2.0f,
5.0f,10.0f,20.0f,50.0f,100.0f
};
for (int i = 0; i < 10; i++)
{
if (gvalue::speedup_multi == list[i])
{
gvalue::speedup_multi = i < 9 ? list[i + 1] : list[0];
break;
}
}
}
text_01(glanguage::inf_jump, SDK::FVector2D(menu_x + 280, menu_y + 22), false, false);
check_box_01(SDK::FVector2D(menu_x + 350, menu_y + 22), &gvalue::inf_jump);
text_01(glanguage::fly_mode, SDK::FVector2D(menu_x + 280, menu_y + 52), false, false);
check_box_01(SDK::FVector2D(menu_x + 350, menu_y + 52), &gvalue::fly_mode);
if (button_01(std::wstring(glanguage::speed + f_to_ws(gvalue::fly_speed)).c_str(), SDK::FVector2D(menu_x + 280, menu_y + 80), SDK::FVector2D(100, 20)))
{
const float list[11] = {
5.0f,10.0f,20.0f,30.0f,40.0f,
50.0f,60.0f,70.0f,80.0f,90.0f,
100.0f
};
for (int i = 0; i < 11; i++)
{
if (gvalue::fly_speed == list[i])
{
gvalue::fly_speed = i < 10 ? list[i + 1] : list[0];
break;
}
}
}
text_01(glanguage::x_delete, SDK::FVector2D(menu_x + 280, menu_y + 112), false, false);
check_box_01(SDK::FVector2D(menu_x + 350, menu_y + 112), &gvalue::x_delete);
}
void menu::item()
{
render::draw_text(
gvalue::engine->MediumFont,
glanguage::item,
SDK::FVector2D(menu_x + 100.0f, menu_y + 10.0f),
SDK::FVector2D(1.0f, 1.0f),
SDK::FLinearColor(1.0f, 1.0f, 1.0f, 1.0f),
1.0f,
SDK::FLinearColor(0.0f, 0.0f, 0.0f, 0.0f),
SDK::FVector2D(0.0f, 0.0f),
false,
false,
false,
SDK::FLinearColor(0.0f, 0.0f, 0.0f, 0.0f)
auto button_01 = [](const UC::FString& text, const SDK::FVector2D& pos, const SDK::FVector2D& size)
{
const SDK::FLinearColor normal_col(0.04f, 0.04f, 0.04f, 1.0f);
const SDK::FLinearColor hover_col(0.06f, 0.06f, 0.06f, 1.0f);
const SDK::FLinearColor press_col(0.1f, 0.1f, 0.1f, 1.0f);
const SDK::FLinearColor text_col(1.0f, 1.0f, 1.0f, 1.0f);
return gui::button_color_text(
pos,
size,
text,
gvalue::engine->MediumFont,
text_col,
normal_col,
hover_col,
press_col
);
};
render::fill_box(
SDK::FVector2D(menu_x + 90, menu_y + 10),
SDK::FVector2D(300, menu_h - 20),
SDK::FLinearColor(0.02f, 0.02f, 0.02f, 1.0f)
);
// line 1
if (button_01(L"果汁", SDK::FVector2D(menu_x + 100, menu_y + 20), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Juice_C::StaticClass());
}
if (button_01(L"杏仁水", SDK::FVector2D(menu_x + 100, menu_y + 50), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_AlmondWater_C::StaticClass());
}
if (button_01(L"手电筒", SDK::FVector2D(menu_x + 100, menu_y + 80), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Flashlight_C::StaticClass());
}
if (button_01(L"液态痛苦", SDK::FVector2D(menu_x + 100, menu_y + 110), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_LiquidPain_C::StaticClass());
}
if (button_01(L"能量棒", SDK::FVector2D(menu_x + 100, menu_y + 140), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_EnergyBar_C::StaticClass());
}
if (button_01(L"潜水头盔", SDK::FVector2D(menu_x + 100, menu_y + 170), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_DivingHelmet_C::StaticClass());
}
if (button_01(L"信号枪", SDK::FVector2D(menu_x + 100, menu_y + 200), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_FlareGun_C::StaticClass());
}
if (button_01(L"绳子", SDK::FVector2D(menu_x + 100, menu_y + 230), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Rope_C::StaticClass());
}
if (button_01(L"对讲机", SDK::FVector2D(menu_x + 100, menu_y + 260), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_WalkieTalkie_C::StaticClass());
}
// line 2
if (button_01(L"电锯", SDK::FVector2D(menu_x + 190, menu_y + 20), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Chainsaw_C::StaticClass());
}
if (button_01(L"烟花", SDK::FVector2D(menu_x + 190, menu_y + 50), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Firework_C::StaticClass());
}
if (button_01(L"黄色荧光棒", SDK::FVector2D(menu_x + 190, menu_y + 80), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Glowstick_Yellow_C::StaticClass());
}
if (button_01(L"蓝色荧光棒", SDK::FVector2D(menu_x + 190, menu_y + 110), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Glowstick_Blue_C::StaticClass());
}
if (button_01(L"红色荧光棒", SDK::FVector2D(menu_x + 190, menu_y + 140), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_Item_Glowstick_Red_C::StaticClass());
}
if (button_01(L"荧光棒", SDK::FVector2D(menu_x + 190, menu_y + 170), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Glowstick_C::StaticClass());
}
if (button_01(L"杀虫喷雾", SDK::FVector2D(menu_x + 190, menu_y + 200), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_BugSpray_C::StaticClass());
}
if (button_01(L"相机", SDK::FVector2D(menu_x + 190, menu_y + 230), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Camera_C::StaticClass());
}
if (button_01(L"撬棍", SDK::FVector2D(menu_x + 190, menu_y + 260), SDK::FVector2D(80, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Crowbar_C::StaticClass());
}
// line 3
if (button_01(L"温度计", SDK::FVector2D(menu_x + 280, menu_y + 20), SDK::FVector2D(100, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Thermometer_C::StaticClass());
}
if (button_01(L"扫描仪", SDK::FVector2D(menu_x + 280, menu_y + 50), SDK::FVector2D(100, 20)))
{
item::spawn(SDK::ABP_DroppedItem_LiDAR_C::StaticClass());
}
if (button_01(L"玩具", SDK::FVector2D(menu_x + 280, menu_y + 80), SDK::FVector2D(100, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Toy_C::StaticClass());
}
if (button_01(L"刀", SDK::FVector2D(menu_x + 280, menu_y + 110), SDK::FVector2D(100, 20)))
{
item::spawn(SDK::ABP_DroppedItem_Knife_C::StaticClass());
}
}
void menu::entity()
{
auto button_01 = [](const UC::FString& text, const SDK::FVector2D& pos, const SDK::FVector2D& size)
{
const SDK::FLinearColor normal_col(0.04f, 0.04f, 0.04f, 1.0f);
const SDK::FLinearColor hover_col(0.06f, 0.06f, 0.06f, 1.0f);
const SDK::FLinearColor press_col(0.1f, 0.1f, 0.1f, 1.0f);
const SDK::FLinearColor text_col(1.0f, 1.0f, 1.0f, 1.0f);
return gui::button_color_text(
pos,
size,
text,
gvalue::engine->MediumFont,
text_col,
normal_col,
hover_col,
press_col
);
};
render::fill_box(
SDK::FVector2D(menu_x + 90, menu_y + 10),
SDK::FVector2D(120, menu_h - 20),
SDK::FLinearColor(0.02f, 0.02f, 0.02f, 1.0f)
);
render::fill_box(
SDK::FVector2D(menu_x + 220, menu_y + 10),
SDK::FVector2D(170, menu_h - 20),
SDK::FLinearColor(0.02f, 0.02f, 0.02f, 1.0f)
);
if (button_01(L"草饲所有实体", SDK::FVector2D(menu_x + 100, menu_y + 20), SDK::FVector2D(100, 20)))
{
entity::kill_all();
}
if (button_01(L"删除细菌", SDK::FVector2D(menu_x + 100, menu_y + 50), SDK::FVector2D(100, 20)))
{
entity::kill("Bacteria_Roaming_BP_C");
entity::kill("Bacteria_BP_C");
}
if (button_01(L"删除笑魇", SDK::FVector2D(menu_x + 100, menu_y + 80), SDK::FVector2D(100, 20)))
{
entity::kill("Smiler_BP2_C");
entity::kill("BP_Roaming_Smiler_C");
entity::kill("BP_Smiler_Dash_C");
}
if (button_01(L"删除派对客", SDK::FVector2D(menu_x + 100, menu_y + 110), SDK::FVector2D(100, 20)))
{
entity::kill("BP_RoamingPartygoer_Idle_C");
entity::kill("BP_RoamingPartygoer_C");
entity::kill("BP_RoamingPartygoer_Slow_C");
entity::kill("Smiler_BP2_C");
entity::kill("BP_DarkPartyGoer_C");
entity::kill("BP_HidingPartyGoer_C");
}
if (button_01(L"删除死亡飞蛾", SDK::FVector2D(menu_x + 100, menu_y + 140), SDK::FVector2D(100, 20)))
{
entity::kill("BP_Moth_C");
entity::kill("BP_Cave_Moth_C");
}
if (button_01(L"删除窃皮者", SDK::FVector2D(menu_x + 100, menu_y + 170), SDK::FVector2D(100, 20)))
{
entity::kill("BP_SkinStealer_C");
entity::kill("BP_SkinStealer_Cave_C");
entity::kill("BP_SkinStealer_Level07_C");
entity::kill("BP_SkinStealer_Hotel_C");
}
if (button_01(L"删除猎犬", SDK::FVector2D(menu_x + 100, menu_y + 200), SDK::FVector2D(100, 20)))
{
entity::kill("BP_Hound_C");
entity::kill("BP_Hound_Hotel_C");
}
if (button_01(L"删除悲尸", SDK::FVector2D(menu_x + 100, menu_y + 230), SDK::FVector2D(100, 20)))
{
entity::kill("BP_Wretch_C");
entity::kill("BP_Wretch_House_C");
}
}
void menu::misc()
@@ -554,3 +832,10 @@ void menu::misc()
SDK::FLinearColor(0.0f, 0.0f, 0.0f, 0.0f)
);
}
std::wstring menu::f_to_ws(const float& f)
{
std::wostringstream woss;
woss << std::fixed << std::setprecision(1) << f;
return woss.str();
}
+6
View File
@@ -1,4 +1,7 @@
#pragma once
#include <string>
class menu
{
public:
@@ -15,6 +18,9 @@ private:
static void visual();
static void player();
static void item();
static void entity();
static void misc();
static std::wstring f_to_ws(const float& f);
};
+209
View File
@@ -2,9 +2,12 @@
#include "gvalue.h"
#include "_sdk.h"
#include "render.h"
SDK::ABPCharacter_Demo_C* my_player = nullptr;
SDK::AMP_PS_C* my_state = nullptr;
float def_sensitivity = -1;
SDK::FVector fly_location = SDK::FVector(-114514, -114514, -114514);
void player::init()
{
@@ -25,15 +28,23 @@ void player::get_player()
if (!gvalue::controller->Pawn || !gvalue::controller->Pawn->IsA(SDK::ABPCharacter_Demo_C::StaticClass()))
{
my_player = nullptr;
def_sensitivity = -1;
fly_location = SDK::FVector(-114514, -114514, -114514);
return;
}
if (!gvalue::controller->PlayerState || !gvalue::controller->PlayerState->IsA(SDK::AMP_PS_C::StaticClass()))
{
my_state = nullptr;
def_sensitivity = -1;
fly_location = SDK::FVector(-114514, -114514, -114514);
return;
}
my_player = static_cast<SDK::ABPCharacter_Demo_C*>(gvalue::controller->Pawn);
my_state = static_cast<SDK::AMP_PS_C*>(gvalue::controller->PlayerState);
if (def_sensitivity == -1)
{
def_sensitivity = my_player->MouseSensitivity;
}
property();
}
@@ -64,6 +75,15 @@ void player::property()
my_player->JumpMaxCount = 1;
}
if (my_player->IsSprinting)
{
my_player->CharacterMovement->MaxWalkSpeed = gvalue::run_speed;
}
else
{
my_player->CharacterMovement->MaxWalkSpeed = gvalue::walk_speed;
}
if (my_player->SprintSpeed != gvalue::run_speed)
{
my_player->SprintSpeed = gvalue::run_speed;
@@ -82,4 +102,193 @@ void player::property()
my_player->SetCrouchWalkSpeedServer(gvalue::crouch_speed);
}
my_player->CustomTimeDilation = gvalue::speedup_multi;
my_player->MouseSensitivity = def_sensitivity / gvalue::speedup_multi;
my_player->SetReplicateMovement(!gvalue::ghost_mode);
if (fly_location == SDK::FVector(-114514, -114514, -114514))
{
fly_location = my_player->K2_GetActorLocation();
}
if (gvalue::fly_mode)
{
const SDK::FRotator con_rot = my_player->GetControlRotation();
const SDK::FRotator act_rot = my_player->K2_GetActorRotation();
if (GetAsyncKeyState('W') & 0x8000)
{
fly_location += SDK::UKismetMathLibrary::GetForwardVector(con_rot) * gvalue::fly_speed;
}
if (GetAsyncKeyState('S') & 0x8000)
{
fly_location += SDK::UKismetMathLibrary::GetForwardVector(con_rot) * -1 * gvalue::fly_speed;
}
if (GetAsyncKeyState('A') & 0x8000)
{
fly_location += SDK::UKismetMathLibrary::GetRightVector(con_rot) * -1 * gvalue::fly_speed;
}
if (GetAsyncKeyState('D') & 0x8000)
{
fly_location += SDK::UKismetMathLibrary::GetRightVector(con_rot) * gvalue::fly_speed;
}
if (GetAsyncKeyState(VK_SPACE) & 0x8000)
{
fly_location += SDK::UKismetMathLibrary::GetUpVector(act_rot) * gvalue::fly_speed;
}
if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
{
fly_location += SDK::UKismetMathLibrary::GetUpVector(act_rot) * -1 * gvalue::fly_speed;
}
my_player->K2_SetActorLocation(fly_location, false, nullptr, true);
}
else
{
fly_location = my_player->K2_GetActorLocation();
}
if (gvalue::x_delete)
{
SDK::FVector trace_start = gvalue::controller->PlayerCameraManager->GetCameraLocation();
SDK::FVector trace_end = trace_start + SDK::UKismetMathLibrary::GetForwardVector(my_player->GetControlRotation()) * 10000;
SDK::TArray<SDK::AActor*> ignore_actors;
ignore_actors.Add(my_player);
SDK::FHitResult result;
SDK::UKismetSystemLibrary::LineTraceSingle(
gvalue::world,
trace_start,
trace_end,
SDK::ETraceTypeQuery::TraceTypeQuery1,
false,
ignore_actors,
SDK::EDrawDebugTrace::None,
&result,
true,
SDK::FLinearColor(1.0f, 0.0f, 0.0f, 1.0f),
SDK::FLinearColor(0.0f, 1.0f, 0.0f, 1.0f),
0.0f
);
SDK::AActor* del_actor = nullptr;
if (result.bBlockingHit)
{
draw_extent(result.Actor.Get(), SDK::FLinearColor(1.0f, 0.2f, 0.0f, 1.0f), SDK::UKismetStringLibrary::Conv_NameToString(result.Actor.Get()->Name).ToWString());
del_actor = result.Actor.Get();
}
static bool x_down = false;
if (GetAsyncKeyState('X') & 0x8000)
{
if (!x_down)
{
if (del_actor)
{
result.Actor.Get()->K2_DestroyActor();
}
x_down = true;
}
}
else
{
x_down = false;
}
}
}
void player::draw_extent(SDK::AActor* actor, const SDK::FLinearColor& color, const std::wstring& name)
{
if (!actor)
{
return;
}
struct line_01
{
SDK::FVector2D p1;
SDK::FVector2D p2;
};
SDK::FVector origin, extent;
actor->GetActorBounds(true, &origin, &extent, true);
const SDK::FVector point[] =
{
origin + SDK::FVector(extent.X, extent.Y, extent.Z), //0
origin + SDK::FVector(-extent.X, -extent.Y, -extent.Z), //1
origin + SDK::FVector(extent.X, -extent.Y, extent.Z), //2
origin + SDK::FVector(extent.X, extent.Y, -extent.Z), //3
origin + SDK::FVector(extent.X, -extent.Y, -extent.Z), //4
origin + SDK::FVector(-extent.X, extent.Y, extent.Z), //5
origin + SDK::FVector(-extent.X, extent.Y, -extent.Z), //6
origin + SDK::FVector(-extent.X, -extent.Y, extent.Z) //7
};
SDK::FVector2D point_2d[8];
for (int i = 0; i < 8; i++)
{
SDK::FVector2D ori_2d;
bool in_view = gvalue::controller->ProjectWorldLocationToScreen(point[i], &ori_2d, true);
if (!in_view)
{
ori_2d = SDK::FVector2D(-114514, -114514);
}
point_2d[i] = ori_2d;
}
const line_01 line[12] =
{
{point_2d[0],point_2d[2]},
{point_2d[0],point_2d[3]},
{point_2d[0],point_2d[5]},
{point_2d[1],point_2d[4]},
{point_2d[1],point_2d[6]},
{point_2d[1],point_2d[7]},
{point_2d[2],point_2d[4]},
{point_2d[2],point_2d[7]},
{point_2d[3],point_2d[4]},
{point_2d[3],point_2d[6]},
{point_2d[5],point_2d[6]},
{point_2d[5],point_2d[7]}
};
for (int i = 0; i < 12; i++)
{
if (line[i].p1 == SDK::FVector2D(-114514, -114514) ||
line[i].p2 == SDK::FVector2D(-114514, -114514))
{
continue;
}
render::draw_line(
line[i].p1,
line[i].p2,
1.0f,
color
);
}
SDK::FVector2D ori_2d;
bool in_view = gvalue::controller->ProjectWorldLocationToScreen(origin, &ori_2d, true);
if (in_view)
{
const std::wstring str = L"[X¼ü] ɾ³ý " + name;
render::draw_text(
gvalue::engine->MediumFont,
str.c_str(),
ori_2d,
SDK::FVector2D(1.0f, 1.0f),
color,
1.0f,
SDK::FLinearColor(0.0f, 0.0f, 0.0f, 0.0f),
SDK::FVector2D(0.0f, 0.0f),
false,
false,
false,
SDK::FLinearColor(0.0f, 0.0f, 0.0f, 0.0f)
);
}
}
+10
View File
@@ -1,5 +1,13 @@
#pragma once
#include <string>
namespace SDK
{
struct FLinearColor;
class AActor;
}
class player
{
public:
@@ -9,4 +17,6 @@ private:
static void get_player();
static void property();
static void draw_extent(SDK::AActor* actor, const SDK::FLinearColor& color, const std::wstring& name);
};
+8 -3
View File
@@ -16,8 +16,6 @@ void visual::init()
name_map[L"Flashlight"] = L"手电筒";
name_map[L"LiquidPain"] = L"液态痛苦";
name_map[L"EnergyBar"] = L"能量棒";
name_map[L"LiquidPain"] = L"液态痛苦";
name_map[L"DivingHelmet"] = L"潜水头盔";
name_map[L"DivingHelmet"] = L"潜水头盔";
name_map[L"Flaregun"] = L"信号枪";
name_map[L"Rope"] = L"绳子";
@@ -141,6 +139,7 @@ void visual::init()
name_map[L"BP_Grassrooms_Floor_Lever_C"] = L"拉杆";
name_map[L"BP_Grassrooms_Lever_C"] = L"拉杆";
name_map[L"BP_RopeZone_C"] = L"绳子";
name_map[L"BP_Balloon_Key_Fake_C"] = L"假气球";
name_map[L"BP_RoamingPartygoer_Idle_C"] = L"派对客";
name_map[L"BP_RoamingPartygoer_C"] = L"派对客";
@@ -166,6 +165,7 @@ void visual::init()
name_map[L"BP_Hound_Hotel_C"] = L"猎犬";
name_map[L"BP_Moth_C"] = L"死亡飞蛾";
name_map[L"BP_DarkPartyGoer_C"] = L"派对客";
name_map[L"BP_HidingPartyGoer_C"] = L"派对客";
name_map[L"Scratcher_BP_C"] = L"这他吗又是啥实体";
name_map[L"BP_KillerClown_C"] = L"小丑";
name_map[L"BP_Wretch_C"] = L"悲尸";
@@ -418,7 +418,7 @@ void visual::draw_extent(SDK::USceneComponent* comp, const SDK::FLinearColor& co
bool in_view = gvalue::controller->ProjectWorldLocationToScreen(point[i], &ori_2d, true);
if (!in_view)
{
return;
ori_2d = SDK::FVector2D(-114514, -114514);
}
point_2d[i] = ori_2d;
}
@@ -445,6 +445,11 @@ void visual::draw_extent(SDK::USceneComponent* comp, const SDK::FLinearColor& co
for (int i = 0; i < 12; i++)
{
if (line[i].p1 == SDK::FVector2D(-114514, -114514) ||
line[i].p2 == SDK::FVector2D(-114514, -114514))
{
continue;
}
render::draw_line(
line[i].p1,
line[i].p2,
+1
View File
@@ -141,6 +141,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
</Link>
</ItemDefinitionGroup>
<ItemGroup>