68 return w.
slots[
static_cast<std::size_t
>(s)];
72 return w.
slots[
static_cast<std::size_t
>(s)];
87 for (
auto& slot : w.
slots) {
88 if (slot.type == type) {
GunInstance & getSlot(WeaponState &w, WeaponSlot s)
Access a specific slot on a WeaponState by enum.
Definition WeaponState.hpp:66
constexpr std::size_t kRenderableWeaponTypeCount
Definition WeaponState.hpp:24
GunInstance & getEquippedGun(WeaponState &w)
The slot the player is currently holding.
Definition WeaponState.hpp:76
GunInstance * findSlotWithType(WeaponState &w, WeaponType type)
Definition WeaponState.hpp:85
WeaponSlot
Identifier for one of the player's weapon slots.
Definition WeaponState.hpp:32
@ SECONDARY
Definition WeaponState.hpp:34
@ PRIMARY
Definition WeaponState.hpp:33
@ Count
Sentinel — must be last. Equals the number of valid slots.
Definition WeaponState.hpp:35
WeaponType
Weapon type — determines tracer style, damage, sound, and impact effects.
Definition WeaponState.hpp:12
@ EnergyGun
Fast hitscan energy burst.
Definition WeaponState.hpp:16
@ Rocket
Slow arcing projectile (ribbon trail).
Definition WeaponState.hpp:14
@ RailGun
Hitscan energy weapon (beam + lightning arcs).
Definition WeaponState.hpp:15
@ Shotgun
Peacekeeper-style pump: 9-pellet star spread, hitscan.
Definition WeaponState.hpp:17
@ None
No weapon in this slot.
Definition WeaponState.hpp:21
@ Rifle
Fast hitscan/projectile (R301-style capsule tracer).
Definition WeaponState.hpp:13
@ 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
Struct that defines this weapon's type, cooldown, and ammo.
Definition WeaponState.hpp:40
bool isReloading
True while reload is in progress.
Definition WeaponState.hpp:46
bool firedSinceTriggerPress
Semi-auto gate: blocks re-fire until trigger released.
Definition WeaponState.hpp:50
WeaponType type
Definition WeaponState.hpp:41
float recoilIdleTime
Time off trigger before decay starts.
Definition WeaponState.hpp:49
float recoilHeat
Recoil heat (decays when not firing).
Definition WeaponState.hpp:48
float fireCooldown
Definition WeaponState.hpp:44
float reloadTime
Time remaining to complete a reload.
Definition WeaponState.hpp:47
float chargeTime
Accumulated charge time (charge weapons only).
Definition WeaponState.hpp:45
int currentMagAmmo
Definition WeaponState.hpp:43
int totalAmmo
Definition WeaponState.hpp:42
Component attached to armed entities (players).
Definition WeaponState.hpp:60
WeaponSlot current
Currently equipped slot.
Definition WeaponState.hpp:62
std::array< GunInstance, static_cast< std::size_t >(WeaponSlot::Count)> slots
Definition WeaponState.hpp:61