Merge branch 'EOS' of https://github.com/adtpdn/tekton-enet into EOS
This commit is contained in:
Binary file not shown.
@@ -964,6 +964,7 @@ grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="ActionButtonContainer" type="VBoxContainer" parent="ActionMenu"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
@@ -974,11 +975,13 @@ layout_mode = 2
|
||||
text = "Move"
|
||||
|
||||
[node name="GrabButton" type="Button" parent="ActionMenu/ActionButtonContainer"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
text = "Grab"
|
||||
|
||||
[node name="PutButton" type="Button" parent="ActionMenu/ActionButtonContainer"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
text = "Put"
|
||||
|
||||
@@ -47,13 +47,17 @@ func simple_move_to(grid_position: Vector2i) -> bool:
|
||||
if distance != 1:
|
||||
return false # Only single-step moves allowed
|
||||
|
||||
# Check if target position is within grid bounds
|
||||
if not enhanced_gridmap.is_position_valid(grid_position):
|
||||
return false
|
||||
|
||||
# Check for finish line logic (delegated back to player or race manager)
|
||||
if player.has_method("can_move_to_finish") and not player.can_move_to_finish(grid_position):
|
||||
return false
|
||||
|
||||
# Check walkability and obstacles
|
||||
var cell_item = enhanced_gridmap.get_cell_item(Vector3i(grid_position.x, 0, grid_position.y))
|
||||
if cell_item in enhanced_gridmap.non_walkable_items or player.is_position_occupied(grid_position):
|
||||
if cell_item == -1 or cell_item in enhanced_gridmap.non_walkable_items or player.is_position_occupied(grid_position):
|
||||
return false
|
||||
|
||||
if enhanced_gridmap.is_blocked_by_obstacle(player.current_position, grid_position, 3):
|
||||
@@ -75,6 +79,10 @@ func move_to_clicked_position(grid_position: Vector2i) -> bool:
|
||||
if not player.is_multiplayer_authority() or is_moving or player.action_points <= 0:
|
||||
return false
|
||||
|
||||
# Validate grid position is within bounds
|
||||
if not enhanced_gridmap.is_position_valid(grid_position):
|
||||
return false
|
||||
|
||||
# Check finish line logic
|
||||
if player.has_method("can_move_to_finish") and not player.can_move_to_finish(grid_position):
|
||||
return false
|
||||
@@ -122,9 +130,9 @@ func highlight_movement_range():
|
||||
blocked_cells.append_array(enhanced_gridmap.get_cells_blocked_by_obstacle(cell_pos, orientation, 3))
|
||||
|
||||
# Now highlight all cells within movement range that aren't blocked
|
||||
for x in range(max(0, player.current_position.x - movement_range),
|
||||
for x in range(max(0, player.current_position.x - movement_range),
|
||||
min(enhanced_gridmap.columns, player.current_position.x + movement_range + 1)):
|
||||
for z in range(max(0, player.current_position.y - movement_range),
|
||||
for z in range(max(0, player.current_position.y - movement_range),
|
||||
min(enhanced_gridmap.rows, player.current_position.y + movement_range + 1)):
|
||||
var test_pos = Vector2i(x, z)
|
||||
|
||||
@@ -171,18 +179,18 @@ func can_reach_cell(target_pos: Vector2i, blocked_cells: Array) -> bool:
|
||||
|
||||
# Try all adjacent cells
|
||||
var directions = [
|
||||
Vector2i(0, -1), # North
|
||||
Vector2i(1, 0), # East
|
||||
Vector2i(0, 1), # South
|
||||
Vector2i(-1, 0), # West
|
||||
Vector2i(0, -1), # North
|
||||
Vector2i(1, 0), # East
|
||||
Vector2i(0, 1), # South
|
||||
Vector2i(-1, 0), # West
|
||||
]
|
||||
|
||||
# Add diagonal directions if enabled
|
||||
if enhanced_gridmap.diagonal_movement:
|
||||
directions.append(Vector2i(-1, -1)) # Northwest
|
||||
directions.append(Vector2i(1, -1)) # Northeast
|
||||
directions.append(Vector2i(-1, 1)) # Southwest
|
||||
directions.append(Vector2i(1, 1)) # Southeast
|
||||
directions.append(Vector2i(-1, -1)) # Northwest
|
||||
directions.append(Vector2i(1, -1)) # Northeast
|
||||
directions.append(Vector2i(-1, 1)) # Southwest
|
||||
directions.append(Vector2i(1, 1)) # Southeast
|
||||
|
||||
for dir in directions:
|
||||
var next_pos = current + dir
|
||||
|
||||
Reference in New Issue
Block a user