feat: Introduce Tekton roaming NPC with grid movement, player interaction, tile spawning, and visual effects.

This commit is contained in:
Yogi Wiguna
2026-03-13 10:07:17 +08:00
parent 74a81425c5
commit 200e198428
4 changed files with 48 additions and 31 deletions
+10 -5
View File
@@ -392,7 +392,7 @@ func _execute_block_floor(target_pos: Vector2i = Vector2i.ZERO):
if "immutable_items" in enhanced_gridmap:
if original_item in enhanced_gridmap.immutable_items:
is_immutable = true
if original_item in [1, 2, 3, 4, 16] or is_immutable: continue
if original_item in [1, 2, 3, 4, 15, 16] or is_immutable: continue
batch_data.append({"x": block_pos.x, "y": 0, "z": block_pos.z, "item": 4})
@@ -442,6 +442,11 @@ func spawn_powerups_around(center: Vector2i, force_powerups: bool = true, only_c
# PROTECTED FLOOR CHECK: Don't spawn on existing walls or void
var f0 = enhanced_gridmap.get_cell_item(Vector3i(pos.x, 0, pos.y))
var f1 = enhanced_gridmap.get_cell_item(Vector3i(pos.x, 1, pos.y))
# Stop n Go: Don't overwrite static powerup spawns (ID 15 floor)
if LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO) and f0 == 15:
continue
if f0 in [4, -1] or f1 in [4, 16]:
continue
@@ -449,16 +454,16 @@ func spawn_powerups_around(center: Vector2i, force_powerups: bool = true, only_c
var mode = LobbyManager.get_game_mode()
if only_common or LobbyManager.is_game_mode(GameMode.Mode.STOP_N_GO):
# Spawn ONLY common tiles (7-10) for Stop n Go or if forced
# Spawn ONLY common tiles (7-10) in Stop n Go mode (User Request)
item_id = rng.randi_range(7, 10)
else:
# Free mode: 80% Chance for Common Tile (7-10), 20% for PowerUp
# Other modes: 80% Chance for Common Tile (7-10), 20% for PowerUp
if rng.randf() < 0.8:
item_id = rng.randi_range(7, 10)
else:
# 20% Chance for PowerUp
var is_restricted = GameMode.is_restricted(mode)
if is_restricted:
if LobbyManager.is_game_mode(GameMode.Mode.TEKTON_DOORS):
# Restrict to Speed (11) and Ghost (14) for Tekton Doors
item_id = [11, 14].pick_random()
else:
item_id = rng.randi_range(11, 14)