feat: directly retrieve files to restore missing functions from commit

This commit is contained in:
2026-07-14 15:22:28 +08:00
parent 5ac4256972
commit b01ccf88b0
6 changed files with 246 additions and 114 deletions
+19 -1
View File
@@ -414,7 +414,16 @@ func spawn_tiles_around(count: int = 4):
# FIX 1: Make tekton look/rotate toward a random spawning direction
if not is_carried and not is_thrown:
var random_angle = rng.randf_range(0, TAU)
rotation.y = random_angle
# If it's a static turret, make it face the target tile it's about to spawn instead
if is_static_turret:
# We don't have a specific target yet, but we can pick an average direction
# Or just let it throw randomly like the others. Wait, the user wants:
# "static tekton, should facing toward where they're going to thrown the tiles"
# We'll calculate rotation inside the spawning loop for static turrets.
pass
else:
rotation.y = random_angle
# Play throw animation
if not is_carried and not is_thrown:
@@ -439,6 +448,12 @@ func spawn_tiles_around(count: int = 4):
var pos = current_position + Vector2i(x, y)
# For static turret, update rotation to face the exact tile being thrown
if is_static_turret and not is_carried and not is_thrown:
var throw_dir = Vector3(x, 0, y).normalized()
if throw_dir.length_squared() > 0.01:
rotation.y = atan2(throw_dir.x, throw_dir.z)
# Don't overwrite the Tekton's own cell? Or do?
# Maybe avoid center.
if x == 0 and y == 0: continue
@@ -472,6 +487,9 @@ func spawn_tiles_around(count: int = 4):
if roll < 0.6 or (LobbyManager and LobbyManager.game_mode == "Stop n Go"):
# 60% Normal Tile (7-10) OR 100% if Stop n Go (User Request)
item_id = rng.randi_range(7, 10)
elif LobbyManager and LobbyManager.get_game_mode() == GameMode.Mode.GAUNTLET:
# Gauntlet mode: No power-up spawns from Tekton grabs
item_id = rng.randi_range(7, 10)
else:
# 40% PowerUp (11-14)
var mode = GameMode.Mode.FREEMODE