-
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
65129ec
commit 08f6183
Showing
8 changed files
with
101 additions
and
13 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,46 @@ | ||
#include "includes.h" | ||
|
||
void CFeatureNoAttacking::Init() | ||
{ | ||
CChaosFeature::Init(); | ||
} | ||
|
||
void CFeatureNoAttacking::ActivateFeature() | ||
{ | ||
CChaosFeature::ActivateFeature(); | ||
} | ||
|
||
void CFeatureNoAttacking::DeactivateFeature() | ||
{ | ||
CChaosFeature::DeactivateFeature(); | ||
} | ||
|
||
void CFeatureNoAttacking::CL_CreateMove(float frametime, struct usercmd_s* cmd, int active) | ||
{ | ||
if (!IsActive()) | ||
return; | ||
|
||
cmd->buttons &= ~IN_ATTACK; | ||
cmd->buttons &= ~IN_ATTACK2; | ||
cmd->buttons &= ~IN_ALT1; | ||
} | ||
|
||
const char* CFeatureNoAttacking::GetFeatureName() | ||
{ | ||
return "No Attacking"; | ||
} | ||
|
||
double CFeatureNoAttacking::GetDuration() | ||
{ | ||
return gChaos.GetChaosTime() * 0.9; | ||
} | ||
|
||
bool CFeatureNoAttacking::UseCustomDuration() | ||
{ | ||
return true; | ||
} | ||
|
||
bool CFeatureNoAttacking::CanBeInfinite() | ||
{ | ||
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,41 @@ | ||
/** | ||
* Copyright - ScriptedSnark, 2024. | ||
* CFeatureNoAttacking.h | ||
* | ||
* Project (GSChaos) header file | ||
* Authors: ScriptedSnark. | ||
* Do not delete this comment block. Respect others' work! | ||
*/ | ||
|
||
#ifdef CFEATURENOATTACKING_H_RECURSE_GUARD | ||
#error Recursive header files inclusion detected in CFeatureNoAttacking.h | ||
#else //CFEATURENOATTACKING_H_RECURSE_GUARD | ||
|
||
#define CFEATURENOATTACKING_H_RECURSE_GUARD | ||
|
||
#ifndef CFEATURENOATTACKING_H_GUARD | ||
#define CFEATURENOATTACKING_H_GUARD | ||
#pragma once | ||
|
||
#ifdef __cplusplus | ||
|
||
class CFeatureNoAttacking : public CChaosFeature | ||
{ | ||
void Init() override; | ||
void ActivateFeature() override; | ||
void DeactivateFeature() override; | ||
void CL_CreateMove(float frametime, struct usercmd_s* cmd, int active) override; | ||
const char* GetFeatureName() override; | ||
double GetDuration() override; | ||
bool UseCustomDuration() override; | ||
bool CanBeInfinite() override; | ||
}; | ||
|
||
#else //!__cplusplus | ||
#error C++ compiler required to compile CFeatureNoAttacking.h | ||
#endif //__cplusplus | ||
|
||
#endif //CFEATURENOATTACKING_H_GUARD | ||
|
||
#undef CFEATURENOATTACKING_H_RECURSE_GUARD | ||
#endif //CFEATURENOATTACKING_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
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