group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
PlayerStatusSystem.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
11
13namespace systems
14{
15const float armorMax = 100.0f;
16const float healthMax = 100.0f;
17const float overShieldMax = 200.0f;
18const float healCooldown = 5.0f;
19const float healingRate = 20.0f;
20
24void applyHeal(float amount, Health& playerHealth);
25
34void applyBulletSlow(entt::entity player, Registry& registry);
35
52float applyDamage(float damage,
53 entt::entity player,
54 entt::entity& killer,
55 Registry& registry,
56 std::vector<NetKillEvent>& killEvents,
58 int weaponId = -1,
59 float shieldMultiplier = 1.0f);
60
64void runPlayerStatus(Registry& registry, float dt);
65
70void runSpawnPointCooldowns(Registry& registry, float dt);
71
74{
75 glm::vec3 center{0.0f};
76 float yaw = 0.0f;
77};
78
91SpawnResolution chooseAndResolveSpawnPosition(Registry& registry, entt::entity player);
92} // namespace systems
Player health and armor.
Skeleton-driven hitbox types: body regions, capsule definitions, damage profiles, and per-entity runt...
BodyRegion
Body regions.
Definition Hitbox.hpp:23
@ UpperTorso
Definition Hitbox.hpp:26
Structure of kill event broadcasted from server to clients.
Shared ECS registry type alias for the game engine.
entt::registry Registry
Shared ECS registry type alias.
Definition Registry.hpp:11
Static gameplay tuning data for each weapon type.
Client-only input sampling system — split into two halves so mouse look can run every iterate() (smoo...
Definition DebugUI.hpp:15
SpawnResolution chooseAndResolveSpawnPosition(Registry &registry, entt::entity player)
Pick a respawn point and resolve it to a safe spawn center.
Definition PlayerStatusSystem.cpp:201
void runPlayerStatus(Registry &registry, float dt)
Run one tick of player status: respawn timers and passive healing.
Definition PlayerStatusSystem.cpp:472
const float healthMax
Maximum health value.
Definition PlayerStatusSystem.hpp:16
void applyHeal(float amount, Health &playerHealth)
Definition PlayerStatusSystem.cpp:46
void runSpawnPointCooldowns(Registry &registry, float dt)
Tick spawn point cooldowns.
Definition PlayerStatusSystem.cpp:509
const float healingRate
Passive healing amount per second.
Definition PlayerStatusSystem.hpp:19
void applyBulletSlow(entt::entity player, Registry &registry)
Refresh the bullet-hit movement slow on a player.
Definition PlayerStatusSystem.cpp:402
float applyDamage(float damage, entt::entity player, entt::entity &killer, Registry &registry, std::vector< NetKillEvent > &killEvents, BodyRegion hitRegion, int weaponId, float shieldMultiplier)
Apply damage to a player, splitting across armor then health.
Definition PlayerStatusSystem.cpp:412
const float armorMax
Maximum armor value.
Definition PlayerStatusSystem.hpp:15
const float healCooldown
Seconds after last damage before passive healing starts.
Definition PlayerStatusSystem.hpp:18
const float overShieldMax
Definition PlayerStatusSystem.hpp:17
ECS component: player health, armor, and passive heal cooldown.
Definition Health.hpp:8
A resolved spawn: safe center position plus the point's facing yaw.
Definition PlayerStatusSystem.hpp:74
glm::vec3 center
Definition PlayerStatusSystem.hpp:75
float yaw
Authored facing direction (radians) for the chosen spawn point.
Definition PlayerStatusSystem.hpp:76