Updating HUD, Gold Config, and finishing off Play flow for 9player map.

This commit is contained in:
Matt F 2026-05-22 12:18:23 -07:00
parent a7be12fa9b
commit 3dcc0e7edd
28 changed files with 2272 additions and 9601 deletions

View file

@ -64,15 +64,15 @@ namespace TD.Gameplay
// ----- Pre-spawn init (server-local) ----------------------------------
private float pendingMaxHp = 100f;
private int pendingGoldReward;
private int pendingLivesCost = 1;
private bool pendingIsFlying;
private bool hasPendingInit;
// ----- Server-local runtime state -------------------------------------
/// <summary>Gold awarded to the killing player when this enemy dies.</summary>
public int GoldReward { get; private set; }
// Kill gold is no longer carried per-enemy — it comes from
// GoldConfig.Waves[currentWaveIndex].GoldPerEnemy at the moment the kill
// is registered. See WaveManager.HandleEnemyKilled.
/// <summary>Lives deducted from the shared pool when this enemy reaches the goal.</summary>
public int LivesCost { get; private set; } = 1;
@ -126,18 +126,16 @@ namespace TD.Gameplay
/// and before <c>NetworkObject.Spawn()</c>. Mirrors the
/// <c>TowerInstance.InitializeServer</c> pattern.
/// </summary>
public void InitializeServer(float maxHp, int goldReward, int livesCost, bool flying)
public void InitializeServer(float maxHp, int livesCost, bool flying)
{
pendingMaxHp = maxHp;
pendingGoldReward = goldReward;
pendingLivesCost = livesCost;
pendingIsFlying = flying;
hasPendingInit = true;
// Cache locally on the server immediately — clients resolve via NV.
MaxHp = maxHp;
GoldReward = goldReward;
LivesCost = livesCost;
MaxHp = maxHp;
LivesCost = livesCost;
}
// ----- NGO lifecycle --------------------------------------------------