Skip to content

Commit

Permalink
Fixed norecoil again + added rainbow speed + added tips
Browse files Browse the repository at this point in the history
  • Loading branch information
womblee committed Jul 10, 2024
1 parent ba06a3c commit c25e174
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 54 deletions.
Binary file modified .vs/spankerfield/v17/.suo
Binary file not shown.
Binary file modified .vs/spankerfield/v17/Browse.VC.db
Binary file not shown.
6 changes: 3 additions & 3 deletions spankerfield/Features/Rainbow Mode/rainbow_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#include "../../settings.h"
#include "../../Rendering/draw-list.h"

using namespace big;

// Class
class RainbowColorManager
{
private:
float hue = 0.0f;
const float rainbow_speed = 0.5f;
ImColor current_color;

std::chrono::time_point<std::chrono::high_resolution_clock> last_update_time;
Expand All @@ -16,7 +17,7 @@ class RainbowColorManager

void update_rainbow_color(float delta_time)
{
hue += rainbow_speed * delta_time;
hue += g_settings.rainbow_speed * delta_time;
if (hue > 1.0f) hue -= 1.0f;

float r, g, b;
Expand Down Expand Up @@ -90,7 +91,6 @@ class RainbowColorManager
// Code
RainbowColorManager g_rainbow_manager;

using namespace big;
namespace plugins
{
static bool colors_initialized = false;
Expand Down
46 changes: 5 additions & 41 deletions spankerfield/Features/Risky/risky.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,52 +23,16 @@ namespace plugins
if (local_soldier->IsAlive())
{
const auto weapon = WeaponFiring::GetInstance();
if (!weapon) return;
if (!IsValidPtr(weapon)) return;

const auto sway = weapon->m_Sway;
if (!sway) return;
if (!IsValidPtr(sway)) return;

const auto data = sway->m_Data;
if (!data) return;
if (!IsValidPtrWithVTable(data)) return;

const auto is_hit_type = [weapon]() -> bool
{
const auto type = weapon->GetWeaponClass();

switch (type)
{
case WeaponClass::_12gauge:
case WeaponClass::_338Magnum:
case WeaponClass::_357Magnum:
case WeaponClass::_44Magnum:
case WeaponClass::_45cal:
case WeaponClass::_46x30mm:
case WeaponClass::_50cal:
case WeaponClass::_545x45mmWP:
case WeaponClass::_556x45mmNATO:
case WeaponClass::_57x28mm:
case WeaponClass::_58x42mm:
case WeaponClass::_762x39mmWP:
case WeaponClass::_762x51mmNATO:
case WeaponClass::_762x54mmR:
case WeaponClass::_9x19mm:
case WeaponClass::_9x39mm:
case WeaponClass::Assault:
case WeaponClass::Shotgun:
case WeaponClass::Smg:
case WeaponClass::Lmg:
case WeaponClass::Sniper:
return true;
default:
return false;
}
};

if (is_hit_type())
{
data->m_ShootingRecoilDecreaseScale = 100.0f;
data->m_FirstShotRecoilMultiplier = 0.0f;
}
data->m_ShootingRecoilDecreaseScale = 100.0f;
data->m_FirstShotRecoilMultiplier = 0.0f;
}
}

Expand Down
47 changes: 38 additions & 9 deletions spankerfield/Rendering/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ namespace big
ImGui::Checkbox(xorstr_("FOV target selection"), &g_settings.aim_fov_method);
ImGui::SameLine();
ImGui::Checkbox(xorstr_("Aim through walls"), &g_settings.aim_must_be_visible);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Locks on targets without them being fully visible to you."));
ImGui::SameLine();
ImGui::Checkbox(xorstr_("No recoil"), &g_settings.no_recoil);

Expand Down Expand Up @@ -138,7 +140,7 @@ namespace big

static bool custom_aim_key = false;
if (custom_aim_key)
ImGui::InputInt("Key (info on keys in thread)##Aimbot", &g_settings.aim_key);
ImGui::InputInt(xorstr_("Key##Aimbot"), &g_settings.aim_key);
else
{
const char* current_item = xorstr_("Select a key");
Expand All @@ -165,7 +167,7 @@ namespace big

ImGui::Checkbox(xorstr_("Use old aim key selector (legacy)"), &custom_aim_key);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Allows you to use the key selection from legacy versions of Spankerfield."));
ImGui::SetTooltip(xorstr_("Allows you to use the key selection from legacy versions of spankerfield."));

ImGui::Checkbox(xorstr_("Auto bone mode (from upper to lower body)"), &g_settings.aim_bone_priority);

Expand Down Expand Up @@ -214,7 +216,7 @@ namespace big
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Highly do not recommend this while playing on servers, it was made for testing purposes only."));

// This is for current weapon only, and made for debugging, you can make all of these as features
// This is for current weapon only, and made for debugging, you can make all of these as standalone plugins
if (enable_editor)
{
const auto weapon_firing = get_weapon_firing();
Expand Down Expand Up @@ -355,8 +357,12 @@ namespace big
ImGui::Separator();

ImGui::Checkbox(xorstr_("Draw explosives"), &g_settings.explosives);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Draws a number sign for every explosive entity on the server."));
ImGui::SameLine();
ImGui::Checkbox(xorstr_("Draw laser guided missiles"), &g_settings.missiles_own);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Draws boxes for TOW/SRAW missiles."));

ImGui::Text(xorstr_("Colors"));

Expand All @@ -383,6 +389,8 @@ namespace big
ImGui::Checkbox(xorstr_("Draw skeleton"), &g_settings.skeleton);
ImGui::SameLine();
ImGui::Checkbox(xorstr_("Use skeleton dots"), &g_settings.skeleton_use_dots);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Draws little dots on locations where bones end."));
ImGui::PushItemWidth(300.f);
ImGui::SliderFloat(xorstr_("Dots distance"), &g_settings.skeleton_dots_distance, 1.f, 5000.f);
ImGui::PopItemWidth();
Expand Down Expand Up @@ -435,6 +443,8 @@ namespace big
ImGui::PushItemWidth(300.f);
ImGui::SliderFloat(xorstr_("Spacing between health bars##HB"), &g_settings.health_bar_spacing, 1.f, 100.f);
ImGui::PopItemWidth();
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("How many space in pixels there is between two health bars."));
}

ImGui::EndTabItem();
Expand All @@ -445,10 +455,14 @@ namespace big
ImGui::Checkbox(xorstr_("Radar"), &g_settings.radar);
ImGui::SameLine();
ImGui::Checkbox(xorstr_("Circular shape"), &g_settings.radar_circular);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Makes the radar have a circle shape instead of the default square one."));
ImGui::SameLine();
ImGui::Checkbox(xorstr_("Draw teammates##RDR"), &g_settings.radar_draw_teammates);
ImGui::SameLine();
ImGui::Checkbox(xorstr_("Draw self##RDR"), &g_settings.radar_draw_you);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Draws a little dot in the center to help you better orient."));

ImGui::PushItemWidth(300.f);

Expand All @@ -457,7 +471,7 @@ namespace big
if (radar_size < 0)
radar_size = g_settings.radar_width; // You can even use height, since they are the same

if (ImGui::SliderFloat(xorstr_("Radar size##RDR"), &radar_size, 0.f, (float)g_globals.g_height))
if (ImGui::SliderFloat(xorstr_("Radar size##RDR"), &radar_size, 100.f, (float)g_globals.g_height))
{
// Should've made this one variable, honestly
g_settings.radar_width = radar_size;
Expand Down Expand Up @@ -514,6 +528,8 @@ namespace big
ImGui::Checkbox(xorstr_("Spectator list"), &g_settings.spectator_list);
ImGui::SameLine();
ImGui::Checkbox(xorstr_("Raw drawing"), &g_settings.spectator_raw_drawing);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Uses the traditional drawing for the spectator list, and not a window."));

ImGui::Separator();

Expand Down Expand Up @@ -590,8 +606,12 @@ namespace big
ImGui::SetTooltip(xorstr_("Big random chance of unspotting enemies when OBS is running."));

ImGui::Checkbox(xorstr_("Auto jet speed"), &g_settings.jet_speed);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Automatically turns the jet to achieve the best possible speed."));
ImGui::SameLine();
ImGui::Checkbox(xorstr_("Unlock everything"), &g_settings.unlock_all);
ImGui::Checkbox(xorstr_("Unlock everything (BF4DB risk)"), &g_settings.unlock_all);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Unlocks everything but works for attachments only, do not recommend using it though."));
ImGui::SameLine();
ImGui::Checkbox(xorstr_("No hardcore restrictions (PBSS risk)"), &g_settings.no_hc_restrictions);
if (ImGui::IsItemHovered())
Expand All @@ -613,14 +633,16 @@ namespace big
ImGui::PushItemWidth(550.f);
ImGui::InputText(xorstr_("Path to file (.wav)"), g_settings.kill_sound_path, MAX_PATH);
ImGui::PopItemWidth();
ImGui::Text(xorstr_("Make sure the file exists, has latin only characters, and is a WAVE audio file"));
ImGui::Text(xorstr_("Make sure the file exists, has roman/latin characters only, and is a WAVE audio file"));

ImGui::EndTabItem();
}

if (ImGui::BeginTabItem(xorstr_("Blacklist")))
{
ImGui::Checkbox(xorstr_("Draw blacklisted players"), &g_settings.blacklist);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("Draws blacklisted players in the center part of the screen."));
ImGui::PushItemWidth(300.f);
ImGui::SliderFloat(xorstr_("Text size"), &g_settings.blacklist_text_size, 0.f, 150.f);
ImGui::PopItemWidth();
Expand All @@ -637,9 +659,7 @@ namespace big
for (const auto& rs : plugins::blacklisted)
{
if (ImGui::Selectable(rs.name.c_str(), false))
{
plugins::selected = i;
}

i++;
}
Expand Down Expand Up @@ -713,6 +733,15 @@ namespace big
if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("This will make every visual color have the Rainbow effect."));

if (g_settings.rainbow_mode)
{
ImGui::SameLine(); // Want to keep it on the same line

ImGui::PushItemWidth(300.f);
ImGui::SliderFloat(xorstr_("Speed##RM"), &g_settings.rainbow_speed, 0.1f, 2.0f);
ImGui::PopItemWidth();
}

ImGui::Separator();

ImGui::Text(xorstr_("Configuration"));
Expand All @@ -731,7 +760,7 @@ namespace big
g_globals.g_running = false;

if (ImGui::IsItemHovered())
ImGui::SetTooltip(xorstr_("This function is not safe at all, there is a big chance your game might crash."));
ImGui::SetTooltip(xorstr_("This function is not safe at all, there is a big chance your game might crash when injecting the cheat again."));

ImGui::SameLine();

Expand Down
4 changes: 3 additions & 1 deletion spankerfield/SDK/sdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ bool ClientControllableEntity::IsAlive()
WeaponClass WeaponFiring::GetWeaponClass()
{
auto data = reinterpret_cast<WeaponEntityData*>(this->m_weaponComponentData);
if (IsValidPtr(data)) return data->m_WeaponClass;
if (IsValidPtr(data))
return data->m_WeaponClass;

return WeaponClass::None;
}
3 changes: 3 additions & 0 deletions spankerfield/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace big

bool streamer_mode;
bool rainbow_mode;
float rainbow_speed{ 0.5f };

bool spoof_name;
bool spoof_restore;
Expand Down Expand Up @@ -187,6 +188,7 @@ namespace big

g_settings.streamer_mode = j[xorstr_("settings")][xorstr_("streamer_mode")];
g_settings.rainbow_mode = j[xorstr_("settings")][xorstr_("rainbow_mode")];
g_settings.rainbow_speed = j[xorstr_("settings")][xorstr_("rainbow_speed")];

g_settings.aimbot = j[xorstr_("settings")][xorstr_("aimbot")];
g_settings.aim_support_controller = j[xorstr_("settings")][xorstr_("aim_support_controller")];
Expand Down Expand Up @@ -332,6 +334,7 @@ namespace big
{ xorstr_("blacklist_text_size"), g_settings.blacklist_text_size },
{ xorstr_("streamer_mode"), g_settings.streamer_mode },
{ xorstr_("rainbow_mode"), g_settings.rainbow_mode },
{ xorstr_("rainbow_speed"), g_settings.rainbow_speed },
{ xorstr_("esp"), g_settings.esp },
{ xorstr_("esp_draw_teammates"), g_settings.esp_draw_teammates },
{ xorstr_("esp_draw_vehicles"), g_settings.esp_draw_vehicles },
Expand Down

0 comments on commit c25e174

Please sign in to comment.