LANTERN purge B2: delete EB-2 turret defense

TurretFireSystem, TurretAuthoring, Turret.prefab, Turret component, turret cap,
B hotkey, HUD Charge chip + out-of-ammo cue, catalog entry, Tuning consts, tests
(-7, 452 green). StructureType.Turret byte + ResourceId.Charge stay reserved.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 14:40:12 -07:00
parent a0f6d4a5c4
commit 835dace213
15 changed files with 15 additions and 692 deletions
@@ -13,12 +13,6 @@ namespace ProjectM.Authoring
/// </summary>
public class StructureCatalogAuthoring : MonoBehaviour
{
[Tooltip("Turret structure ghost prefab (TurretAuthoring + GhostAuthoring).")]
public GameObject TurretPrefab;
[Tooltip("Ore cost to build a turret.")]
[Min(0)] public int TurretCostOre = 40; // DR-042 combat pass: was 10 (~1/3 node) -> 40 (~1.3 nodes); a real investment
[Tooltip("Wall structure ghost prefab (StructureAuthoring{Wall} + GhostAuthoring).")]
public GameObject WallPrefab;
@@ -39,16 +33,6 @@ namespace ProjectM.Authoring
AddComponent<StructureCatalog>(entity);
var buf = AddBuffer<StructureCatalogEntry>(entity);
if (authoring.TurretPrefab != null)
{
buf.Add(new StructureCatalogEntry
{
Type = StructureType.Turret,
Prefab = GetEntity(authoring.TurretPrefab, TransformUsageFlags.Dynamic),
CostResourceId = ResourceId.Ore,
CostAmount = authoring.TurretCostOre,
});
}
if (authoring.WallPrefab != null)
{
buf.Add(new StructureCatalogEntry
@@ -1,39 +0,0 @@
using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
/// <summary>
/// Authoring for the turret structure ghost prefab (duplicate UpgradePickup.prefab so the ownerless
/// interpolated GhostAuthoringComponent comes free). Bakes <see cref="PlacedStructure"/>{Type=Turret} +
/// <see cref="Turret"/> stats. BuildPlaceSystem stamps Cell + LastProcessedTick at placement.
/// </summary>
public class TurretAuthoring : MonoBehaviour
{
[Min(1f)] public float Range = 10f;
[Min(1)] public int CooldownTicks = 30;
[Min(1f)] public float Damage = 12f;
[Min(1f)] public float MaxHp = 120f;
private class TurretBaker : Baker<TurretAuthoring>
{
public override void Bake(TurretAuthoring authoring)
{
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
this.AddPlacedStructure(entity, StructureType.Turret);
AddComponent(entity, new Turret
{
Range = authoring.Range,
CooldownTicks = authoring.CooldownTicks,
Damage = authoring.Damage,
});
// EB-1: structures are damageable + destructible (Husks push for them; HealthApplyDamageSystem
// destroys a Destructible at Health<=0). The DamageEvent buffer MUST exist on the archetype or an
// AI/turret strike crashes at ECB playback. NO HitRadius on purpose -> ProjectileDamageSystem (needs
// Health+HitRadius) ignores structures, so player shots never friendly-fire your own turret.
this.AddDamageable(entity, authoring.MaxHp);
}
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: dfb1e0820cbf41b4bbbe99066dfadd40