Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
SimpleWeapon.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** Air-Trap
4** File description:
5** Weapon
6*/
7
8#pragma once
9
10#include <cstdint>
11
12namespace rtp::ecs::components {
13
18enum class WeaponKind : uint8_t {
19 Classic = 0,
20 Beam = 1,
21 Paddle = 2,
22 Tracker = 3,
23 Boomerang = 4
24};
25
32 float fireRate{0.3f};
33 float lastShotTime{0.0f};
34 int damage{10};
36 // Ammo system
37 int ammo{-1};
38 int maxAmmo{-1};
40 // Special properties (interpreted per kind)
41 float beamDuration{0.0f};
42 float beamCooldown{0.0f};
43 float beamActiveTime{0.0f};
44 bool beamActive{false};
46 bool beamWasDouble{false};
48 int difficulty{2};
50 // Reflect feature removed
51 bool homing{false};
52 float homingSteering{3.0f};
53 float homingRange{600.0f};
54 bool isBoomerang{false};
55 bool boomerangOut{false};
56};
57
58} // namespace rtp::ecs::components
File : Ammo.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue.hajjar-llauquen@epitech...
Definition Ammo.hpp:13
WeaponKind
Types of player weapons.
@ Tracker
Weak auto-homing shots.
@ Classic
Default spam/charge laser.
@ Beam
Continuous beam 5s active, 5s cooldown.
@ Paddle
Melee reflector in front of ship.
Marks a projectile as a boomerang and stores state for return logic.
Definition Boomerang.hpp:16
Component representing a weapon configuration.
int difficulty
Difficulty to use this weapon (1-5)
float beamCooldown
Beam cooldown time (Beam)
bool boomerangOut
Boomerang currently flying.
int maxAmmo
Max ammo (-1 = infinite)
bool isBoomerang
Projectile returns (Boomerang)
float beamActiveTime
Current beam activity timer.
int ammo
Current ammo (-1 = infinite)
float homingSteering
Steering factor for homing bullets.
float beamCooldownRemaining
Remaining cooldown for beam (runtime)
float beamDuration
Beam active time (Beam)
float fireRate
Shots per second (or cooldown)
bool beamActive
Is beam currently firing.
bool homing
Shots home to enemies (Tracker)
float lastShotTime
Time since last shot.
bool beamWasDouble
Was the beam started as double-fire.
float homingRange
Detection range for homing bullets.