37 Weapon(
float fireRate,
float cooldown,
int projectileType,
int damage)
141 _chargeLevel = (level < 0.0F) ? 0.0F : (level > 1.0F) ? 1.0F : level;
Base interface for all ECS components.
Component for entities capable of shooting projectiles.
float getBaseFireRate() const
Get base fire rate (before buffs).
bool isCharging() const
Check if weapon is currently charging.
void setFireRate(float fireRate)
Set fire rate.
float getChargeRate() const
Get charge rate (how fast the weapon charges).
void setCharging(bool charging)
Set charging state.
float _chargeRate
How fast the weapon charges per second.
float getCooldown() const
Get current cooldown.
float getChargeLevel() const
Get current charge level.
void setProjectileType(int projectileType)
Set projectile type.
int getProjectileType() const
Get projectile type.
float _chargeLevel
Current charge level (0.0 to 1.0)
bool _isCharging
Whether the weapon is currently charging.
float getDamage() const
Get damage value.
int _projectileType
Type of projectile spawned.
void setShouldShoot(bool shouldShoot)
Set whether the weapon should shoot.
void setDamage(float damage)
Set damage value.
~Weapon() override=default
int getBaseDamage() const
Get base damage (before buffs).
float _fireRate
Shots per second.
Weapon(float fireRate, float cooldown, int projectileType, int damage)
Constructor with weapon parameters.
int _baseDamage
Base damage (before buffs)
float _baseFireRate
Base fire rate (before buffs)
float getFireRate() const
Get fire rate.
bool _shouldShoot
Whether the weapon is currently set to shoot.
void setChargeRate(float rate)
Set charge rate.
bool shouldShoot() const
Check if the weapon should shoot.
float _cooldown
Current cooldown timer in seconds.
void setChargeLevel(float level)
Set charge level.
void setCooldown(float cooldown)
Set cooldown timer.
float _damage
Base damage dealt.
ComponentType getType() const override
Get the component type ID.
Maximum number of distinct component types supported by the Registry.
std::size_t ComponentType
Type alias for component identification.