Skip to content

Commit

Permalink
Add "Voidclip" effect
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedSnark committed Nov 11, 2024
1 parent 7e07bac commit 958220e
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 0 deletions.
1 change: 1 addition & 0 deletions GSChaos/CChaos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ void CChaos::FeatureInit()
RegisterChaosFeature<CFeatureOverwriteAutosave>();
RegisterChaosFeature<CFeatureOverthinking>();
RegisterChaosFeature<CFeatureNightvision>();
RegisterChaosFeature<CFeatureVoidclip>();

// must be last
RegisterChaosFeature<CFeatureCheatCodeVoting>();
Expand Down
51 changes: 51 additions & 0 deletions GSChaos/CFeatureVoidclip.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include "includes.h"

Vector g_vecSavedVelocity = g_vecZero;

void CFeatureVoidclip::Init()
{
CChaosFeature::Init();
}

void CFeatureVoidclip::ActivateFeature()
{
CChaosFeature::ActivateFeature();

g_vecSavedVelocity = (*sv_player)->v.velocity;
}

void CFeatureVoidclip::DeactivateFeature()
{
CChaosFeature::DeactivateFeature();
}

void CFeatureVoidclip::OnFrame(double time)
{
if (!IsActive())
return;

if (g_vecSavedVelocity.Length2D() < 50)
{
(*sv_player)->v.origin.z -= (128 * ImGui::GetIO().DeltaTime);
}
else
{
(*sv_player)->v.origin += (g_vecSavedVelocity * ImGui::GetIO().DeltaTime);
(*sv_player)->v.velocity = g_vecZero;
}
}

const char* CFeatureVoidclip::GetFeatureName()
{
return "Voidclip";
}

double CFeatureVoidclip::GetDuration()
{
return gChaos.GetChaosTime() * 0.08;
}

bool CFeatureVoidclip::UseCustomDuration()
{
return true;
}
42 changes: 42 additions & 0 deletions GSChaos/CFeatureVoidclip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Copyright - ScriptedSnark, 2024.
* CFeatureVoidclip.h
*
* Project (GSChaos) header file
* Authors: ScriptedSnark.
* Do not delete this comment block. Respect others' work!
*/

#ifdef CFEATUREVOIDCLIP_H_RECURSE_GUARD
#error Recursive header files inclusion detected in CFeatureVoidclip.h
#else //CFEATUREVOIDCLIP_H_RECURSE_GUARD

#define CFEATUREVOIDCLIP_H_RECURSE_GUARD

#ifndef CFEATUREVOIDCLIP_H_GUARD
#define CFEATUREVOIDCLIP_H_GUARD
#pragma once

#ifdef __cplusplus

class CFeatureVoidclip : public CChaosFeature
{
void Init() override;
void ActivateFeature() override;
void DeactivateFeature() override;
void OnFrame(double time) override;
const char* GetFeatureName() override;
double GetDuration() override;
bool UseCustomDuration() override;
private:
float m_flNextTeleportTime;
};

#else //!__cplusplus
#error C++ compiler required to compile CFeatureVoidclip.h
#endif //__cplusplus

#endif //CFEATUREVOIDCLIP_H_GUARD

#undef CFEATUREVOIDCLIP_H_RECURSE_GUARD
#endif //CFEATUREVOIDCLIP_H_RECURSE_GUARD
2 changes: 2 additions & 0 deletions GSChaos/GSChaos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
<ClCompile Include="CFeatureUpsideDown.cpp" />
<ClCompile Include="CFeatureBikiniBottom.cpp" />
<ClCompile Include="CFeatureViewOfsInsanity.cpp" />
<ClCompile Include="CFeatureVoidclip.cpp" />
<ClCompile Include="CFeatureWaterIsALie.cpp" />
<ClCompile Include="CFeatureWeaponStrip.cpp" />
<ClCompile Include="CFeatureWideNPCs.cpp" />
Expand Down Expand Up @@ -505,6 +506,7 @@
<ClInclude Include="CFeatureUpsideDown.h" />
<ClInclude Include="CFeatureBikiniBottom.h" />
<ClInclude Include="CFeatureViewOfsInsanity.h" />
<ClInclude Include="CFeatureVoidclip.h" />
<ClInclude Include="CFeatureWaterIsALie.h" />
<ClInclude Include="CFeatureWeaponStrip.h" />
<ClInclude Include="CFeatureWideNPCs.h" />
Expand Down
12 changes: 12 additions & 0 deletions GSChaos/GSChaos.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,12 @@
<ClCompile Include="CFeatureOverthinking.cpp">
<Filter>Effects</Filter>
</ClCompile>
<ClCompile Include="CFeatureNightvision.cpp">
<Filter>Effects</Filter>
</ClCompile>
<ClCompile Include="CFeatureVoidclip.cpp">
<Filter>Effects</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="includes.h" />
Expand Down Expand Up @@ -1228,6 +1234,12 @@
<ClInclude Include="CFeatureOverthinking.h">
<Filter>Effects</Filter>
</ClInclude>
<ClInclude Include="CFeatureNightvision.h">
<Filter>Effects</Filter>
</ClInclude>
<ClInclude Include="CFeatureVoidclip.h">
<Filter>Effects</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Hooking">
Expand Down
1 change: 1 addition & 0 deletions GSChaos/includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ extern bool g_bEncrypted;
#include "CFeatureOverwriteAutosave.h"
#include "CFeatureOverthinking.h"
#include "CFeatureNightvision.h"
#include "CFeatureVoidclip.h"

#include "CFeatureCheatCodeVoting.h"
#include "CFeatureCombineEffects.h"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ If you don't want to play with this feature, rename `twitch.ini` to `twitch_DISA
> View Offset Insanity
> Overwrite Autosave
> Overthinking
> Nightvision
> Voidclip
> Cheat Code Voting !!!(available with Twitch voting)!!!
> 3 Effects in 1
> Let's make it more chaotic
Expand Down Expand Up @@ -307,6 +309,8 @@ If you don't want to play with this feature, rename `twitch.ini` to `twitch_DISA
> View Offset Insanity
> Overwrite Autosave
> Overthinking
> Nightvision
> Voidclip
> Cheat Code Voting !!!(available with Twitch voting)!!!
> 3 Effects in 1
> Let's make it more chaotic
Expand Down

0 comments on commit 958220e

Please sign in to comment.