diff --git a/asset_dev/hud_tools/sprayer.xcf b/asset_dev/hud_tools/sprayer.xcf index edac3a4..d74ab0c 100644 Binary files a/asset_dev/hud_tools/sprayer.xcf and b/asset_dev/hud_tools/sprayer.xcf differ diff --git a/assets/materials/grunk_jittery.material b/assets/materials/grunk_jittery.material index 46372d1..e4450f6 100644 Binary files a/assets/materials/grunk_jittery.material and b/assets/materials/grunk_jittery.material differ diff --git a/assets/materials/gunk.material b/assets/materials/gunk.material index 93a37c2..4ec5adc 100644 Binary files a/assets/materials/gunk.material and b/assets/materials/gunk.material differ diff --git a/assets/materials/gunk_bright.material b/assets/materials/gunk_bright.material index a20cf49..a1a260e 100644 Binary files a/assets/materials/gunk_bright.material and b/assets/materials/gunk_bright.material differ diff --git a/assets/materials/gunk_lowrez.material b/assets/materials/gunk_lowrez.material index 798698c..1022f81 100644 Binary files a/assets/materials/gunk_lowrez.material and b/assets/materials/gunk_lowrez.material differ diff --git a/assets/ui/hud/tools/gauge/gauge.png b/assets/ui/hud/tools/gauge/gauge.png new file mode 100644 index 0000000..85e250b --- /dev/null +++ b/assets/ui/hud/tools/gauge/gauge.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28097a5d399ab6d748e6e6e4656161e76a22472606255018f709df8c5d9268ab +size 1605 diff --git a/assets/ui/hud/tools/gauge/gauge.png.import b/assets/ui/hud/tools/gauge/gauge.png.import new file mode 100644 index 0000000..03bb6cd --- /dev/null +++ b/assets/ui/hud/tools/gauge/gauge.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bg15yxnlch3u" +path="res://.godot/imported/gauge.png-54a9e95d92eff20b36a5ee68b47fb3be.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/hud/tools/gauge/gauge.png" +dest_files=["res://.godot/imported/gauge.png-54a9e95d92eff20b36a5ee68b47fb3be.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=0 diff --git a/assets/ui/hud/tools/gauge/gauge_glass.png b/assets/ui/hud/tools/gauge/gauge_glass.png new file mode 100644 index 0000000..5cceb90 --- /dev/null +++ b/assets/ui/hud/tools/gauge/gauge_glass.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fe3399dda737acd58a68775ff1529bfa278737e087a4e548344cdf561ab6b64 +size 312 diff --git a/assets/ui/hud/tools/gauge/gauge_glass.png.import b/assets/ui/hud/tools/gauge/gauge_glass.png.import new file mode 100644 index 0000000..42a2206 --- /dev/null +++ b/assets/ui/hud/tools/gauge/gauge_glass.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://pjkrr68wjy54" +path="res://.godot/imported/gauge_glass.png-9dc78d704a5068e96ac53d15bc602729.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/hud/tools/gauge/gauge_glass.png" +dest_files=["res://.godot/imported/gauge_glass.png-9dc78d704a5068e96ac53d15bc602729.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=0 diff --git a/assets/ui/hud/tools/gauge/gauge_needle.png b/assets/ui/hud/tools/gauge/gauge_needle.png new file mode 100644 index 0000000..6cf370e --- /dev/null +++ b/assets/ui/hud/tools/gauge/gauge_needle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7095f37285269a85f26110c1b398ba8d57e904ed9eba597b0c5195b230eb3a96 +size 235 diff --git a/assets/ui/hud/tools/gauge/gauge_needle.png.import b/assets/ui/hud/tools/gauge/gauge_needle.png.import new file mode 100644 index 0000000..12248bc --- /dev/null +++ b/assets/ui/hud/tools/gauge/gauge_needle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b4wooq3xvnuib" +path="res://.godot/imported/gauge_needle.png-cb4ebb48df09e8ebb666c914fe299bd3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/hud/tools/gauge/gauge_needle.png" +dest_files=["res://.godot/imported/gauge_needle.png-cb4ebb48df09e8ebb666c914fe299bd3.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=0 diff --git a/src/equipment/point_spray/point_spray.tscn b/src/equipment/point_spray/point_spray.tscn index f157510..fa1575c 100644 --- a/src/equipment/point_spray/point_spray.tscn +++ b/src/equipment/point_spray/point_spray.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://cc102xko0u6yj"] +[gd_scene load_steps=17 format=3 uid="uid://cc102xko0u6yj"] [ext_resource type="Script" uid="uid://dngia2ldbccv7" path="res://src/equipment/point_spray/point_spray.gd" id="1_2yl2v"] [ext_resource type="Material" uid="uid://c00gndxoepuqh" path="res://assets/materials/laser_spray.tres" id="2_0pfy3"] @@ -9,6 +9,7 @@ [ext_resource type="PackedScene" uid="uid://5y7gcq6igjpf" path="res://src/equipment/beam_sfx/beam_sfx.tscn" id="5_tpavj"] [ext_resource type="Script" uid="uid://dj2x7x5qkbym1" path="res://src/ui/canvas_projector.gd" id="6_h2fjt"] [ext_resource type="Texture2D" uid="uid://brcxorcpe2g56" path="res://assets/ui/hud/tools/point_sprayer.png" id="6_otnek"] +[ext_resource type="PackedScene" uid="uid://bnp6vqiixminx" path="res://src/ui/hud/grunk_gauge/grunk_gauge.tscn" id="10_dlin7"] [sub_resource type="CylinderMesh" id="CylinderMesh_j5thb"] material = ExtResource("2_0pfy3") @@ -143,3 +144,9 @@ offset_right = -192.0 offset_bottom = -122.0 scale = Vector2(10, 10) texture = ExtResource("6_otnek") + +[node name="GrunkGauge" parent="HUDTool/Rumbler/NozzleMarker/HUDElement" instance=ExtResource("10_dlin7")] +offset_left = 344.0 +offset_top = 211.0 +offset_right = 344.0 +offset_bottom = 211.0 diff --git a/src/equipment/wide_spray/wide_spray.tscn b/src/equipment/wide_spray/wide_spray.tscn index 2df19b2..9560077 100644 --- a/src/equipment/wide_spray/wide_spray.tscn +++ b/src/equipment/wide_spray/wide_spray.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=22 format=3 uid="uid://d2hnxr5l6w2x4"] +[gd_scene load_steps=23 format=3 uid="uid://d2hnxr5l6w2x4"] [ext_resource type="Script" uid="uid://dv40fyim2g2fa" path="res://src/equipment/wide_spray/wide_spray.gd" id="1_ggkto"] [ext_resource type="Material" uid="uid://c00gndxoepuqh" path="res://assets/materials/laser_spray.tres" id="2_26efp"] @@ -12,6 +12,7 @@ [ext_resource type="Script" uid="uid://dj2x7x5qkbym1" path="res://src/ui/canvas_projector.gd" id="8_j7ker"] [ext_resource type="Texture2D" uid="uid://dxjwpai3or1hw" path="res://assets/ui/hud/tools/wide_sprayer.png" id="9_8vo2h"] [ext_resource type="Texture2D" uid="uid://dmwey2qj77tm0" path="res://assets/ui/hud/tools/tall_sprayer.png" id="10_hv82w"] +[ext_resource type="PackedScene" uid="uid://bnp6vqiixminx" path="res://src/ui/hud/grunk_gauge/grunk_gauge.tscn" id="13_m8r8o"] [sub_resource type="CylinderMesh" id="CylinderMesh_48buk"] material = ExtResource("2_26efp") @@ -315,6 +316,17 @@ offset_bottom = -122.0 scale = Vector2(10, 10) texture = ExtResource("10_hv82w") +[node name="GrunkGauge" parent="HUDTool/Rumbler/NozzleMarker/HUDElement" instance=ExtResource("13_m8r8o")] +offset_left = 344.0 +offset_top = 211.0 +offset_right = 344.0 +offset_bottom = 211.0 +BUFFER_RUMBLE_FACTOR = 3.0 +RUMBLE_DECAY = 10 +NEEDLE_ACCEL = 1.0 +NEEDLE_VELOCITY_MAX = 1.0 +debug_collect = 0.0 + [node name="AnimationPlayer" type="AnimationPlayer" parent="."] unique_name_in_owner = true libraries = { diff --git a/src/ui/hud/grunk_gauge/grunk_gauge.gd b/src/ui/hud/grunk_gauge/grunk_gauge.gd new file mode 100644 index 0000000..ea46d34 --- /dev/null +++ b/src/ui/hud/grunk_gauge/grunk_gauge.gd @@ -0,0 +1,61 @@ +extends Control +## Goes up when u collect tha grunk! + +const BUFFER_RUMBLE_FACTOR := 3.0 +const RUMBLE_DECAY := 10 + +const NEEDLE_ANGLE_MIN := 0.0 +const NEEDLE_ANGLE_MAX := PI +const NEEDLE_ACCEL := 3.0 +const NEEDLE_VELOCITY_MAX := 4.0 +const NEEDLE_ANGLE_EPSILON := 0.05 + +const TANK_WARNING_BUFFER_PCT := 0.1 + +@export var debug_collect: float: + set = on_grunk_collected + +var _needle_velocity := 0.0 +var _base_rumble := 0.0 + +@onready var rumbler: Rumbler = %Rumbler +@onready var needle: TextureRect = %NeedleTexture + + +func _ready() -> void: + Game.manager.grunk_collected.connect(on_grunk_collected) + Game.manager.grunk_emptied.connect(on_grunk_emptied) + + +func get_target_rotation() -> float: + return remap( + Game.manager.grunk_tank, + 0, + Game.manager.grunk_tank_limit, + NEEDLE_ANGLE_MIN, + NEEDLE_ANGLE_MAX + ) + + +func on_grunk_collected(_delta: float) -> void: + var buffer := remap(Game.manager.get_tank_fill_pct(), 1 - TANK_WARNING_BUFFER_PCT, 1, 0, 1) + _base_rumble = BUFFER_RUMBLE_FACTOR * buffer + + +func on_grunk_emptied(_amount: float) -> void: + _base_rumble = 0.0 + + +func _process(delta: float) -> void: + var weight := 1 - exp(-RUMBLE_DECAY * delta) + rumbler.intensity = lerpf(rumbler.intensity, _base_rumble, weight) + + var diff := get_target_rotation() - needle.rotation + var target_velocity := 0.0 + if diff > NEEDLE_ANGLE_EPSILON: + target_velocity = NEEDLE_VELOCITY_MAX + elif diff < -NEEDLE_ANGLE_EPSILON: + target_velocity = -NEEDLE_VELOCITY_MAX + + _needle_velocity = lerpf(_needle_velocity, target_velocity, 1 - exp(-NEEDLE_ACCEL * delta)) + needle.rotation += _needle_velocity * delta diff --git a/src/ui/hud/grunk_gauge/grunk_gauge.gd.uid b/src/ui/hud/grunk_gauge/grunk_gauge.gd.uid new file mode 100644 index 0000000..6afa6e3 --- /dev/null +++ b/src/ui/hud/grunk_gauge/grunk_gauge.gd.uid @@ -0,0 +1 @@ +uid://dkbbrevmer6tx diff --git a/src/ui/hud/grunk_gauge/grunk_gauge.tscn b/src/ui/hud/grunk_gauge/grunk_gauge.tscn new file mode 100644 index 0000000..be1508b --- /dev/null +++ b/src/ui/hud/grunk_gauge/grunk_gauge.tscn @@ -0,0 +1,67 @@ +[gd_scene load_steps=6 format=3 uid="uid://bnp6vqiixminx"] + +[ext_resource type="Texture2D" uid="uid://bg15yxnlch3u" path="res://assets/ui/hud/tools/gauge/gauge.png" id="1_hn628"] +[ext_resource type="Script" uid="uid://dkbbrevmer6tx" path="res://src/ui/hud/grunk_gauge/grunk_gauge.gd" id="1_mgquo"] +[ext_resource type="Texture2D" uid="uid://pjkrr68wjy54" path="res://assets/ui/hud/tools/gauge/gauge_glass.png" id="2_hn8y8"] +[ext_resource type="Script" uid="uid://cjs2fen6jo0g0" path="res://src/ui/rumbler.gd" id="2_iak84"] +[ext_resource type="Texture2D" uid="uid://b4wooq3xvnuib" path="res://assets/ui/hud/tools/gauge/gauge_needle.png" id="3_mgquo"] + +[node name="GrunkGauge" type="Control"] +texture_filter = 3 +layout_mode = 3 +anchors_preset = 0 +script = ExtResource("1_mgquo") + +[node name="BaseTexture" type="TextureRect" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -20.0 +offset_right = 20.0 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 +scale = Vector2(10, 10) +pivot_offset = Vector2(20, 20) +texture = ExtResource("1_hn628") + +[node name="Rumbler" type="Control" parent="."] +unique_name_in_owner = true +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 +script = ExtResource("2_iak84") +metadata/_custom_type_script = "uid://cjs2fen6jo0g0" + +[node name="NeedleTexture" type="TextureRect" parent="Rumbler"] +unique_name_in_owner = true +custom_minimum_size = Vector2(16, 5) +layout_mode = 0 +offset_left = -13.5 +offset_top = -2.5 +offset_right = 2.5 +offset_bottom = 2.5 +scale = Vector2(10, 10) +pivot_offset = Vector2(13.5, 2.5) +texture = ExtResource("3_mgquo") + +[node name="GlassTexture" type="TextureRect" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -20.0 +offset_right = 20.0 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 +scale = Vector2(10, 10) +pivot_offset = Vector2(20, 20) +texture = ExtResource("2_hn8y8") diff --git a/src/ui/hud/player_hud.tscn b/src/ui/hud/player_hud.tscn index 397700f..e18ba6f 100644 --- a/src/ui/hud/player_hud.tscn +++ b/src/ui/hud/player_hud.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=10 format=3 uid="uid://dq1x21tq06dud"] +[gd_scene load_steps=9 format=3 uid="uid://dq1x21tq06dud"] [ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="1_lirk3"] [ext_resource type="Script" uid="uid://lrsv0185bfu" path="res://src/ui/hud/player_hud.gd" id="2_j6lpx"] -[ext_resource type="PackedScene" uid="uid://cq8qcp5xg41e0" path="res://src/ui/hud/grunk_counter/grunk_counter.tscn" id="3_5be8f"] [ext_resource type="Script" uid="uid://bdsv404evn4fk" path="res://src/ui/hud/interact_hud.gd" id="3_n6jee"] [ext_resource type="Script" uid="uid://cjs2fen6jo0g0" path="res://src/ui/rumbler.gd" id="4_ud8na"] @@ -215,10 +214,10 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -400.498 -offset_top = -299.892 -offset_right = -400.498 -offset_bottom = -299.892 +offset_left = -401.541 +offset_top = -299.173 +offset_right = -401.541 +offset_bottom = -299.173 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("4_ud8na") @@ -239,7 +238,6 @@ mouse_filter = 2 theme_type_variation = &"AlertLabel" [node name="AlertLine1" type="Label" parent="AlertHUD/Rumbler/GrunkAlert2"] -modulate = Color(1, 1, 1, 1) layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -261,7 +259,6 @@ text = "! GRUNK ALERT !" horizontal_alignment = 1 [node name="AlertLine2" type="Label" parent="AlertHUD/Rumbler/GrunkAlert2"] -modulate = Color(1, 1, 1, 1) layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -284,21 +281,3 @@ unique_name_in_owner = true libraries = { &"": SubResource("AnimationLibrary_ud8na") } - -[node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 1 -anchors_preset = 2 -anchor_top = 1.0 -anchor_bottom = 1.0 -offset_top = -77.0 -offset_right = 123.0 -grow_vertical = 0 -theme_override_constants/margin_left = 32 -theme_override_constants/margin_top = 32 -theme_override_constants/margin_right = 32 -theme_override_constants/margin_bottom = 32 - -[node name="GrunkCounter" parent="MarginContainer" instance=ExtResource("3_5be8f")] -layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 8 diff --git a/src/world/grunk_beast/grunk_beast.tscn b/src/world/grunk_beast/grunk_beast.tscn index 965b95e..a950a51 100644 --- a/src/world/grunk_beast/grunk_beast.tscn +++ b/src/world/grunk_beast/grunk_beast.tscn @@ -218,7 +218,7 @@ metadata/_custom_type_script = "uid://om57w2acvgb7" script = ExtResource("11_mbqcc") mean_time = 4.0 st_dev_time = 0.6 -wait_time = 3.8583 +wait_time = 4.72586 metadata/_custom_type_script = "uid://beyk2xtbjrsg4" [node name="RandomStalkingBehavior" type="Node" parent="GrunkBeastBehavior/StateSelector/StalkingSequence/RandomDelay"] @@ -264,7 +264,7 @@ metadata/_custom_type_script = "uid://cg016dbe7gs1x" script = ExtResource("11_mbqcc") mean_time = 5.0 st_dev_time = 1.0 -wait_time = 5.01985 +wait_time = 4.0544 metadata/_custom_type_script = "uid://beyk2xtbjrsg4" [node name="PickRandomLurkTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/LurkSequence/RandomDelay"] diff --git a/src/world/grunk_beast/slutch_beast/slutch.material b/src/world/grunk_beast/slutch_beast/slutch.material index 0e41643..8fc2631 100644 Binary files a/src/world/grunk_beast/slutch_beast/slutch.material and b/src/world/grunk_beast/slutch_beast/slutch.material differ diff --git a/src/world/grunk_beast/slutch_beast/slutch_nodule.material b/src/world/grunk_beast/slutch_beast/slutch_nodule.material index bfbbaa5..4f4af01 100644 Binary files a/src/world/grunk_beast/slutch_beast/slutch_nodule.material and b/src/world/grunk_beast/slutch_beast/slutch_nodule.material differ