|
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). | |
| bool | canAcceptType (WeaponSlot slot, WeaponType type) |
| Slot/type compatibility predicate for pickups. | |
| WeaponType | nextGrenadeType (WeaponType type) |
| Cycle to the next grenade type. HE → Molotov → Impulse → HE. | |
| const GrenadeConfig & | getGrenadeConfig (WeaponType type) |
| Returns the config for a grenade WeaponType. | |
Per-grenade-type tuning data (throw, flight, detonation).
Single source of truth for grenade tuning. Each WeaponType in {HEGrenade, Molotov, Impulse} maps to one row. Add a new grenade by:
|
strong |
How a grenade detonates.
| Enumerator | |
|---|---|
| Explosion | queueExplosion() with damage + knockback (HE, Impulse). |
| FireField | Spawn a FireField entity for damage-over-time (Molotov). |
|
inline |
Slot/type compatibility predicate for pickups.
The grenade slot only accepts grenade types; non-grenade slots only accept non-grenade types. WeaponSpawnerSystem calls this before assigning any picked-up gun to a slot, so a rifle pickup never overwrites the player's grenade and a hypothetical world-spawned grenade never overwrites a real gun.
|
inline |
Returns the config for a grenade WeaponType.
|
inline |
True if type is a grenade (covered by getGrenadeConfig).
|
inline |
Cycle to the next grenade type. HE → Molotov → Impulse → HE.