## FreeFTF ## Copyright (C) 2024 Interstellar Development ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . extends StaticBody3D const TARGET = 100 var current = 0 var pc_occupied = 0 var pc_body = [] func _ready(): Game.computers += 1 func _on_computer_tick_timeout(): if Game.is_server: current += pc_occupied for id in Game.player_list: Client.rpc_id(id,"sync_computers",get_path(), current) if current >= TARGET: current = "Complete" $computer_tick.stop() Game.computers -= 1 $pc_1/Label3D.text = str(current) $pc_2/Label3D.text = str(current) $pc_3/Label3D.text = str(current) func _on_pc_1_area_body_entered(body): if pc_occupied < 3 and body is CharacterBody3D and !body.beast and body not in pc_body: pc_occupied += 1 pc_body.append(body) func _on_pc_1_area_body_exited(body): if pc_occupied < 3 and body is CharacterBody3D and body in pc_body: pc_occupied -= 1 pc_body.erase(body)