|
R-Type
Distributed multiplayer game engine in C++
|
System managing buff timers and applying buff effects. More...
#include <BuffSystem.hpp>


Public Member Functions | |
| BuffSystem ()=default | |
| Constructs a BuffSystem. | |
| ~BuffSystem () override=default | |
| Destructor. | |
| void | update (Registry ®istry, float deltaTime) override |
| Update buff timers and apply effects. | |
| ComponentMask | getComponentMask () const override |
| Gets the component mask for this system. | |
Public Member Functions inherited from ecs::ISystem | |
| virtual | ~ISystem ()=default |
| Virtual destructor. | |
Private Member Functions | |
| void | _updateBuffTimers (Buff &buff, float deltaTime) |
| Update buff timers and remove expired ones. | |
| void | _applyBuffEffects (Address address, Registry ®istry, const Buff &buff) |
| Apply buff effects to entity stats. | |
| void | _applySpeedBoost (Velocity &velocity, float multiplier) |
| Apply speed buff multiplier. | |
| void | _applyDamageBoost (Weapon &weapon, float multiplier) |
| Apply damage buff multiplier. | |
| void | _applyFireRateBoost (Weapon &weapon, float multiplier) |
| Apply fire rate buff multiplier. | |
| void | _applyShield (Health &health, float duration) |
| Apply shield (invincibility) | |
| void | _applyHealthRegen (Health &health, float deltaTime, float regenRate) |
| Apply health regeneration. | |
System managing buff timers and applying buff effects.
Updates buff durations, applies stat modifications, and removes expired buffs. Handles both temporary and permanent buffs with different behaviors.
Definition at line 26 of file BuffSystem.hpp.
|
default |
Constructs a BuffSystem.
|
overridedefault |
Destructor.
|
private |
Apply buff effects to entity stats.
Definition at line 87 of file BuffSystem.cpp.
References ecs::Buff::getBuffs(), ecs::Registry::getComponent(), and ecs::Registry::hasComponent().
Referenced by update().

|
private |
Apply damage buff multiplier.
| weapon | Weapon component |
| multiplier | Damage multiplier |
Definition at line 152 of file BuffSystem.cpp.
References ecs::Weapon::getBaseDamage(), and ecs::Weapon::setDamage().

|
private |
Apply fire rate buff multiplier.
| weapon | Weapon component |
| multiplier | Fire rate multiplier |
Definition at line 159 of file BuffSystem.cpp.
References ecs::Weapon::getBaseFireRate(), and ecs::Weapon::setFireRate().

|
private |
Apply health regeneration.
Definition at line 173 of file BuffSystem.cpp.
References ecs::Health::getCurrentHealth(), ecs::Health::getMaxHealth(), and ecs::Health::setCurrentHealth().

|
private |
Apply shield (invincibility)
| health | Health component |
| duration | Remaining shield duration |
Definition at line 166 of file BuffSystem.cpp.
References ecs::Health::setInvincibilityTimer(), and ecs::Health::setInvincible().

|
private |
Apply speed buff multiplier.
| velocity | Velocity component |
| multiplier | Speed multiplier |
Definition at line 145 of file BuffSystem.cpp.
References ecs::Velocity::getBaseSpeed(), and ecs::Velocity::setSpeed().

|
private |
Update buff timers and remove expired ones.
| buff | Buff component to update |
| deltaTime | Time elapsed |
Definition at line 42 of file BuffSystem.cpp.
References ecs::DamageBoost, ecs::BuffInstance::duration, ecs::FireRateBoost, ecs::Buff::getBuffsMutable(), ecs::HealthRegen, LOG_INFO, ecs::Shield, ecs::SpeedBoost, and ecs::BuffInstance::type.
Referenced by update().

|
overridevirtual |
Gets the component mask for this system.
Processes entities with Buff component.
Implements ecs::ISystem.
Definition at line 36 of file BuffSystem.cpp.
|
overridevirtual |
Update buff timers and apply effects.
Decrements buff durations, removes expired buffs, and applies stat modifications to entities based on their active buffs.
| registry | Reference to the ECS registry |
| deltaTime | Time elapsed since last frame (in seconds) |
Implements ecs::ISystem.
Definition at line 14 of file BuffSystem.cpp.
References _applyBuffEffects(), _updateBuffTimers(), ecs::Registry::getComponent(), ecs::Buff::hasAnyBuffs(), ecs::Registry::removeComponent(), and ecs::Registry::view().
