VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
FireHold.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace VoltMod
7{
8
9/**
10 * @brief @ref Pawn::HoldFire that can be let go: a release hands the weapon back the wait it had, so
11 * the next click fires at once. Keep one per player.
12 */
14{
15public:
16 /** Keep @p pawn's weapon in hand from firing, as @ref Pawn::HoldFire does; call it every frame to hold. */
17 void Hold(const Pawn& pawn, const Clock& clock);
18
19 /** Lets the held weapon fire again at its own pace, then forgets it. */
20 void Release(const Pawn& pawn);
21
22private:
23 EntityRef _weapon;
24 /** The weapon's own next attack ticks, from before the hold. */
25 int _primary = 0;
26 int _secondary = 0;
27 /** 0 when not holding. */
28 int _until = 0;
29};
30
31} // namespace VoltMod
The engine's simulation clock, read straight from IVEngineServer2::GetServerGlobals().
Definition Clock.hpp:19
Pawn::HoldFire that can be let go: a release hands the weapon back the wait it had,...
Definition FireHold.hpp:14
void Release(const Pawn &pawn)
Definition FireHold.cpp:30
void Hold(const Pawn &pawn, const Clock &clock)
Definition FireHold.cpp:7
A player's body: health, armor, movement, aim, weapons. The engine replaces it on every spawn; the Co...
Definition Pawn.hpp:35