|
group2 0.1.0
CSE 125 Group 2
|
Player status manager system. More...
#include "PlayerStatusSystem.hpp"#include "AbilitySystem.hpp"#include "PowerupSpawnerSystem.hpp"#include "SDL3/SDL_log.h"#include "ecs/components/AbilityState.hpp"#include "ecs/components/CollisionShape.hpp"#include "ecs/components/DeathInfo.hpp"#include "ecs/components/DroppedWeapon.hpp"#include "ecs/components/GrenadeState.hpp"#include "ecs/components/Health.hpp"#include "ecs/components/Hitbox.hpp"#include "ecs/components/InputSnapshot.hpp"#include "ecs/components/Player.hpp"#include "ecs/components/PlayerMatchStats.hpp"#include "ecs/components/PlayerSimState.hpp"#include "ecs/components/Position.hpp"#include "ecs/components/PowerupState.hpp"#include "ecs/components/Ragdoll.hpp"#include "ecs/components/Renderable.hpp"#include "ecs/components/RespawnTimer.hpp"#include "ecs/components/RigidBody.hpp"#include "ecs/components/Velocity.hpp"#include "ecs/components/WeaponConfig.hpp"#include "ecs/components/WeaponState.hpp"#include "ecs/physics/SweptCollision.hpp"#include "ecs/physics/TitanfallConstants.hpp"#include "ecs/physics/WorldData.hpp"#include "ecs/registry/Registry.hpp"#include "ecs/systems/DroppedWeaponSystem.hpp"#include "ecs/systems/RagdollSystem.hpp"#include "network/NetKillEvent.hpp"#include <algorithm>#include <ecs/components/RespawnPoint.hpp>#include <limits>#include <random>#include <vector>Namespaces | |
| namespace | systems |
| Client-only input sampling system — split into two halves so mouse look can run every iterate() (smooth camera at any FPS) while movement keys run once per physics tick group (server-consistent). | |
Functions | |
| void | systems::applyHeal (float amount, Health &playerHealth) |
| float | systems::standingHalfHeight (const CollisionShape &shape) |
| physics::CapsuleShape | systems::spawnCapsuleFor (const CollisionShape &shape) |
| glm::vec3 | systems::resolveRespawnPosition (Registry ®istry, entt::entity player, glm::vec3 feetPosition) |
| SpawnResolution | systems::chooseRespawnPoint (Registry ®istry, entt::entity respawning) |
| Choose a respawn point with cooldown-aware, enemy-avoiding selection. | |
| SpawnResolution | systems::chooseAndResolveSpawnPosition (Registry ®istry, entt::entity player) |
| Pick a respawn point and resolve it to a safe spawn center. | |
| void | systems::handleRespawn (entt::entity &player, Registry ®istry) |
| Reset a dead player to a fresh spawn state. | |
| void | systems::handleDeath (entt::entity &player, Health &playerHealth, entt::entity &killer, Registry ®istry, std::vector< NetKillEvent > &killEvents, BodyRegion hitRegion) |
| Transition a player to the dead state if health has reached zero. | |
| void | systems::updateAbilityLevel (Registry ®istry, entt::entity player, float dmg) |
| float | systems::absorbDamage (float &pool, float damage) |
| float | systems::absorbDamageScaled (float &pool, float damage, float effectiveness) |
| Absorb damage through a shield pool with reduced effectiveness. | |
| void | systems::applyBulletSlow (entt::entity player, Registry ®istry) |
| Refresh the bullet-hit movement slow on a player. | |
| float | systems::applyDamage (float damage, entt::entity player, entt::entity &killer, Registry ®istry, std::vector< NetKillEvent > &killEvents, BodyRegion hitRegion=BodyRegion::UpperTorso, float shieldMultiplier=1.0f) |
| Apply damage to a player, splitting across armor then health. | |
| void | systems::handleHealing (Health &playerHealth, float dt) |
| Tick passive health regeneration after the heal cooldown expires. | |
| void | systems::runPlayerStatus (Registry ®istry, float dt) |
| Run one tick of player status: respawn timers and passive healing. | |
| void | systems::runSpawnPointCooldowns (Registry ®istry, float dt) |
| Tick spawn point cooldowns. | |
Variables | |
| constexpr float | systems::k_spawnPointCooldown = 5.0f |
| Cooldown duration set on a spawn point after a player spawns there. | |
| constexpr float | systems::k_spawnPushback = 0.03125f |
Player status manager system.