-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e07bac
commit 958220e
Showing
7 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters