diff --git a/.import/WaterSFX.wav-4fedf5f92696ac909f744f77fd4c2177.md5 b/.import/WaterSFX.wav-4fedf5f92696ac909f744f77fd4c2177.md5 new file mode 100644 index 0000000..7bc0756 --- /dev/null +++ b/.import/WaterSFX.wav-4fedf5f92696ac909f744f77fd4c2177.md5 @@ -0,0 +1,3 @@ +source_md5="7f5e4fa7b0f78f8ba98b978e52ef7dbb" +dest_md5="743e6a634dc4af669c023a174d3a9d01" + diff --git a/.import/WaterSFX.wav-4fedf5f92696ac909f744f77fd4c2177.sample b/.import/WaterSFX.wav-4fedf5f92696ac909f744f77fd4c2177.sample new file mode 100644 index 0000000..d04bd94 Binary files /dev/null and b/.import/WaterSFX.wav-4fedf5f92696ac909f744f77fd4c2177.sample differ diff --git a/.import/enough_water.wav-7e11a042805efd23a3276c0d587fde75.md5 b/.import/enough_water.wav-7e11a042805efd23a3276c0d587fde75.md5 new file mode 100644 index 0000000..c13eccc --- /dev/null +++ b/.import/enough_water.wav-7e11a042805efd23a3276c0d587fde75.md5 @@ -0,0 +1,3 @@ +source_md5="838dd6baad51851be3834b6cb20ac296" +dest_md5="ed437917dafe3014b7da5f5cfe5bb1ee" + diff --git a/.import/enough_water.wav-7e11a042805efd23a3276c0d587fde75.sample b/.import/enough_water.wav-7e11a042805efd23a3276c0d587fde75.sample new file mode 100644 index 0000000..b6bea51 Binary files /dev/null and b/.import/enough_water.wav-7e11a042805efd23a3276c0d587fde75.sample differ diff --git a/Menu/enough_water.wav b/Menu/enough_water.wav new file mode 100644 index 0000000..f4a94b3 Binary files /dev/null and b/Menu/enough_water.wav differ diff --git a/Menu/enough_water.wav.import b/Menu/enough_water.wav.import new file mode 100644 index 0000000..9529f3a --- /dev/null +++ b/Menu/enough_water.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/enough_water.wav-7e11a042805efd23a3276c0d587fde75.sample" + +[deps] + +source_file="res://Menu/enough_water.wav" +dest_files=[ "res://.import/enough_water.wav-7e11a042805efd23a3276c0d587fde75.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/Music/WaterSFX.wav b/Music/WaterSFX.wav new file mode 100644 index 0000000..34574be Binary files /dev/null and b/Music/WaterSFX.wav differ diff --git a/Music/WaterSFX.wav.import b/Music/WaterSFX.wav.import new file mode 100644 index 0000000..a807aac --- /dev/null +++ b/Music/WaterSFX.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/WaterSFX.wav-4fedf5f92696ac909f744f77fd4c2177.sample" + +[deps] + +source_file="res://Music/WaterSFX.wav" +dest_files=[ "res://.import/WaterSFX.wav-4fedf5f92696ac909f744f77fd4c2177.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/Tools/WateringCan.gd b/Tools/WateringCan.gd index 49f7d7e..e5c243d 100644 --- a/Tools/WateringCan.gd +++ b/Tools/WateringCan.gd @@ -4,9 +4,9 @@ var watering = false func _on_WateringCan_pressed(): watering = !watering if watering: - $Timer.start(1) - $Particles2D.emitting = true + $Timer.start(0.1) + $WaterParticles.emitting = true if !watering: $Timer.stop() - $Particles2D.emitting = false + $WaterParticles.emitting = false diff --git a/World/GoodAndWellBalancedWaterParticles.gd b/World/GoodAndWellBalancedWaterParticles.gd new file mode 100644 index 0000000..cb099b4 --- /dev/null +++ b/World/GoodAndWellBalancedWaterParticles.gd @@ -0,0 +1,4 @@ +extends Particles2D + +func _on_Delete_timeout() -> void: + queue_free() diff --git a/World/GoodAndWellBalancedWaterParticles.tscn b/World/GoodAndWellBalancedWaterParticles.tscn new file mode 100644 index 0000000..98278e5 --- /dev/null +++ b/World/GoodAndWellBalancedWaterParticles.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://World/GoodAndWellBalancedWaterParticles.gd" type="Script" id=1] + +[sub_resource type="ParticlesMaterial" id=14] +lifetime_randomness = 1.0 +flag_disable_z = true +direction = Vector3( 0, -1, 0 ) +spread = 90.0 +gravity = Vector3( 0, 10, 0 ) +initial_velocity = 24.0 +initial_velocity_random = 1.0 +orbit_velocity = 0.0 +orbit_velocity_random = 0.0 +color = Color( 0.341176, 0.337255, 0.756863, 1 ) + +[node name="GoodAndWellBalancedWaterParticles" type="Particles2D"] +position = Vector2( 0, -3 ) +z_index = 2 +emitting = false +amount = 32 +lifetime = 2.0 +explosiveness = 1.0 +randomness = 1.0 +process_material = SubResource( 14 ) +script = ExtResource( 1 ) + +[node name="Delete" type="Timer" parent="."] +wait_time = 0.5 + +[connection signal="timeout" from="Delete" to="." method="_on_Delete_timeout"] diff --git a/World/Main.tscn b/World/Main.tscn index 2d9a46d..565568f 100644 --- a/World/Main.tscn +++ b/World/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=22 format=2] +[gd_scene load_steps=23 format=2] [ext_resource path="res://World/Plant.tscn" type="PackedScene" id=1] [ext_resource path="res://World/FullscreenButton.gd" type="Script" id=2] @@ -14,6 +14,7 @@ [ext_resource path="res://Aseprite/wateringcan.png" type="Texture" id=12] [ext_resource path="res://Tools/WateringCan.gd" type="Script" id=13] [ext_resource path="res://Aseprite/wateringcanactive.png" type="Texture" id=14] +[ext_resource path="res://World/Pot.gd" type="Script" id=15] [sub_resource type="Theme" id=7] @@ -28,7 +29,7 @@ expand_margin_right = 2.0 [sub_resource type="CanvasItemMaterial" id=3] [sub_resource type="DynamicFont" id=4] -size = 8 +size = 6 extra_spacing_char = 1 font_data = ExtResource( 10 ) @@ -79,9 +80,9 @@ __meta__ = { [node name="MusicVolume" type="VSlider" parent="Options"] margin_left = 1.0 -margin_top = 1.0 +margin_top = 62.0 margin_right = 17.0 -margin_bottom = 120.0 +margin_bottom = 122.0 custom_icons/tick = ExtResource( 7 ) custom_icons/grabber_disabled = ExtResource( 7 ) custom_icons/grabber_highlight = ExtResource( 8 ) @@ -95,6 +96,25 @@ __meta__ = { } bus_channel = "Music" +[node name="SFXVolume" type="VSlider" parent="Options"] +margin_left = 1.0 +margin_top = 1.0 +margin_right = 17.0 +margin_bottom = 61.0 +rect_scale = Vector2( 1, 0.99844 ) +custom_icons/tick = ExtResource( 7 ) +custom_icons/grabber_disabled = ExtResource( 7 ) +custom_icons/grabber_highlight = ExtResource( 8 ) +custom_icons/grabber = ExtResource( 7 ) +custom_styles/slider = SubResource( 2 ) +max_value = 1.0 +step = 0.1 +script = ExtResource( 6 ) +__meta__ = { +"_edit_use_anchors_": false +} +bus_channel = "SFX" + [node name="RightPanel" type="Panel" parent="."] margin_left = 128.0 margin_top = 2.0 @@ -125,7 +145,9 @@ __meta__ = { } [node name="Reveal" type="Timer" parent="RightPanel/Terminal"] -wait_time = 0.15 +wait_time = 0.05 + +[node name="MessageTimer" type="Timer" parent="RightPanel/Terminal"] [node name="WateringCan" type="TextureButton" parent="RightPanel"] margin_left = 2.0 @@ -143,8 +165,9 @@ __meta__ = { [node name="Timer" type="Timer" parent="RightPanel/WateringCan"] -[node name="Particles2D" type="Particles2D" parent="RightPanel/WateringCan"] +[node name="WaterParticles" type="Particles2D" parent="RightPanel/WateringCan"] position = Vector2( -56, -1 ) +z_index = 2 emitting = false amount = 15 lifetime = 0.5 @@ -153,10 +176,15 @@ process_material = SubResource( 13 ) [node name="Pot" type="Sprite" parent="."] position = Vector2( 64, 136 ) texture = ExtResource( 9 ) +script = ExtResource( 15 ) +[connection signal="good_water" from="Plant" to="Pot" method="_on_Plant_good_water"] [connection signal="has_need" from="Plant" to="RightPanel/Terminal" method="_on_Plant_has_need"] [connection signal="pressed" from="Options/FullscreenButton" to="Options/FullscreenButton" method="_on_FullscreenButton_pressed"] [connection signal="value_changed" from="Options/MusicVolume" to="Options/MusicVolume" method="_on_MusicVolume_value_changed"] +[connection signal="value_changed" from="Options/SFXVolume" to="Options/SFXVolume" method="_on_MusicVolume_value_changed"] +[connection signal="was_social" from="RightPanel/Terminal" to="Plant" method="_on_Terminal_was_social"] [connection signal="timeout" from="RightPanel/Terminal/Reveal" to="RightPanel/Terminal" method="_on_Reveal_timeout"] +[connection signal="timeout" from="RightPanel/Terminal/MessageTimer" to="RightPanel/Terminal" method="_on_MessageTimer_timeout"] [connection signal="pressed" from="RightPanel/WateringCan" to="RightPanel/WateringCan" method="_on_WateringCan_pressed"] [connection signal="timeout" from="RightPanel/WateringCan/Timer" to="Plant" method="add_water"] diff --git a/World/Plant.gd b/World/Plant.gd index 85ca156..221c63b 100644 --- a/World/Plant.gd +++ b/World/Plant.gd @@ -10,8 +10,11 @@ var water = 20 var health = 100 var social = 50 var light = 50 -var last_need = ["x", -100] +var last_need = ["x", -100, -100] +var was_silent = false + +signal good_water() signal has_need(need_and_value) func get_mood() -> int: @@ -27,26 +30,30 @@ func _process(_delta): func step(): - $Timer.wait_time = float(get_mood()) / 100 + 0.25 + $Timer.wait_time = abs(float(get_mood()) / 100) + 0.25 call_deferred("grow") if (randi() % 200 == 0) && (get_mood() < 50): blossom() communicate_needs() func communicate_needs(): - var needs = [(50 - water) * 2, 100 - health, 100 - social, (50 - light) * 2] - var most_important = [0, needs[0]] + var needs = [abs((50 - water) * 2), 100 - health, 100 - social, abs((50 - light) * 2)] + var needs_for_real = [water, health, social, light] + var most_important = ["cool name sample text", needs[0], needs_for_real[0]] var i = 0 for need in needs: if most_important[1] <= need: most_important[1] = need + most_important[2] = needs_for_real[i] most_important[0] = i i += 1 var names = ["water", "health", "social", "light"] most_important[0] = names[most_important[0]] - if (last_need[0] != most_important[0]) || (abs(last_need[1] - most_important[1]) >= 10): + if (last_need[0] != most_important[0]) || (abs(last_need[1] - most_important[1]) >= 10) || was_silent: emit_signal("has_need", most_important) last_need = most_important + was_silent = false + $TalkTimer.start(15) func _ready(): @@ -118,8 +125,19 @@ func blossom(): func _on_WaterTimer_timeout() -> void: water = clamp(water - 1, 0, 100) + social = clamp(social - 2, 0, 100) func add_water(): water = clamp(water + 1, 0, 100) - print(water) + if water == 55: + $WaterSFX.play(0) + emit_signal("good_water") + + +func _on_TalkTimer_timeout() -> void: + was_silent = true + + +func _on_Terminal_was_social() -> void: + social += clamp(social + randi() % 11, 0, 10) diff --git a/World/Plant.tscn b/World/Plant.tscn index 26b5cdd..4ff88e0 100644 --- a/World/Plant.tscn +++ b/World/Plant.tscn @@ -1,5 +1,6 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] +[ext_resource path="res://Music/WaterSFX.wav" type="AudioStream" id=1] [ext_resource path="res://World/Plant.gd" type="Script" id=2] [node name="Plant" type="Node2D"] @@ -13,5 +14,12 @@ autostart = true wait_time = 20.0 autostart = true +[node name="TalkTimer" type="Timer" parent="."] + +[node name="WaterSFX" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 1 ) +bus = "SFX" + [connection signal="timeout" from="Timer" to="." method="step"] [connection signal="timeout" from="WaterTimer" to="." method="_on_WaterTimer_timeout"] +[connection signal="timeout" from="TalkTimer" to="." method="_on_TalkTimer_timeout"] diff --git a/World/Pot.gd b/World/Pot.gd new file mode 100644 index 0000000..259210d --- /dev/null +++ b/World/Pot.gd @@ -0,0 +1,13 @@ +extends Sprite + + + +func _on_Plant_good_water() -> void: + var main = get_tree().current_scene + var Particle = preload("res://World/GoodAndWellBalancedWaterParticles.tscn") + var particle = Particle.instance() + particle.one_shot = true + particle.emitting = true + main.add_child(particle) + particle.global_position = global_position + particle.global_position.y -= 2 diff --git a/World/Terminal.gd b/World/Terminal.gd index 0bc1753..2e3b089 100644 --- a/World/Terminal.gd +++ b/World/Terminal.gd @@ -1,17 +1,81 @@ extends RichTextLabel +signal was_social() +var can_show_mesage = true +var last = "sample tess" + +var water_msg_low = [ + "Please water me :o", + "I'm THIRSTY i could drink a [shake rate=10 level=2]100!!![/shake] ... somethings" + ] +var water_msg_high = [ + "EEE! Too wet!!!", + "The pot is like a swamp... :(", + "I need to dry!!!", + "Wet wet wet!!!! AAAAAA", + "Way too wet :( If this was nintendo ds game i would ask you to blow into the microphone, but [shake rate=10 level=2]NO![/shake]" + ] +var water_msg_good = [ + "Comfy wet soil :)", + "Thank you!!!", + "Thank you for taking such good care of me!", + "When i'm happy i grow [shake rate=10 level=2]flowers[/shake]!" + ] + +var social = [ + "You ever think about bees?", + "You like [wave amp=24 freq=2]Jazz[/wave]?", + "Trans rights!", + "[wave amp=24 freq=2]eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee[/wave]", + "Fun fact! [wave amp=24 freq=2]uhhhhidk[/wave]", + "Look up cool bug facts and tell me one! Quick!!!", + "Ladybirds play dead to avoid predators. Don't we all sometimes...", + "Do you ever forget if you already told someone something and then you just tell them like [shake rate=10 level=2]50 times[/shake]? Yeah.", + "If i had to fight someone i would simply look up the weaknesses section on their wikipedia page.", +] + func _ready() -> void: visible_characters = 0 -func _on_Plant_has_need(need_and_value) -> void: - print_message(need_and_value) +func _on_Plant_has_need(need_and_values) -> void: + if need_and_values[0] == "water": + tell_about_water(need_and_values) + if need_and_values[0] == "social" && can_show_mesage: + tell_about_social() + +func tell_about_social(): + print_message(social[randi() % social.size()]) + emit_signal("was_social") + +func tell_about_water(need_and_values): + if need_and_values[2] > 60: + if !(last == "high_water"): can_show_mesage = true + print_message(water_msg_high[randi() % water_msg_high.size()]) + last = "high_water" + elif need_and_values[2] < 40: + if !(last == "low_water"): can_show_mesage = true + print_message(water_msg_low[randi() % water_msg_low.size()]) + last = "low_water" + else: + if !(last == "good_water"): can_show_mesage = true + print_message(water_msg_good[randi() % water_msg_good.size()]) + last = "good_water" func print_message(mesage): - $Reveal.start() - text = text + "\n >" + str(mesage) + "\n " + if can_show_mesage: + $Reveal.start() + bbcode_text = bbcode_text + "\n>" + str(mesage) + "\n" + can_show_mesage = false + $MessageTimer.start(5) func _on_Reveal_timeout() -> void: if visible_characters <= text.length(): visible_characters += 1 else: $Reveal.stop() + + +func _on_MessageTimer_timeout() -> void: + can_show_mesage = true + if randi() % 3 == 0: + tell_about_social() diff --git a/default_bus_layout.tres b/default_bus_layout.tres index cff108a..2aa3db1 100644 --- a/default_bus_layout.tres +++ b/default_bus_layout.tres @@ -8,3 +8,9 @@ bus/1/mute = false bus/1/bypass_fx = false bus/1/volume_db = -80.0 bus/1/send = "Master" +bus/2/name = "SFX" +bus/2/solo = false +bus/2/mute = false +bus/2/bypass_fx = false +bus/2/volume_db = 0.0 +bus/2/send = "Master"