17#include <glm/vec3.hpp>
57 glm::vec3
tint = {1.0f, 1.0f, 1.0f};
75 if (type == grenadeType) {
90 assert(
false &&
"grenadeTypeIndex called on non-grenade WeaponType");
129 assert(
isGrenadeType(type) &&
"getGrenadeConfig requires a grenade WeaponType");
135 static constexpr std::array<GrenadeConfig, 3> k_grenadeConfigs{{
138 .throwSpeed = 1800.0f,
139 .throwPitchOffset = 0.14f,
140 .throwCooldown = 1.0f,
142 .bounceRestitution = 0.5f,
147 .explosionRadius = 300.0f,
148 .damageFalloffExp = 2.5f,
149 .selfDamageMult = 0.4f,
150 .maxKnockback = 1100.0f,
151 .knockbackFalloffExp = 1.5f,
153 .tint = {0.4f, 1.0f, 0.4f},
157 .throwSpeed = 1500.0f,
158 .throwPitchOffset = 0.20f,
159 .throwCooldown = 1.0f,
161 .bounceRestitution = 0.0f,
165 .fireRadius = 250.0f,
166 .fireDuration = 5.0f,
169 .tint = {1.0f, 0.5f, 0.1f},
173 .throwSpeed = 1800.0f,
174 .throwPitchOffset = 0.14f,
175 .throwCooldown = 1.0f,
177 .bounceRestitution = 0.0f,
182 .explosionRadius = 220.0f,
183 .damageFalloffExp = 2.0f,
184 .selfDamageMult = 0.4f,
185 .maxKnockback = 400.0f,
186 .knockbackFalloffExp = 2.0f,
188 .tint = {0.4f, 0.6f, 1.0f},
192 const std::size_t k_idx =
static_cast<std::size_t
>(type) -
static_cast<std::size_t
>(
WeaponType::HEGrenade);
193 return k_grenadeConfigs[k_idx];
constexpr std::size_t kGrenadeTypeCount
Definition GrenadeConfig.hpp:69
constexpr const char * grenadeTypeName(WeaponType type)
Definition GrenadeConfig.hpp:102
constexpr float kGrenadeThrowAnimTime
Duration of the throw "wind-up": the gun dips (client viewmodel) and firing is locked out for this lo...
Definition GrenadeConfig.hpp:62
bool isGrenadeType(WeaponType type)
True if type is a grenade (covered by getGrenadeConfig).
Definition GrenadeConfig.hpp:72
const GrenadeConfig & getGrenadeConfig(WeaponType type)
Returns the config for a grenade WeaponType.
Definition GrenadeConfig.hpp:127
WeaponType grenadeTypeAt(std::size_t index)
Definition GrenadeConfig.hpp:94
bool canAcceptType(WeaponSlot, WeaponType type)
Weapon-slot type compatibility predicate for pickup guards.
Definition GrenadeConfig.hpp:120
GrenadeDetonationKind
How a grenade detonates.
Definition GrenadeConfig.hpp:21
@ FireField
Spawn a FireField entity for damage-over-time (Molotov).
Definition GrenadeConfig.hpp:23
@ Explosion
queueExplosion() with damage + knockback (HE, Sticky).
Definition GrenadeConfig.hpp:22
std::size_t grenadeTypeIndex(WeaponType type)
Definition GrenadeConfig.hpp:82
constexpr std::array< WeaponType, 3 > kGrenadeTypes
Definition GrenadeConfig.hpp:64
Weapon state component for armed entities.
WeaponSlot
Identifier for one of the player's weapon slots.
Definition WeaponState.hpp:32
WeaponType
Weapon type — determines tracer style, damage, sound, and impact effects.
Definition WeaponState.hpp:12
@ None
No weapon in this slot.
Definition WeaponState.hpp:21
@ Sticky
Sticks to first surface or player; guaranteed kill when stuck to a player.
Definition WeaponState.hpp:20
@ HEGrenade
Bouncy grenade with 3s fuse, lethal explosion + big knockback.
Definition WeaponState.hpp:18
@ Molotov
Impact-detonate, leaves a fire field (damage over time).
Definition WeaponState.hpp:19
Pending explosion to process this tick.
Definition Explosion.hpp:13
A burning area on the ground that damages players standing in it.
Definition FireField.hpp:14
All tuning for one grenade type.
Definition GrenadeConfig.hpp:28
float selfDamageMult
Definition GrenadeConfig.hpp:47
float throwPitchOffset
Slight upward bias on eye dir (rad).
Definition GrenadeConfig.hpp:31
float explosionRadius
Definition GrenadeConfig.hpp:45
float throwCooldown
Min seconds between throws.
Definition GrenadeConfig.hpp:33
float damage
Definition GrenadeConfig.hpp:44
float bounceRestitution
0 = no bounce, 0.5 = lossy, 1.0 = elastic.
Definition GrenadeConfig.hpp:37
glm::vec3 tint
RGB multiplier for projectile rendering.
Definition GrenadeConfig.hpp:57
GrenadeDetonationKind detonation
Definition GrenadeConfig.hpp:42
float maxKnockback
Definition GrenadeConfig.hpp:48
float knockbackFalloffExp
Definition GrenadeConfig.hpp:49
float damageFalloffExp
Definition GrenadeConfig.hpp:46
float fireRadius
Definition GrenadeConfig.hpp:51
float throwSpeed
Initial speed along throw direction (u/s).
Definition GrenadeConfig.hpp:30
float fireDps
Definition GrenadeConfig.hpp:53
bool sticky
If true, freezes velocity on first surface hit.
Definition GrenadeConfig.hpp:38
float maxLifeTime
Hard timeout safety (s).
Definition GrenadeConfig.hpp:39
int modelId
Legacy model id; client rendering resolves grenade.glb by WeaponType.
Definition GrenadeConfig.hpp:56
float fireDuration
Definition GrenadeConfig.hpp:52
float fuseTime
Seconds; <0 means impact-detonate (no fuse).
Definition GrenadeConfig.hpp:36