Skip to content

Commit 0257255

Browse files
committed
Add "Flashbang" effect
1 parent 20fad9a commit 0257255

8 files changed

Lines changed: 73 additions & 0 deletions

File tree

GSChaos/CChaos.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ void CChaos::FeatureInit()
494494
RegisterChaosFeature<CFeatureWaterPush>();
495495
RegisterChaosFeature<CFeatureGalangaAmbush>();
496496
RegisterChaosFeature<CFeatureArmorSpeedometer>();
497+
RegisterChaosFeature<CFeatureFlashbang>();
497498
// must be last
498499
RegisterChaosFeature<CFeatureCheatCodeVoting>();
499500
RegisterChaosFeature<CFeatureCombineEffects>();

GSChaos/CFeatureFlashbang.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "includes.h"
2+
3+
void CFeatureFlashbang::Init()
4+
{
5+
CChaosFeature::Init();
6+
}
7+
8+
void CFeatureFlashbang::ActivateFeature()
9+
{
10+
CChaosFeature::ActivateFeature();
11+
12+
UTIL_ScreenFade((*sv_player), Vector(255, 255, 255), 3, 1.5f, 255, 0);
13+
pEngfuncs->pfnClientCmd(";spk ../../chaos/flashbang-1;\n");
14+
}
15+
16+
void CFeatureFlashbang::DeactivateFeature()
17+
{
18+
CChaosFeature::DeactivateFeature();
19+
}
20+
21+
const char* CFeatureFlashbang::GetFeatureName()
22+
{
23+
return "Flashbang";
24+
}

GSChaos/CFeatureFlashbang.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Copyright - ScriptedSnark, 2024-2025.
3+
* CFeatureFlashbang.h
4+
*
5+
* Project (GSChaos) header file
6+
* Authors: ScriptedSnark.
7+
* Do not delete this comment block. Respect others' work!
8+
*/
9+
10+
#ifdef CFEATUREFLASHBANG_H_RECURSE_GUARD
11+
#error Recursive header files inclusion detected in CFeatureFlashbang.h
12+
#else //CFEATUREFLASHBANG_H_RECURSE_GUARD
13+
14+
#define CFEATUREFLASHBANG_H_RECURSE_GUARD
15+
16+
#ifndef CFEATUREFLASHBANG_H_GUARD
17+
#define CFEATUREFLASHBANG_H_GUARD
18+
#pragma once
19+
20+
#ifdef __cplusplus
21+
22+
class CFeatureFlashbang : public CChaosFeature
23+
{
24+
void Init() override;
25+
void ActivateFeature() override;
26+
void DeactivateFeature() override;
27+
const char* GetFeatureName() override;
28+
};
29+
30+
#else //!__cplusplus
31+
#error C++ compiler required to compile CFeatureFlashbang.h
32+
#endif //__cplusplus
33+
34+
#endif //CFEATUREFLASHBANG_H_GUARD
35+
36+
#undef CFEATUREFLASHBANG_H_RECURSE_GUARD
37+
#endif //CFEATUREFLASHBANG_H_RECURSE_GUARD

GSChaos/GSChaos.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@
213213
<ClCompile Include="CFeatureExtremeGrieferShephard.cpp" />
214214
<ClCompile Include="CFeatureFiftyPercentDeath.cpp" />
215215
<ClCompile Include="CFeatureFirework.cpp" />
216+
<ClCompile Include="CFeatureFlashbang.cpp" />
216217
<ClCompile Include="CFeatureFloatingPointInaccuracy.cpp" />
217218
<ClCompile Include="CFeatureGalangaAmbush.cpp" />
218219
<ClCompile Include="CFeatureGambling.cpp" />
@@ -441,6 +442,7 @@
441442
<ClInclude Include="CFeatureExtremeGrieferShephard.h" />
442443
<ClInclude Include="CFeatureFiftyPercentDeath.h" />
443444
<ClInclude Include="CFeatureFirework.h" />
445+
<ClInclude Include="CFeatureFlashbang.h" />
444446
<ClInclude Include="CFeatureFloatingPointInaccuracy.h" />
445447
<ClInclude Include="CFeatureGalangaAmbush.h" />
446448
<ClInclude Include="CFeatureGambling.h" />

GSChaos/GSChaos.vcxproj.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,9 @@
700700
<ClCompile Include="CFeatureArmorSpeedometer.cpp">
701701
<Filter>Effects</Filter>
702702
</ClCompile>
703+
<ClCompile Include="CFeatureFlashbang.cpp">
704+
<Filter>Effects</Filter>
705+
</ClCompile>
703706
</ItemGroup>
704707
<ItemGroup>
705708
<ClInclude Include="includes.h" />
@@ -1381,6 +1384,9 @@
13811384
<ClInclude Include="CFeatureArmorSpeedometer.h">
13821385
<Filter>Effects</Filter>
13831386
</ClInclude>
1387+
<ClInclude Include="CFeatureFlashbang.h">
1388+
<Filter>Effects</Filter>
1389+
</ClInclude>
13841390
</ItemGroup>
13851391
<ItemGroup>
13861392
<Filter Include="Hooking">

GSChaos/includes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ extern bool g_bEncrypted;
261261
#include "CFeatureWaterPush.h"
262262
#include "CFeatureGalangaAmbush.h"
263263
#include "CFeatureArmorSpeedometer.h"
264+
#include "CFeatureFlashbang.h"
264265

265266
#include "CFeatureCheatCodeVoting.h"
266267
#include "CFeatureCombineEffects.h"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ If you don't want to play with this feature, rename `twitch.ini` to `twitch_DISA
210210
> Water Push
211211
> Galanga Ambush
212212
> Armor Speedometer
213+
> Flashbang
213214
> Cheat Code Voting !!!(available with Twitch voting)!!!
214215
> 3 Effects in 1
215216
> Let's make it more chaotic
@@ -362,6 +363,7 @@ If you don't want to play with this feature, rename `twitch.ini` to `twitch_DISA
362363
> Water Push
363364
> Galanga Ambush
364365
> Armor Speedometer
366+
> Flashbang
365367
> Cheat Code Voting !!!(available with Twitch voting)!!!
366368
> 3 Effects in 1
367369
> Let's make it more chaotic

gamedir/chaos/flashbang-1.wav

30.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)