Audio system and rich text

This commit is contained in:
Rendo 2025-06-29 14:28:51 +05:00
commit 68cafff083
161 changed files with 1605 additions and 255 deletions

View file

@ -1,9 +1,11 @@
[gd_scene load_steps=8 format=3 uid="uid://xu4i6tmkv00a"]
[gd_scene load_steps=10 format=3 uid="uid://xu4i6tmkv00a"]
[ext_resource type="PackedScene" uid="uid://hhjbqkjqpt7x" path="res://scenes/entities/Zombies/cone_zombie.tscn" id="1_mwqpo"]
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_3mrqj"]
[ext_resource type="Texture2D" uid="uid://ce04l60l6mhfk" path="res://assets/sprites/bucket.tres" id="3_0nlp0"]
[ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="4_1s2fn"]
[ext_resource type="AudioStream" uid="uid://bu1egfsyplpx4" path="res://assets/audio/sfx/metalhit_generic.tres" id="5_lt6ps"]
[ext_resource type="AudioStream" uid="uid://w0qfwds4o3ti" path="res://assets/audio/sfx/hit_generic.tres" id="6_kedip"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wdi07"]
resource_local_to_scene = true
@ -45,3 +47,7 @@ _speed = SubResource("Resource_lt6ps")
[node name="Armor" parent="." index="7"]
_maxHP = 385
[node name="HitPlayer" parent="." index="8"]
playlist = Array[AudioStream]([ExtResource("5_lt6ps"), ExtResource("6_kedip")])
channels = Array[String](["metal_hit", "hit"])

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://hhjbqkjqpt7x"]
[gd_scene load_steps=13 format=3 uid="uid://hhjbqkjqpt7x"]
[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="1_3dq4c"]
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_2dq8e"]
@ -6,6 +6,8 @@
[ext_resource type="Script" uid="uid://dt5uj25u0g6y3" path="res://scripts/components/particles/FallParticle.cs" id="3_w70im"]
[ext_resource type="Texture2D" uid="uid://ceqvdmude7cgg" path="res://assets/sprites/cone.tres" id="4_qdhik"]
[ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="4_qof5v"]
[ext_resource type="AudioStream" uid="uid://bmupd3v3gvsca" path="res://assets/audio/sfx/plastichit_generic.tres" id="7_0amn8"]
[ext_resource type="AudioStream" uid="uid://w0qfwds4o3ti" path="res://assets/audio/sfx/hit_generic.tres" id="7_67t4t"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_sat5k"]
resource_local_to_scene = true
@ -35,7 +37,7 @@ _armor = NodePath("Armor")
[node name="CanvasGroup" parent="." index="0"]
material = SubResource("ShaderMaterial_sat5k")
[node name="Hat" type="RigidBody2D" parent="CanvasGroup" index="1" node_paths=PackedStringArray("data", "deathTimer")]
[node name="Hat" type="RigidBody2D" parent="CanvasGroup" index="1" node_paths=PackedStringArray("data")]
position = Vector2(-9, -76)
collision_layer = 128
collision_mask = 64
@ -44,10 +46,9 @@ center_of_mass_mode = 1
freeze = true
script = ExtResource("3_w70im")
data = NodePath("../..")
deathTimer = NodePath("Timer")
falloffImpulseMin = Vector2(0, 1)
falloffImpulseMax = Vector2(1, 0)
falloffOffsetMin = Vector2(1, 0)
maxAngle = 45.0
minTorque = -45.0
maxTorque = 45.0
Impulse = 100.0
[node name="Sprite" type="Sprite2D" parent="CanvasGroup/Hat" index="0"]
@ -58,9 +59,6 @@ texture = ExtResource("4_qdhik")
position = Vector2(1, -6)
shape = SubResource("CircleShape2D_67t4t")
[node name="Timer" type="Timer" parent="CanvasGroup/Hat" index="2"]
wait_time = 5.0
[node name="Eatbox" parent="." index="2"]
_damage = SubResource("Resource_w70im")
@ -71,5 +69,9 @@ _speed = SubResource("Resource_qof5v")
script = ExtResource("3_5s7in")
_maxHP = 130
[connection signal="timeout" from="CanvasGroup/Hat/Timer" to="CanvasGroup/Hat" method="queue_free"]
[node name="HitPlayer" parent="." index="8"]
playlist = Array[AudioStream]([ExtResource("7_0amn8"), ExtResource("7_67t4t")])
channels = Array[String](["plastic_hit", "hit"])
[connection signal="ArmorLost" from="Armor" to="HitPlayer" method="Next"]
[connection signal="ArmorLost" from="Armor" to="CanvasGroup/Hat" method="FallOff"]

View file

@ -1,12 +1,17 @@
[gd_scene load_steps=34 format=3 uid="uid://bgqmwsb6ynm81"]
[gd_scene load_steps=40 format=3 uid="uid://bgqmwsb6ynm81"]
[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="1_fnu7s"]
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_6qr4h"]
[ext_resource type="Texture2D" uid="uid://cse1504ao4g8e" path="res://assets/sprites/atlases/zombies/hobo.png" id="3_6qr4h"]
[ext_resource type="Script" uid="uid://dt5uj25u0g6y3" path="res://scripts/components/particles/FallParticle.cs" id="3_tu6af"]
[ext_resource type="AnimationLibrary" uid="uid://cuh2kyb21hmkm" path="res://resources/animations/zombies/basic_zombie.res" id="4_02fim"]
[ext_resource type="Script" uid="uid://c5v2og85t7s6j" path="res://scripts/components/zombies/behaviours/HoboBehaviour.cs" id="4_5selg"]
[ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="4_c1y3b"]
[ext_resource type="Script" uid="uid://fd4im1fmwc5n" path="res://scripts/components/Armor.cs" id="4_w8pya"]
[ext_resource type="AudioStream" uid="uid://bu1egfsyplpx4" path="res://assets/audio/sfx/metalhit_generic.tres" id="8_4248q"]
[ext_resource type="AudioStream" uid="uid://w0qfwds4o3ti" path="res://assets/audio/sfx/hit_generic.tres" id="9_tu6af"]
[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="11_7jlle"]
[ext_resource type="AudioStream" uid="uid://ch55p7qbaawtp" path="res://assets/audio/sfx/argh.tres" id="12_w1b1s"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_w8pya"]
resource_local_to_scene = true
@ -22,6 +27,10 @@ region = Rect2(0, 15, 40, 49)
atlas = ExtResource("3_6qr4h")
region = Rect2(3, 0, 35, 11)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_4248q"]
radius = 17.0
height = 48.0
[sub_resource type="Resource" id="Resource_qg8rq"]
resource_local_to_scene = true
script = ExtResource("4_c1y3b")
@ -101,6 +110,20 @@ tracks/2/keys = {
"update": 1,
"values": [0.0, 1.0]
}
tracks/3/type = "method"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("RipPlayer")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(1.96667),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"Play"
}]
}
[sub_resource type="Animation" id="Animation_5selg"]
resource_name = "walk"
@ -206,7 +229,16 @@ _armor = NodePath("CanArmor")
[node name="CanvasGroup" parent="." index="0"]
material = SubResource("ShaderMaterial_w8pya")
[node name="Can" type="Node2D" parent="CanvasGroup" index="1"]
[node name="Can" type="RigidBody2D" parent="CanvasGroup" index="1" node_paths=PackedStringArray("data")]
collision_layer = 128
collision_mask = 64
freeze = true
script = ExtResource("3_tu6af")
data = NodePath("../..")
maxAngle = 45.0
minTorque = -45.0
maxTorque = 45.0
Impulse = 100.0
[node name="Sprite2D" type="Sprite2D" parent="CanvasGroup/Can" index="0"]
position = Vector2(-4, -40)
@ -217,6 +249,10 @@ z_index = -1
position = Vector2(-6, -63)
texture = SubResource("AtlasTexture_5selg")
[node name="CollisionShape2D" type="CollisionShape2D" parent="CanvasGroup/Can" index="2"]
position = Vector2(-3, -40)
shape = SubResource("CapsuleShape2D_4248q")
[node name="Eatbox" parent="." index="2"]
_damage = SubResource("Resource_qg8rq")
@ -246,5 +282,16 @@ script = ExtResource("4_5selg")
_eatBox = NodePath("../Eatbox")
_animationTree = NodePath("../AnimationTree")
[connection signal="ArmorLost" from="CanArmor" to="CanvasGroup/Can" method="queue_free"]
[node name="HitPlayer" parent="." index="9"]
playlist = Array[AudioStream]([ExtResource("8_4248q"), ExtResource("9_tu6af")])
channels = Array[String](["metal_hit", "hit"])
[node name="RipPlayer" type="Node" parent="." index="11"]
script = ExtResource("11_7jlle")
audioStream = ExtResource("12_w1b1s")
channel = "anger"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"
[connection signal="ArmorLost" from="CanArmor" to="HitPlayer" method="Next"]
[connection signal="ArmorLost" from="CanArmor" to="CanvasGroup/Can" method="FallOff"]
[connection signal="ArmorLost" from="CanArmor" to="Behaviour" method="Trashed"]

View file

@ -1,16 +1,21 @@
[gd_scene load_steps=19 format=3 uid="uid://co11v3w8hbwgf"]
[gd_scene load_steps=24 format=3 uid="uid://co11v3w8hbwgf"]
[ext_resource type="Script" uid="uid://dildme6epx8l4" path="res://scripts/components/zombies/RuntimeZombieData.cs" id="1_qq3f1"]
[ext_resource type="Texture2D" uid="uid://bwdqbrnn7ygtr" path="res://assets/sprites/atlases/zombies/Зондби.png" id="2_4pdxh"]
[ext_resource type="AudioStream" uid="uid://dt13iugnnx4op" path="res://assets/audio/sfx/yuck_generic.tres" id="2_hh4qh"]
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_srwwe"]
[ext_resource type="Script" uid="uid://dqyony6jxt2p0" path="res://scripts/components/zombies/EatBox.cs" id="3_2aulo"]
[ext_resource type="AudioStream" uid="uid://bjotp63arocci" path="res://assets/audio/sfx/frozen.mp3" id="3_ltj46"]
[ext_resource type="Script" uid="uid://c5vfccegyy01t" path="res://scripts/components/FlashComponent.cs" id="3_rao3m"]
[ext_resource type="Script" uid="uid://7hdj2k14lfe4" path="res://scripts/components/zombies/ZombieMover.cs" id="4_u5syx"]
[ext_resource type="AnimationLibrary" uid="uid://cuh2kyb21hmkm" path="res://resources/animations/zombies/basic_zombie.res" id="6_ckb7n"]
[ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="7_b3p4o"]
[ext_resource type="AnimationNodeStateMachine" uid="uid://dj0blope85bg7" path="res://resources/animations/zombies/basic_zombie_tree.tres" id="8_ckb7n"]
[ext_resource type="AudioStream" uid="uid://xoy5ct1t17k5" path="res://assets/audio/sfx/slap.mp3" id="8_di4dd"]
[ext_resource type="Script" uid="uid://bsg4utgc0u0vo" path="res://scripts/components/zombies/AudioDamage.cs" id="9_oxd1e"]
[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="10_ruqsf"]
[ext_resource type="AudioStream" uid="uid://dyid55nhflwyn" path="res://assets/audio/sfx/chomp_generic.tres" id="11_vjrlo"]
[ext_resource type="AudioStream" uid="uid://bg76miyscfvhu" path="res://assets/audio/sfx/groan.tres" id="12_ad42i"]
[ext_resource type="Script" uid="uid://cnn0ymuhypdff" path="res://scripts/audio/ChannelPlaylist.cs" id="12_he8da"]
[ext_resource type="AudioStream" uid="uid://w0qfwds4o3ti" path="res://assets/audio/sfx/hit_generic.tres" id="12_vjrlo"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_63ls2"]
resource_local_to_scene = true
@ -62,6 +67,8 @@ mult_value = 1.0
y_sort_enabled = true
script = ExtResource("1_qq3f1")
_maxHP = 70
garlicSound = ExtResource("2_hh4qh")
freezeSound = ExtResource("3_ltj46")
[node name="CanvasGroup" type="CanvasGroup" parent="."]
material = SubResource("ShaderMaterial_63ls2")
@ -104,11 +111,35 @@ anim_player = NodePath("../AnimationPlayer")
script = ExtResource("4_u5syx")
_speed = SubResource("Resource_ckb7n")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("8_di4dd")
script = ExtResource("9_oxd1e")
[node name="ChompPlayer" type="Node" parent="."]
script = ExtResource("10_ruqsf")
audioStream = ExtResource("11_vjrlo")
channel = "chomp"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"
[node name="HitPlayer" type="Node" parent="."]
script = ExtResource("12_he8da")
playlist = Array[AudioStream]([ExtResource("12_vjrlo")])
channels = Array[String](["hit"])
metadata/_custom_type_script = "uid://c36bj8u7jghc7"
[node name="GroanPlayer" type="Node" parent="."]
script = ExtResource("10_ruqsf")
audioStream = ExtResource("12_ad42i")
channel = "groan"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"
[node name="Timer" type="Timer" parent="GroanPlayer"]
wait_time = 20.0
[node name="StartTimer" type="Timer" parent="GroanPlayer/Timer"]
wait_time = 5.0
one_shot = true
autostart = true
[connection signal="OnDamaged" from="." to="HitPlayer" method="Play"]
[connection signal="OnHPChanged" from="." to="CanvasGroup" method="DamageFlash"]
[connection signal="OnHPChanged" from="." to="AudioStreamPlayer2D" method="OnDamaged"]
[connection signal="area_entered" from="Eatbox" to="Eatbox" method="OnAreaEntered"]
[connection signal="area_exited" from="Eatbox" to="Eatbox" method="OnAreaExited"]
[connection signal="timeout" from="GroanPlayer/Timer" to="GroanPlayer" method="Play"]
[connection signal="timeout" from="GroanPlayer/Timer/StartTimer" to="GroanPlayer/Timer" method="start"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=3 uid="uid://dy41q1kxray5t"]
[gd_scene load_steps=21 format=3 uid="uid://dy41q1kxray5t"]
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_pyk3o"]
[ext_resource type="Texture2D" uid="uid://cksryh4w5dbbx" path="res://assets/sprites/atlases/plants/peashooter.png" id="2_14qlx"]
@ -8,6 +8,8 @@
[ext_resource type="Script" uid="uid://bdk5iqtw4xbkl" path="res://scripts/components/plants/behaviours/PeashooterBehaviour.cs" id="5_7qiua"]
[ext_resource type="Script" uid="uid://dn53jvpjyg63l" path="res://scripts/components/plants/Eyesight.cs" id="7_2bki8"]
[ext_resource type="Script" uid="uid://hccb0aee0x0o" path="res://scripts/components/plants/PlantEyesightLimiter.cs" id="8_nl4jc"]
[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="9_mbbd7"]
[ext_resource type="AudioStream" uid="uid://dsv81mvrdg3w3" path="res://assets/audio/sfx/throw_generic.tres" id="10_q58jr"]
[sub_resource type="Animation" id="Animation_a2y0j"]
length = 0.001
@ -101,8 +103,12 @@ script = ExtResource("7_2bki8")
shape = SubResource("SegmentShape2D_8iovl")
script = ExtResource("8_nl4jc")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." index="6"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
position = Vector2(0, 5)
shape = SubResource("RectangleShape2D_r7xnh")
[node name="ChannelPlayer" type="Node" parent="." index="7"]
script = ExtResource("9_mbbd7")
audioStream = ExtResource("10_q58jr")
channel = "pea_shoot"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=3 uid="uid://b5x35v3w2u8dx"]
[gd_scene load_steps=24 format=3 uid="uid://b5x35v3w2u8dx"]
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_dj7ul"]
[ext_resource type="Texture2D" uid="uid://c77o6ba0mw7a3" path="res://assets/sprites/atlases/plants/potato_mine.png" id="2_sneas"]
@ -6,6 +6,9 @@
[ext_resource type="AnimationLibrary" uid="uid://bjlbdvr6f0r7e" path="res://resources/animations/plants/potato_mine.res" id="3_7tqmj"]
[ext_resource type="Script" uid="uid://c7qfh4py0uulo" path="res://scripts/components/plants/behaviours/PotatomineBehaviour.cs" id="4_twx65"]
[ext_resource type="PackedScene" uid="uid://ckanq33rao1ur" path="res://scenes/particles/potato_explosion.tscn" id="5_px4r0"]
[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="7_b1j2f"]
[ext_resource type="AudioStream" uid="uid://dltjtpyfr1so0" path="res://assets/audio/sfx/potato_mine.mp3" id="8_3vqdc"]
[ext_resource type="AudioStream" uid="uid://b27om1bw1x04e" path="res://assets/audio/sfx/dirt_rise.mp3" id="9_3vqdc"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6uutc"]
animation = &"potato_mine/explode"
@ -103,6 +106,12 @@ particles = ExtResource("5_px4r0")
position = Vector2(0, 9)
shape = SubResource("CircleShape2D_wvns6")
[node name="ExplosionPlayer" type="Node" parent="ExplosionBox" index="1"]
script = ExtResource("7_b1j2f")
audioStream = ExtResource("8_3vqdc")
channel = "explosion"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"
[node name="PrimeTimer" type="Timer" parent="." index="5"]
wait_time = 15.0
one_shot = true
@ -123,5 +132,11 @@ position = Vector2(0, 16.5)
shape = SubResource("RectangleShape2D_ti2g4")
disabled = true
[node name="ChannelPlayer" type="Node" parent="." index="8"]
script = ExtResource("7_b1j2f")
audioStream = ExtResource("9_3vqdc")
channel = "plant_rise"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"
[connection signal="area_entered" from="Detectionbox" to="Behaviour" method="OnAreaEntered"]
[connection signal="timeout" from="PrimeTimer" to="Behaviour" method="Prime"]

View file

@ -31,7 +31,7 @@ size = Vector2(49, 38)
texture = ExtResource("2_ffrjr")
hframes = 10
vframes = 2
frame = 3
frame = 6
[node name="AnimationPlayer" parent="." index="1"]
libraries = {
@ -46,9 +46,7 @@ parameters/blend_position = 0.0
script = ExtResource("3_uhpn7")
_tree = NodePath("../AnimationTree")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="." index="4"]
[node name="Hitbox" parent="." index="5"]
[node name="Hitbox" parent="." index="4"]
collision_layer = 4
collision_mask = 8
script = ExtResource("3_hqtbm")

View file

@ -1,8 +1,7 @@
[gd_scene load_steps=12 format=3 uid="uid://eegv1qihfv2q"]
[gd_scene load_steps=11 format=3 uid="uid://eegv1qihfv2q"]
[ext_resource type="PackedScene" uid="uid://dy41q1kxray5t" path="res://scenes/entities/plants/peashooter.tscn" id="1_muntu"]
[ext_resource type="Script" uid="uid://djpc0kvagpadv" path="res://scripts/components/plants/ThreepeaterShooter.cs" id="2_ieami"]
[ext_resource type="AudioStream" uid="uid://dp6k7xiptn68n" path="res://assets/audio/sfx/pop.mp3" id="2_j7h7q"]
[ext_resource type="Script" uid="uid://hccb0aee0x0o" path="res://scripts/components/plants/PlantEyesightLimiter.cs" id="3_dqn6w"]
[sub_resource type="Animation" id="Animation_a2y0j"]
@ -73,21 +72,20 @@ tracks/1/keys = {
"method": &"Shoot"
}]
}
tracks/2/type = "audio"
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AudioStreamPlayer2D")
tracks/2/path = NodePath("ChannelPlayer")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 0.0,
"stream": ExtResource("2_j7h7q")
}],
"times": PackedFloat32Array(0.25)
"times": PackedFloat32Array(0.25),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"Play"
}]
}
tracks/2/use_blend = true
[sub_resource type="AnimationLibrary" id="AnimationLibrary_pqbws"]
resource_local_to_scene = true

View file

@ -28,13 +28,13 @@ blend_mode = 1
size = Vector2(33, 46)
[node name="Wallnut" instance=ExtResource("1_fluxn")]
_maxHP = 450
_maxHP = 600
[node name="Sprite2D" parent="." index="0"]
texture = ExtResource("2_o5tda")
hframes = 12
vframes = 3
frame = 4
frame = 3
[node name="AnimationPlayer" parent="." index="1"]
libraries = {