diff --git a/assets/sprout.png b/assets/sprout.png deleted file mode 100644 index 3637fad..0000000 Binary files a/assets/sprout.png and /dev/null differ diff --git a/assets/sprout1.png b/assets/sprout1.png new file mode 100644 index 0000000..2824ce1 Binary files /dev/null and b/assets/sprout1.png differ diff --git a/assets/sprout.png.import b/assets/sprout1.png.import similarity index 73% rename from assets/sprout.png.import rename to assets/sprout1.png.import index 233f2ef..51e953c 100644 --- a/assets/sprout.png.import +++ b/assets/sprout1.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://d35y5ckne72qe" -path="res://.godot/imported/sprout.png-98a4ab515d3bfdbd6f6db7d14b52ead7.ctex" +path="res://.godot/imported/sprout1.png-dff2839b1c813110ff5aa31e8e7778fa.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/sprout.png" -dest_files=["res://.godot/imported/sprout.png-98a4ab515d3bfdbd6f6db7d14b52ead7.ctex"] +source_file="res://assets/sprout1.png" +dest_files=["res://.godot/imported/sprout1.png-dff2839b1c813110ff5aa31e8e7778fa.ctex"] [params] diff --git a/assets/sprout2.png b/assets/sprout2.png new file mode 100644 index 0000000..fe84fea Binary files /dev/null and b/assets/sprout2.png differ diff --git a/assets/sprout2.png.import b/assets/sprout2.png.import new file mode 100644 index 0000000..b20ba83 --- /dev/null +++ b/assets/sprout2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cry83nqqrybsl" +path="res://.godot/imported/sprout2.png-78a96837ad5731e502156d9c69e4b8bd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprout2.png" +dest_files=["res://.godot/imported/sprout2.png-78a96837ad5731e502156d9c69e4b8bd.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/sprout3.png b/assets/sprout3.png new file mode 100644 index 0000000..69e0cbd Binary files /dev/null and b/assets/sprout3.png differ diff --git a/assets/sprout3.png.import b/assets/sprout3.png.import new file mode 100644 index 0000000..9f25e01 --- /dev/null +++ b/assets/sprout3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4kt11i2bobre" +path="res://.godot/imported/sprout3.png-0beb960d42dc411ef10af15a6f1954b4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprout3.png" +dest_files=["res://.godot/imported/sprout3.png-0beb960d42dc411ef10af15a6f1954b4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/src/ingame/sprout.gd b/src/ingame/sprout.gd index f35a65f..b2730ed 100644 --- a/src/ingame/sprout.gd +++ b/src/ingame/sprout.gd @@ -2,8 +2,11 @@ extends Node3D @export var _need_water_drop: Sprite3D @export var _production_timer: Timer +@export var _sprite: Sprite3D var needs_water := true +var stage: int = 1 +var final_stage: int = 3 func _ready() -> void: @@ -17,16 +20,26 @@ func _on_production_timer_timeout() -> void: @rpc("authority", "call_local", "reliable") -func _reflect_combo() -> void: - GameState.fetch().player_data[multiplayer.get_unique_id()].chain_water_combo(1) +func _reflect_texture(p_stage: int) -> void: + _sprite.texture = load("res://assets/sprout%s.png" % p_stage) + + +@rpc("authority", "call_local", "reliable") +func _water_shared(sender_id: int) -> void: + if stage >= final_stage: + return + stage += 1 + _sprite.texture = load("res://assets/sprout%s.png" % stage) + if sender_id != 0: + GameState.fetch().player_data[sender_id].chain_water_combo(1) @rpc("any_peer", "call_local", "reliable") func water(sender_id: int) -> void: if needs_water: - needs_water = false + _water_shared.rpc(sender_id) _need_water_drop.hide() - if sender_id != 0: - _reflect_combo.rpc_id(sender_id) - - _production_timer.start() + + if stage != final_stage: + needs_water = false + _production_timer.start() diff --git a/src/ingame/sprout.tscn b/src/ingame/sprout.tscn index 4e0cee5..e61cbd1 100644 --- a/src/ingame/sprout.tscn +++ b/src/ingame/sprout.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=3 uid="uid://bysgtksvovyur"] [ext_resource type="Script" path="res://src/ingame/sprout.gd" id="1_snma1"] -[ext_resource type="Texture2D" uid="uid://d35y5ckne72qe" path="res://assets/sprout.png" id="2_ipgad"] +[ext_resource type="Texture2D" uid="uid://d35y5ckne72qe" path="res://assets/sprout1.png" id="2_ipgad"] [ext_resource type="Texture2D" uid="uid://cwbl0r1e26eja" path="res://assets/drop.png" id="3_kghdv"] [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_rs2qp"] @@ -16,16 +16,18 @@ properties/1/replication_mode = 2 radius = 0.3 height = 0.8 -[node name="Sprout" type="Node3D" node_paths=PackedStringArray("_need_water_drop", "_production_timer")] +[node name="Sprout" type="Node3D" node_paths=PackedStringArray("_need_water_drop", "_production_timer", "_sprite")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00401986, -0.00383317, 0.00119042) script = ExtResource("1_snma1") _need_water_drop = NodePath("NeedWaterDrop") _production_timer = NodePath("ProductionTimer") +_sprite = NodePath("Sprite3D") [node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."] replication_config = SubResource("SceneReplicationConfig_rs2qp") [node name="Sprite3D" type="Sprite3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0) pixel_size = 0.02 billboard = 2 shaded = true @@ -49,6 +51,7 @@ monitoring = false shape = SubResource("CapsuleShape3D_cwbye") [node name="ProductionTimer" type="Timer" parent="."] +wait_time = 5.0 one_shot = true [connection signal="timeout" from="ProductionTimer" to="." method="_on_production_timer_timeout"]