t_p2: Add team, spawn, and buy-zone system

- team_data.gd: Team enum (SPECTATOR/CT/Terrorist), constants for names,
  colors, starting money, and spawn groups; TeamData resource class
- team_manager.gd: Player-to-team assignment, auto-balancing, score
  tracking; round-independent (persists across rounds)
- spawn_manager.gd: Scans scene for Marker3D nodes in spawn_points_ct
  and spawn_points_t groups; selects valid spawns (farthest from enemies
  with proximity check, fallback to first available)
- buy_zone.gd: Area3D-based trigger zone with team filtering, player
  enter/exit tracking and signals
- test_range.tscn: Added 2 CT spawn markers and 2 T spawn markers with
  appropriate groups
This commit is contained in:
2026-07-01 20:24:16 -04:00
parent f6d69545c9
commit 46ff83325f
5 changed files with 803 additions and 1 deletions
+23 -1
View File
@@ -74,13 +74,35 @@ directional_shadow_split_3 = 0.6
directional_shadow_blend_splits = true
; === Spawn Point ===
; === Spawn Points ===
[node name="SpawnPoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -30, 0.5, 0)
groups = ["spawn_points"]
; === CT Spawn Points (Counter-Terrorist) ===
[node name="CTSpawn_01" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -30, 0.5, -10)
groups = ["spawn_points_ct"]
[node name="CTSpawn_02" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0.5, -15)
groups = ["spawn_points_ct"]
; === T Spawn Points (Terrorist) ===
[node name="TSpawn_01" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 25, 0.5, 25)
groups = ["spawn_points_t"]
[node name="TSpawn_02" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 30, 0.5, 20)
groups = ["spawn_points_t"]
; === Open Area Floor (80×80) ===
[node name="Floor" type="CSGBox3D" parent="."]