change repair_tool application and add beams for salvager and repair_tool
This commit is contained in:
@@ -10,8 +10,6 @@
|
||||
#include "tracing.h"
|
||||
#include "WeaponComponent.h"
|
||||
|
||||
static constexpr Tick kWeaponImpactDelayTicks = 5;
|
||||
|
||||
CombatSystem::CombatSystem(const GameConfig& config)
|
||||
: m_config(config)
|
||||
{
|
||||
@@ -20,7 +18,7 @@ CombatSystem::CombatSystem(const GameConfig& config)
|
||||
void CombatSystem::tick(Tick currentTick,
|
||||
EntityAdmin& admin,
|
||||
BuildingSystem& /*buildings*/,
|
||||
std::vector<WeaponFiredEvent>& outWeaponFiredEvents)
|
||||
std::vector<BeamFiredEvent>& outBeamFiredEvents)
|
||||
{
|
||||
TRACE();
|
||||
// All weapons (ships and stations) are child entities linked via ModuleOwnerComponent.
|
||||
@@ -31,7 +29,7 @@ void CombatSystem::tick(Tick currentTick,
|
||||
{
|
||||
const PositionComponent& pos = admin.get<PositionComponent>(owner.owner);
|
||||
const FactionComponent& faction = admin.get<FactionComponent>(owner.owner);
|
||||
resolveWeapon(owner.owner, weapon, pos, faction, currentTick, admin, outWeaponFiredEvents);
|
||||
resolveWeapon(owner.owner, weapon, pos, faction, currentTick, admin, outBeamFiredEvents);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,7 +40,7 @@ void CombatSystem::resolveWeapon(
|
||||
const FactionComponent& ownFaction,
|
||||
Tick currentTick,
|
||||
EntityAdmin& admin,
|
||||
std::vector<WeaponFiredEvent>& out)
|
||||
std::vector<BeamFiredEvent>& out)
|
||||
{
|
||||
if (weapon.cooldownTicks > 0.0f)
|
||||
{
|
||||
@@ -109,9 +107,10 @@ void CombatSystem::resolveWeapon(
|
||||
|
||||
const entt::entity targetEntity = *weapon.currentTarget;
|
||||
m_pendingDamage.push_back({targetEntity, weapon.damage,
|
||||
currentTick + kWeaponImpactDelayTicks});
|
||||
currentTick + kBeamImpactDelayTicks});
|
||||
|
||||
WeaponFiredEvent evt;
|
||||
BeamFiredEvent evt;
|
||||
evt.kind = BeamKind::Weapon;
|
||||
evt.shooter = shipEntity;
|
||||
evt.target = targetEntity;
|
||||
evt.emittedAt = currentTick;
|
||||
|
||||
Reference in New Issue
Block a user