This commit is contained in:
2026-07-04 16:57:40 -07:00
parent 16e396841e
commit c6b7890212
47 changed files with 1713 additions and 209 deletions
@@ -23,6 +23,7 @@ namespace ProjectM.Authoring
[Min(1)] public int PeriodTicks = 30;
[Tooltip("EB-2: 1 = ledger-fed (consume the input from the shared ledger; no conveyor). 0 = M7 MachineInput chain.")]
public byte InputFromLedger = 1;
[Min(1f)] public float MaxHp = 120f;
private class FabricatorBaker : Baker<FabricatorAuthoring>
{
@@ -46,6 +47,14 @@ namespace ProjectM.Authoring
InputFromLedger = authoring.InputFromLedger,
});
AddBuffer<MachineInput>(entity);
// EB-1 parity (DR-032): machines can die. Without Health this baker left the Fabricator OUT of
// the EnemyAISystem fortress-aggro snapshot entirely (its query keys on Health) — an invulnerable
// machine, diverging from DR-032. Now that it IS targetable, the DamageEvent buffer must exist
// (an AI strike appends into it; absent = ECB-playback throw) + Destructible lets
// HealthApplyDamageSystem destroy it at 0 (occupancy auto-frees).
AddComponent(entity, new Health { Current = authoring.MaxHp, Max = authoring.MaxHp });
AddBuffer<DamageEvent>(entity);
AddComponent<Destructible>(entity);
}
}
}