group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
WeaponConfig Struct Reference

Immutable gameplay stats for a weapon type. More...

#include <WeaponConfig.hpp>

Public Attributes

float fireCooldown = 0.1f
int magazineSize = 0
int defaultAmmoCapacity = 0
float damage = 0.0f
bool hitscan = true
float hitscanRadius = 0.0f
 Hit-detection cylinder radius (world units) for hitscan weapons.
float initialProjectileSpeed = 0.0f
bool explosive = false
bool isBeam = false
 True for continuous beam weapons (no per-shot cooldown).
bool isCharge = false
 True for charge weapons (hold to charge, release to fire).
float dps = 0.0f
 Damage per second (beam weapons only; discrete weapons use damage).
float ammoPerSecond = 0.0f
 Ammo drain rate (beam weapons only).
bool autoLockBeam = false
 True for Winston-style auto-lock beams: each tick picks the enemy closest to the crosshair inside coneHalfAngleDeg and within maxRange (with line-of-sight) and applies ramping damage.
float maxRange = 0.0f
 Hard range cap (world units) for the auto-lock beam. 0 = unlimited.
float coneHalfAngleDeg = 0.0f
 Half-angle of the lock-on cone in degrees (auto-lock beams only).
float dpsMax = 0.0f
 Ramp ceiling DPS reached after dpsRampTime of continuous lock.
float dpsRampTime = 0.0f
 Seconds of continuous lock on the same target to reach dpsMax.
float shieldDamageMultiplier = 1.0f
 Effectiveness multiplier against shield layers (overShield + armor).
float chargeDamage = 0.0f
 Damage dealt on release (charge weapons only).
float maxChargeTime = 0.0f
 in seconds
float reloadTime = 0.0f
 Time to complete a reload, in seconds.
bool semiAuto = false
 If true, fire requires trigger release between shots (pump/burst weapons).
int recoilFreeShots = 0
 Shots before recoil kicks in (legacy formula path).
float recoilPitchPerShot = 0.0f
 Upward kick per shot (legacy formula path).
float recoilYawPerShot = 0.0f
 Horizontal swing strength (legacy formula path).
float recoilRampShots = 1.0f
 Curve shape / stem length (legacy formula path).
float recoilRecovery = 0.0f
 Heat decay per second (shared by both paths).
float recoilPatternScale = 0.0f
 Closed-form pattern (R-301-style) scale; rad per pattern unit.

Detailed Description

Immutable gameplay stats for a weapon type.

Member Data Documentation

◆ ammoPerSecond

float WeaponConfig::ammoPerSecond = 0.0f

Ammo drain rate (beam weapons only).

◆ autoLockBeam

bool WeaponConfig::autoLockBeam = false

True for Winston-style auto-lock beams: each tick picks the enemy closest to the crosshair inside coneHalfAngleDeg and within maxRange (with line-of-sight) and applies ramping damage.

When false the beam path uses the legacy straight-ray hitscan behaviour.

◆ chargeDamage

float WeaponConfig::chargeDamage = 0.0f

Damage dealt on release (charge weapons only).

◆ coneHalfAngleDeg

float WeaponConfig::coneHalfAngleDeg = 0.0f

Half-angle of the lock-on cone in degrees (auto-lock beams only).

◆ damage

float WeaponConfig::damage = 0.0f

◆ defaultAmmoCapacity

int WeaponConfig::defaultAmmoCapacity = 0

◆ dps

float WeaponConfig::dps = 0.0f

Damage per second (beam weapons only; discrete weapons use damage).

◆ dpsMax

float WeaponConfig::dpsMax = 0.0f

Ramp ceiling DPS reached after dpsRampTime of continuous lock.

0 = no ramp (flat dps). The beam ramps linearly from dps to dpsMax.

◆ dpsRampTime

float WeaponConfig::dpsRampTime = 0.0f

Seconds of continuous lock on the same target to reach dpsMax.

◆ explosive

bool WeaponConfig::explosive = false

◆ fireCooldown

float WeaponConfig::fireCooldown = 0.1f

◆ hitscan

bool WeaponConfig::hitscan = true

◆ hitscanRadius

float WeaponConfig::hitscanRadius = 0.0f

Hit-detection cylinder radius (world units) for hitscan weapons.

The shot is swept as a sphere of this radius along the aim ray ("cylinder hitreg") instead of an infinitely thin ray, so near-misses still land. 0 = exact ray (legacy behaviour). Only affects player hitboxes, not world geometry (bullets still need crosshair line-of-sight past walls).

◆ initialProjectileSpeed

float WeaponConfig::initialProjectileSpeed = 0.0f

◆ isBeam

bool WeaponConfig::isBeam = false

True for continuous beam weapons (no per-shot cooldown).

◆ isCharge

bool WeaponConfig::isCharge = false

True for charge weapons (hold to charge, release to fire).

◆ magazineSize

int WeaponConfig::magazineSize = 0

◆ maxChargeTime

float WeaponConfig::maxChargeTime = 0.0f

in seconds

◆ maxRange

float WeaponConfig::maxRange = 0.0f

Hard range cap (world units) for the auto-lock beam. 0 = unlimited.

◆ recoilFreeShots

int WeaponConfig::recoilFreeShots = 0

Shots before recoil kicks in (legacy formula path).

◆ recoilPatternScale

float WeaponConfig::recoilPatternScale = 0.0f

Closed-form pattern (R-301-style) scale; rad per pattern unit.

When > 0, the fire path evaluates the closed-form H(n)/V(n) function below instead of the legacy sin+exp formula. The pattern's domain is [1, 28] (user-provided shape), and we resample it across magazineSize shots — so firing the full mag walks the entire pattern from n=1 → n=28 with finer granularity than the original 28-shot Apex pattern. Pattern V units total 100 across the mag, so total vertical climb = 100 * scale radians.

◆ recoilPitchPerShot

float WeaponConfig::recoilPitchPerShot = 0.0f

Upward kick per shot (legacy formula path).

◆ recoilRampShots

float WeaponConfig::recoilRampShots = 1.0f

Curve shape / stem length (legacy formula path).

◆ recoilRecovery

float WeaponConfig::recoilRecovery = 0.0f

Heat decay per second (shared by both paths).

◆ recoilYawPerShot

float WeaponConfig::recoilYawPerShot = 0.0f

Horizontal swing strength (legacy formula path).

◆ reloadTime

float WeaponConfig::reloadTime = 0.0f

Time to complete a reload, in seconds.

◆ semiAuto

bool WeaponConfig::semiAuto = false

If true, fire requires trigger release between shots (pump/burst weapons).

◆ shieldDamageMultiplier

float WeaponConfig::shieldDamageMultiplier = 1.0f

Effectiveness multiplier against shield layers (overShield + armor).

1.0 = full; 0.2 = "energy-vs-energy" resistance (shields drain at 20%). Damage that reaches raw health is always dealt at full.


The documentation for this struct was generated from the following file: