fixed building walls and moving cassettes around

This commit is contained in:
2026-02-11 09:49:03 +11:00
parent efd6414dfb
commit 78beaca893
5 changed files with 21 additions and 39 deletions

View File

@@ -32,7 +32,9 @@ func set_float(value: float) -> void:
$MeshInstance3D.material_override.set("shader_parameter/Float", value)
func add_card(card: Card, caller_id: int) -> void:
@rpc("reliable", "call_local", "any_peer")
func networked_spawn_tower(card_index: int, caller_id: int) -> void:
var card: Card = Data.cards[card_index]
inventory.add(card)
tower = inventory.item_at(0).turret_scene.instantiate() as Tower
tower.stats = inventory.item_at(0).tower_stats
@@ -42,17 +44,16 @@ func add_card(card: Card, caller_id: int) -> void:
tower.position = Vector3(0, 1.2, 0)
minimap_icon.modulate = Color.RED
duration = 999
#enable_duration_sprites()
add_child(tower)
func remove_card() -> void:
@rpc("reliable", "call_local", "any_peer")
func networked_remove_tower() -> void:
var card: Card = inventory.remove_at(0)
if !game_manager.card_gameplay:
game_manager.connected_players_nodes[tower.owner_id].add_card(card)
game_manager.connected_players_nodes[tower.owner_id].unready_self()
tower.queue_free()
#disable_duration_sprites()
tower = null
minimap_icon.modulate = Color.GREEN
@@ -75,31 +76,3 @@ func enable_duration_sprites() -> void:
func disable_duration_sprites() -> void:
for sprite: Sprite3D in duration_sprites:
sprite.visible = false
@rpc("reliable", "call_local", "any_peer")
func networked_spawn_tower(card_index: int, caller_id: int) -> void:
var card: Card = Data.cards[card_index]
inventory.add(card)
tower = inventory.item_at(0).turret_scene.instantiate() as Tower
tower.stats = inventory.item_at(0).tower_stats
tower.name = "tower"
tower.base_name = name
tower.owner_id = caller_id
tower.position = Vector3(0, 1.2, 0)
minimap_icon.modulate = Color.RED
duration = 999
#enable_duration_sprites()
add_child(tower)
@rpc("reliable", "call_local", "any_peer")
func networked_remove_tower() -> void:
var card: Card = inventory.remove_at(0)
if !game_manager.card_gameplay:
game_manager.connected_players_nodes[tower.owner_id].add_card(card)
game_manager.connected_players_nodes[tower.owner_id].unready_self()
tower.queue_free()
#disable_duration_sprites()
tower = null
minimap_icon.modulate = Color.GREEN