From bb4da72c472e9c1884c58cbe831d62e28e59f1ed Mon Sep 17 00:00:00 2001 From: akshay Date: Sun, 21 Aug 2022 14:42:40 -0400 Subject: [PATCH] Added status lights on power station. Adjusted the crafting bench item holder positions --- scenes/main.tscn | 19 +++++++++++++++++++ scenes/power_station.tscn | 12 +++++++++++- scripts/power_station.gd | 9 +++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/scenes/main.tscn b/scenes/main.tscn index 8723a42..3d1b391 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -190,11 +190,13 @@ anims/switch_camera = SubResource( 9 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0224032, 4.20288, 4.77208 ) shadow_enabled = true omni_range = 10.7698 +omni_attenuation = 1.46409 [node name="Hub2" type="OmniLight" parent="lights"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0765934, 4.20288, -4.81973 ) shadow_enabled = true omni_range = 10.7698 +omni_attenuation = 1.46409 [node name="light_galley" type="OmniLight" parent="lights"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.329, -16.3 ) @@ -267,6 +269,15 @@ transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 1, 0 ) time_to_generate = 5.0 current_holding = 1 +[node name="status_light" parent="power_station" index="3"] +transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, -0.0245359, 0.549091, 0.777384 ) + +[node name="status_light2" parent="power_station" index="4"] +transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0.734025, 0.549411, -0.434729 ) + +[node name="status_light3" parent="power_station" index="5"] +transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, -0.763649, 0.549411, -0.436109 ) + [node name="Ore_Conveyor_Room" type="Spatial" parent="."] transform = Transform( 0.734891, 0, -0.678185, 0, 1, 0, 0.678185, 0, 0.734891, 6.26237, 0, -5.87466 ) @@ -335,6 +346,12 @@ start_broken = false recipes = ExtResource( 20 ) gen_time = 20.0 +[node name="item_slot_1" parent="Crafting_Room/crafting_station" index="0"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0548649, -0.115891, 4.6198 ) + +[node name="item_slot_2" parent="Crafting_Room/crafting_station" index="1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0999622, -0.115891, 2.03473 ) + [node name="Machine_Label" type="Label3D" parent="Crafting_Room/crafting_station"] transform = Transform( -1.3411e-07, 0, 3, 0, 3, 0, -3, 0, -1.3411e-07, -1.295, 3, 1.998 ) visible = false @@ -474,3 +491,5 @@ layer = 10 [connection signal="comms_established" from="Communications/comm_station" to="game_manager" method="_on_comm_station_comms_established"] [editable path="Level"] +[editable path="power_station"] +[editable path="Crafting_Room/crafting_station"] diff --git a/scenes/power_station.tscn b/scenes/power_station.tscn index 148cac9..f039328 100644 --- a/scenes/power_station.tscn +++ b/scenes/power_station.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://scripts/power_station.gd" type="Script" id=1] +[ext_resource path="res://scenes/status_light.tscn" type="PackedScene" id=2] [ext_resource path="res://assets/sound/forceField_004.ogg" type="AudioStream" id=3] [ext_resource path="res://assets/sound/error_008.ogg" type="AudioStream" id=4] @@ -29,3 +30,12 @@ stream = ExtResource( 3 ) [node name="error" type="AudioStreamPlayer" parent="sounds"] stream = ExtResource( 4 ) + +[node name="status_light" parent="." groups=["rtg_lights"] instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.82126, 1.34568, 0 ) + +[node name="status_light2" parent="." groups=["rtg_lights"] instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.454, 1.346, -3.432 ) + +[node name="status_light3" parent="." groups=["rtg_lights"] instance=ExtResource( 2 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.45423, 1.346, 3.43208 ) diff --git a/scripts/power_station.gd b/scripts/power_station.gd index 824982d..5024443 100644 --- a/scripts/power_station.gd +++ b/scripts/power_station.gd @@ -6,11 +6,18 @@ export var time_to_generate : float = 120 export var current_holding : int = 0 setget set_current_holding var current_timer : float = 0 +var rtg_lights = [] + func set_current_holding(new_value): current_holding = new_value + if new_value > 0: + for light in rtg_lights: + light.activate() $CointCount.text = "Charge Count: %d" % current_holding func _ready(): + rtg_lights = get_tree().get_nodes_in_group("rtg_lights") + assert(rtg_lights != null) set_current_holding(current_holding) func _process(delta): @@ -39,4 +46,6 @@ func on_player_interact(player) -> bool: player.modify_inventory("coins", charges) $sounds/charge_get.play() + for light in rtg_lights: + light.warn() return true