diff --git a/GSChaos/CChaos.cpp b/GSChaos/CChaos.cpp index d5f3dd6e..2e87049a 100644 --- a/GSChaos/CChaos.cpp +++ b/GSChaos/CChaos.cpp @@ -274,6 +274,7 @@ void CChaos::FeatureInit() RegisterChaosFeature(); RegisterChaosFeature(); RegisterChaosFeature(); + RegisterChaosFeature(); RegisterChaosFeature(); RegisterChaosFeature(); // must be last!!! diff --git a/GSChaos/CFeatureBoost.cpp b/GSChaos/CFeatureBoost.cpp new file mode 100644 index 00000000..50aac7ea --- /dev/null +++ b/GSChaos/CFeatureBoost.cpp @@ -0,0 +1,23 @@ +#include "includes.h" + +void CFeatureBoost::Init() +{ + CChaosFeature::Init(); +} + +void CFeatureBoost::ActivateFeature() +{ + CChaosFeature::ActivateFeature(); + + (*sv_player)->v.velocity *= 3.0f; +} + +void CFeatureBoost::DeactivateFeature() +{ + CChaosFeature::DeactivateFeature(); +} + +const char* CFeatureBoost::GetFeatureName() +{ + return "Boost"; +} \ No newline at end of file diff --git a/GSChaos/CFeatureBoost.h b/GSChaos/CFeatureBoost.h new file mode 100644 index 00000000..622b89fa --- /dev/null +++ b/GSChaos/CFeatureBoost.h @@ -0,0 +1,37 @@ +/** + * Copyright - ScriptedSnark, 2024. + * CFeatureBoost.h + * + * Project (GSChaos) header file + * Authors: ScriptedSnark. + * Do not delete this comment block. Respect others' work! + */ + +#ifdef CFEATUREBOOST_H_RECURSE_GUARD +#error Recursive header files inclusion detected in CFeatureBoost.h +#else //CFEATUREBOOST_H_RECURSE_GUARD + +#define CFEATUREBOOST_H_RECURSE_GUARD + +#ifndef CFEATUREBOOST_H_GUARD +#define CFEATUREBOOST_H_GUARD +#pragma once + +#ifdef __cplusplus + +class CFeatureBoost : public CChaosFeature +{ + void Init() override; + void ActivateFeature() override; + void DeactivateFeature() override; + const char* GetFeatureName() override; +}; + +#else //!__cplusplus +#error C++ compiler required to compile CFeatureBoost.h +#endif //__cplusplus + +#endif //CFEATUREBOOST_H_GUARD + +#undef CFEATUREBOOST_H_RECURSE_GUARD +#endif //CFEATUREBOOST_H_RECURSE_GUARD \ No newline at end of file diff --git a/GSChaos/GSChaos.vcxproj b/GSChaos/GSChaos.vcxproj index 1c1e8f65..4c8ea72f 100644 --- a/GSChaos/GSChaos.vcxproj +++ b/GSChaos/GSChaos.vcxproj @@ -129,6 +129,7 @@ + @@ -252,6 +253,7 @@ + diff --git a/GSChaos/GSChaos.vcxproj.filters b/GSChaos/GSChaos.vcxproj.filters index daf081cc..90e14db2 100644 --- a/GSChaos/GSChaos.vcxproj.filters +++ b/GSChaos/GSChaos.vcxproj.filters @@ -278,6 +278,9 @@ Effects + + Effects + @@ -653,6 +656,9 @@ Effects + + Effects + diff --git a/GSChaos/Utils.cpp b/GSChaos/Utils.cpp index 0acb9cdb..aa340098 100644 --- a/GSChaos/Utils.cpp +++ b/GSChaos/Utils.cpp @@ -8,6 +8,41 @@ inline int ENTINDEX(edict_t* pEdict) { return (*g_engfuncs->pfnIndexOfEdict)(pEdict); } +void _AngleVectors(const Vector angles, Vector forward, Vector right, Vector up) +{ + float angle; + float sr, sp, sy, cr, cp, cy; + + angle = angles[0] * (M_PI * 2 / 360); + sy = sin(angle); + cy = cos(angle); + angle = angles[1] * (M_PI * 2 / 360); + sp = sin(angle); + cp = cos(angle); + angle = angles[2] * (M_PI * 2 / 360); + sr = sin(angle); + cr = cos(angle); + + if (forward) + { + forward[0] = cp * cy; + forward[1] = cp * sy; + forward[2] = -sp; + } + if (right) + { + right[0] = (-1 * sr * sp * cy + -1 * cr * -sy); + right[1] = (-1 * sr * sp * sy + -1 * cr * cy); + right[2] = -1 * sr * cp; + } + if (up) + { + up[0] = (cr * sp * cy + -sr * -sy); + up[1] = (cr * sp * sy + -sr * cy); + up[2] = cr * cp; + } +} + void Draw_FillRGBA(int x, int y, int w, int h, int r, int g, int b, int a) { glDisable(GL_TEXTURE_2D); diff --git a/GSChaos/Utils.h b/GSChaos/Utils.h index f07e7be7..83f555e6 100644 --- a/GSChaos/Utils.h +++ b/GSChaos/Utils.h @@ -42,6 +42,7 @@ typedef struct unsigned short frequency; // FIXED 8.8 noise frequency (low frequency is a jerk,high frequency is a rumble) } ScreenShake; +void _AngleVectors(const Vector angles, Vector forward, Vector right, Vector up); void Draw_FillRGBA(int x, int y, int w, int h, int r, int g, int b, int a); char* UTIL_VarArgs(char* format, ...); edict_t* UTIL_FindEntityInSphere(edict_t* pStartEntity, const Vector& vecCenter, float flRadius); diff --git a/GSChaos/includes.h b/GSChaos/includes.h index fc897c6e..afed4f42 100644 --- a/GSChaos/includes.h +++ b/GSChaos/includes.h @@ -166,6 +166,7 @@ extern bool g_bEncrypted; #include "CFeatureNice.h" #include "CFeatureSqueakShephard.h" #include "CFeatureSqueakShephards.h" +#include "CFeatureBoost.h" #include "CFeatureCombineEffects.h" //======================== diff --git a/README.md b/README.md index 1373b62d..ab72086f 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,9 @@ If you don't want to play with this feature, rename `twitch.ini` to `twitch_DISA > Quake Pro > Negative Accelerate > Spawn Squeak Shephard -> Spawn Squeak Shephards +> Squeak Shephard Ambush +> Boost +> Nice > Combine Effects ( 3 in 1 ) ```