|
group2 0.1.0
CSE 125 Group 2
|
Per-grenade-type tuning data (throw, flight, detonation). More...
#include "WeaponState.hpp"#include <array>#include <cassert>#include <cstddef>#include <cstdint>#include <glm/vec3.hpp>Go to the source code of this file.
Classes | |
| struct | GrenadeConfig |
| All tuning for one grenade type. More... | |
Enumerations | |
| enum class | GrenadeDetonationKind : uint8_t { Explosion , FireField } |
| How a grenade detonates. More... | |
Functions | |
| bool | isGrenadeType (WeaponType type) |
| True if type is a grenade (covered by getGrenadeConfig). | |
| std::size_t | grenadeTypeIndex (WeaponType type) |
| WeaponType | grenadeTypeAt (std::size_t index) |
| constexpr const char * | grenadeTypeName (WeaponType type) |
| bool | canAcceptType (WeaponSlot, WeaponType type) |
| Weapon-slot type compatibility predicate for pickup guards. | |
| const GrenadeConfig & | getGrenadeConfig (WeaponType type) |
| Returns the config for a grenade WeaponType. | |
Variables | |
| constexpr float | kGrenadeThrowAnimTime = 0.5f |
| Duration of the throw "wind-up": the gun dips (client viewmodel) and firing is locked out for this long after a throw. | |
| constexpr std::array< WeaponType, 3 > | kGrenadeTypes |
| constexpr std::size_t | kGrenadeTypeCount = kGrenadeTypes.size() |
Per-grenade-type tuning data (throw, flight, detonation).
Single source of truth for grenade tuning. Each WeaponType in {HEGrenade, Molotov, Sticky} maps to one row. Add a new grenade by:
|
strong |
How a grenade detonates.
| Enumerator | |
|---|---|
| Explosion | queueExplosion() with damage + knockback (HE, Sticky). |
| FireField | Spawn a FireField entity for damage-over-time (Molotov). |
|
inline |
Weapon-slot type compatibility predicate for pickup guards.
Grenades are equipped through GrenadeState, not WeaponState, so weapon slots reject grenade types.
|
inline |
Returns the config for a grenade WeaponType.
|
inline |
|
inline |
|
inlineconstexpr |
|
inline |
True if type is a grenade (covered by getGrenadeConfig).
|
inlineconstexpr |
Duration of the throw "wind-up": the gun dips (client viewmodel) and firing is locked out for this long after a throw.
Shorter than throwCooldown.
|
inlineconstexpr |
|
inlineconstexpr |