80 const float q = n - 1.0f;
81 return 3.4047f * q - 0.2173f * q * q;
84 const float q = n - 10.0f;
85 return 13.0435f + 2.1919f * q + 0.2681f * q * q;
88 const float q = n - 15.0f;
89 return 30.7065f - 2.1566f * q - 0.3404f * q * q;
92 const float q = n - 20.0f;
93 return 11.4130f - 2.6123f * q;
95 const float q = n - 22.0f;
96 return 6.1885f + 1.9224f * q + 0.2776f * q * q;
104 const float q = n - 1.0f;
105 return 4.0792f * q + 0.09485f * q * q;
108 const float q = n - 10.0f;
109 return 44.3954f + 5.0237f * q - 0.2764f * q * q;
112 const float q = n - 15.0f;
113 return 62.6046f + 4.5740f * q - 0.5132f * q * q;
116 const float q = n - 20.0f;
117 return 72.6457f + 4.4688f * q;
119 const float q = n - 22.0f;
120 return 81.5833f + 4.1890f * q - 0.1866f * q * q;
150 static constexpr std::array<WeaponConfig, 9> k_kWeaponConfigs{{
152 .fireCooldown = 0.125f,
154 .defaultAmmoCapacity = 350,
159 .initialProjectileSpeed = 0.0f,
168 .recoilFreeShots = 0,
169 .recoilPitchPerShot = 0.0f,
170 .recoilYawPerShot = 0.0f,
171 .recoilRampShots = 1.0f,
172 .recoilRecovery = 30.0f,
173 .recoilPatternScale = 0.0025f,
176 .fireCooldown = 1.0f,
178 .defaultAmmoCapacity = 8,
181 .initialProjectileSpeed = 3000.0f,
186 .fireCooldown = 0.5f,
188 .defaultAmmoCapacity = 32,
191 .hitscanRadius = 8.4f,
192 .initialProjectileSpeed = 0.0f,
195 .chargeDamage = 80.0f,
196 .maxChargeTime = 1.0f,
200 .fireCooldown = 0.0f,
202 .defaultAmmoCapacity = 800,
205 .hitscanRadius = 12.0f,
206 .initialProjectileSpeed = 0.0f,
210 .ammoPerSecond = 20.0f,
211 .autoLockBeam =
true,
213 .coneHalfAngleDeg = 48.0f,
216 .shieldDamageMultiplier = 0.9f,
220 .fireCooldown = 0.9f,
222 .defaultAmmoCapacity = 6,
225 .hitscanRadius = 4.2f,
227 .initialProjectileSpeed = 0.0f,
235 .fireCooldown = 0.4f,
237 .defaultAmmoCapacity = 99,
240 .initialProjectileSpeed = 1500.0f,
244 .fireCooldown = 0.4f,
246 .defaultAmmoCapacity = 99,
249 .initialProjectileSpeed = 1200.0f,
253 .fireCooldown = 0.4f,
255 .defaultAmmoCapacity = 99,
258 .initialProjectileSpeed = 1500.0f,
264 return k_kWeaponConfigs[
static_cast<std::size_t
>(type)];
270 static constexpr std::array<ProjectileConfig, 9> k_kProjectileConfigs{{
274 .initialSpeed = 0.0f,
278 .explosionRadius = 340.0f,
279 .explosionFalloffExponent = 1.5f,
280 .selfDamageMultiplier = 0.4f,
281 .maxKnockback = 800.0f,
282 .knockbackFalloffExponent = 2.0f,
293 return k_kProjectileConfigs[
static_cast<std::size_t
>(type)];
299 const int maxAmmo = config.magazineSize + config.defaultAmmoCapacity;
300 const int pickupAmmo = pickupMag + pickupReserve;
301 return std::min(currentReserve + pickupAmmo, maxAmmo - currentMag);
Collision shape component — AABB or vertical capsule.
Projectile component and weapon/surface type enumerations.
int calcPickupReserve(int currentReserve, int currentMag, int pickupReserve, int pickupMag, WeaponType type)
Definition WeaponConfig.hpp:296
float recoilPatternH_R301(float n)
Closed-form 5-segment R-301 recoil pattern (horizontal, right-positive).
Definition WeaponConfig.hpp:77
const ProjectileConfig & getProjectileConfig(WeaponType type)
Returns the projectile config for a weapon type.
Definition WeaponConfig.hpp:268
float recoilPatternV_R301(float n)
Closed-form 5-segment R-301 recoil pattern (vertical, up-positive).
Definition WeaponConfig.hpp:101
const WeaponConfig & getWeaponConfig(WeaponType type)
Returns the gameplay config for a weapon type.
Definition WeaponConfig.hpp:148
WeaponType
Weapon type — determines tracer style, damage, sound, and impact effects.
Definition WeaponState.hpp:12
Collision shape attached to an entity.
Definition CollisionShape.hpp:34
Definition WeaponConfig.hpp:124
float maxKnockback
Peak knockback velocity (u/s) imparted at the epicenter.
Definition WeaponConfig.hpp:140
float selfDamageMultiplier
Damage scale applied when the rocket's owner is the victim (self-damage).
Definition WeaponConfig.hpp:137
int modelId
Definition WeaponConfig.hpp:125
float explosionFalloffExponent
Damage falloff curve exponent.
Definition WeaponConfig.hpp:134
float explosionRadius
Definition WeaponConfig.hpp:130
float initialSpeed
Definition WeaponConfig.hpp:126
float maxLifeTime
Definition WeaponConfig.hpp:129
CollisionShape shape
Definition WeaponConfig.hpp:128
float knockbackFalloffExponent
Knockback falloff exponent (same form as explosionFalloffExponent).
Definition WeaponConfig.hpp:144
float scale
Definition WeaponConfig.hpp:127
Immutable gameplay stats for a weapon type.
Definition WeaponConfig.hpp:14
int defaultAmmoCapacity
Definition WeaponConfig.hpp:17
bool semiAuto
If true, fire requires trigger release between shots (pump/burst weapons).
Definition WeaponConfig.hpp:57
float maxChargeTime
in seconds
Definition WeaponConfig.hpp:54
bool isCharge
True for charge weapons (hold to charge, release to fire).
Definition WeaponConfig.hpp:29
float dpsMax
Ramp ceiling DPS reached after dpsRampTime of continuous lock.
Definition WeaponConfig.hpp:45
bool hitscan
Definition WeaponConfig.hpp:19
float ammoPerSecond
Ammo drain rate (beam weapons only).
Definition WeaponConfig.hpp:31
float hitscanRadius
Hit-detection cylinder radius (world units) for hitscan weapons.
Definition WeaponConfig.hpp:25
float coneHalfAngleDeg
Half-angle of the lock-on cone in degrees (auto-lock beams only).
Definition WeaponConfig.hpp:42
float shieldDamageMultiplier
Effectiveness multiplier against shield layers (overShield + armor).
Definition WeaponConfig.hpp:51
float initialProjectileSpeed
Definition WeaponConfig.hpp:26
float chargeDamage
Damage dealt on release (charge weapons only).
Definition WeaponConfig.hpp:53
int magazineSize
Definition WeaponConfig.hpp:16
int recoilFreeShots
Shots before recoil kicks in (legacy formula path).
Definition WeaponConfig.hpp:59
float recoilRecovery
Heat decay per second (shared by both paths).
Definition WeaponConfig.hpp:63
bool isBeam
True for continuous beam weapons (no per-shot cooldown).
Definition WeaponConfig.hpp:28
float recoilPatternScale
Closed-form pattern (R-301-style) scale; rad per pattern unit.
Definition WeaponConfig.hpp:72
float dpsRampTime
Seconds of continuous lock on the same target to reach dpsMax.
Definition WeaponConfig.hpp:47
float maxRange
Hard range cap (world units) for the auto-lock beam. 0 = unlimited.
Definition WeaponConfig.hpp:40
float fireCooldown
Definition WeaponConfig.hpp:15
float recoilPitchPerShot
Upward kick per shot (legacy formula path).
Definition WeaponConfig.hpp:60
bool autoLockBeam
True for Winston-style auto-lock beams: each tick picks the enemy closest to the crosshair inside con...
Definition WeaponConfig.hpp:38
bool explosive
Definition WeaponConfig.hpp:27
float damage
Definition WeaponConfig.hpp:18
float recoilYawPerShot
Horizontal swing strength (legacy formula path).
Definition WeaponConfig.hpp:61
float reloadTime
Time to complete a reload, in seconds.
Definition WeaponConfig.hpp:55
float recoilRampShots
Curve shape / stem length (legacy formula path).
Definition WeaponConfig.hpp:62
float dps
Damage per second (beam weapons only; discrete weapons use damage).
Definition WeaponConfig.hpp:30