Zombie death and damage indicators

This commit is contained in:
Rendo 2025-07-12 00:15:17 +05:00
commit b524f97e7f
14 changed files with 324 additions and 117 deletions

View file

@ -1,5 +1,8 @@
[gd_resource type="AnimationNodeStateMachine" load_steps=10 format=3 uid="uid://dj0blope85bg7"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_w2cv7"]
animation = &"dead_lmao"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_h0rfo"]
animation = &"basic_zombie_eating"
@ -9,9 +12,6 @@ animation = &"basic_zombie_stand"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_g2uel"]
animation = &"basic_zombie_walk"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_w2cv7"]
animation = &"dead_lmao"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_vxhht"]
advance_mode = 2
@ -40,6 +40,8 @@ advance_mode = 2
advance_expression = "get(\"isEating\") == false"
[resource]
states/Death/node = SubResource("AnimationNodeAnimation_w2cv7")
states/Death/position = Vector2(778, 100)
states/End/position = Vector2(977, 90)
states/basic_zombie_eat/node = SubResource("AnimationNodeAnimation_h0rfo")
states/basic_zombie_eat/position = Vector2(575, 185)
@ -47,7 +49,5 @@ states/basic_zombie_idle/node = SubResource("AnimationNodeAnimation_nog33")
states/basic_zombie_idle/position = Vector2(366, 100)
states/basic_zombie_walk/node = SubResource("AnimationNodeAnimation_g2uel")
states/basic_zombie_walk/position = Vector2(575, 35)
states/dead_lmao/node = SubResource("AnimationNodeAnimation_w2cv7")
states/dead_lmao/position = Vector2(778, 100)
transitions = ["Start", "basic_zombie_idle", SubResource("AnimationNodeStateMachineTransition_vxhht"), "basic_zombie_idle", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_r8rju"), "basic_zombie_idle", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_y2ivb"), "basic_zombie_walk", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_7d3k4"), "basic_zombie_eat", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_kk4wi")]
graph_offset = Vector2(-7, -20)

View file

@ -5,6 +5,6 @@
[resource]
script = ExtResource("1_8md01")
ColorOverride = Color(0, 1, 1, 1)
Multiplier = 0.25
Multiplier = 0.75
Duration = 3.25
Slot = "freeze_slow"

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://xu4i6tmkv00a"]
[gd_scene load_steps=15 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"]
@ -8,6 +8,7 @@
[ext_resource type="AudioStream" uid="uid://bu1egfsyplpx4" path="res://assets/audio/sfx/metalhit_generic.tres" id="5_lt6ps"]
[ext_resource type="Texture2D" uid="uid://cmmpfi8ug43l2" path="res://assets/sprites/bucket3.tres" id="5_v1iwd"]
[ext_resource type="AudioStream" uid="uid://w0qfwds4o3ti" path="res://assets/audio/sfx/hit_generic.tres" id="6_kedip"]
[ext_resource type="Texture2D" uid="uid://dacgbwohpmeed" path="res://assets/sprites/zombies/basic.png" id="6_lea3a"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wdi07"]
resource_local_to_scene = true
@ -15,6 +16,14 @@ shader = ExtResource("2_3mrqj")
shader_parameter/blend_color = Color(1, 1, 1, 1)
shader_parameter/amount = 0.0
[sub_resource type="AtlasTexture" id="AtlasTexture_wfem3"]
atlas = ExtResource("6_lea3a")
region = Rect2(24, 2, 9, 9)
[sub_resource type="AtlasTexture" id="AtlasTexture_auqeq"]
atlas = ExtResource("6_lea3a")
region = Rect2(0, 32, 9, 15)
[sub_resource type="Resource" id="Resource_2bm8y"]
resource_local_to_scene = true
script = ExtResource("4_1s2fn")
@ -41,7 +50,7 @@ scale = Vector2(0.999912, 0.999912)
scale = Vector2(0.999831, 0.999831)
[node name="RightLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg" index="1"]
scale = Vector2(0.999832, 0.999832)
scale = Vector2(0.999833, 0.999833)
[node name="RightFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg" index="0"]
scale = Vector2(0.999833, 0.999833)
@ -50,42 +59,69 @@ scale = Vector2(0.999833, 0.999833)
scale = Vector2(0.999834, 0.999834)
[node name="LeftLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg" index="1"]
scale = Vector2(0.999835, 0.999835)
scale = Vector2(0.999836, 0.999836)
[node name="LeftFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg" index="1"]
scale = Vector2(0.999828, 0.999828)
scale = Vector2(0.99983, 0.99983)
[node name="Body" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="3"]
scale = Vector2(0.999829, 0.999829)
[node name="RightUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="0"]
scale = Vector2(0.999826, 0.999826)
scale = Vector2(0.999828, 0.999828)
[node name="RightLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm" index="1"]
scale = Vector2(0.999825, 0.999825)
scale = Vector2(0.99983, 0.99983)
[node name="RightHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm" index="0"]
scale = Vector2(0.99983, 0.99983)
[node name="Head" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="3"]
visible = false
scale = Vector2(0.999826, 0.999826)
[node name="Jaw" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="0"]
position = Vector2(-3, 3)
scale = Vector2(0.999828, 0.999828)
[node name="Hat" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Head" index="0"]
position = Vector2(-4.00424, -6.00927)
[node name="Sprite" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Head/Hat" index="0"]
texture = ExtResource("3_0nlp0")
degradationStages = Array[Texture]([ExtResource("3_0nlp0"), ExtResource("4_xx7fu"), ExtResource("5_v1iwd")])
[node name="Jaw" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head" index="1"]
scale = Vector2(0.999828, 0.999828)
[node name="LeftUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="4"]
scale = Vector2(0.999829, 0.999829)
[node name="Hat" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head" index="4"]
position = Vector2(-6, -8)
[node name="LeftLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm" index="1"]
scale = Vector2(0.99983, 0.99983)
[node name="Sprite" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Hat" index="0"]
position = Vector2(0.994479, -10.0058)
texture = ExtResource("3_0nlp0")
degradationStages = Array[Texture]([ExtResource("3_0nlp0"), ExtResource("4_xx7fu"), ExtResource("5_v1iwd")])
[node name="LeftUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="4"]
scale = Vector2(0.999828, 0.999828)
[node name="Left_Lower_Arm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile" index="0"]
scale = Vector2(0.999998, 0.999998)
[node name="Left_Hand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm" index="0"]
show_behind_parent = false
position = Vector2(-0.99983, 12.9978)
scale = Vector2(0.999656, 0.999656)
[node name="LeftLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm" index="2"]
scale = Vector2(0.999828, 0.999828)
[node name="LeftHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm" index="0"]
scale = Vector2(0.999829, 0.999829)
scale = Vector2(0.999826, 0.999826)
[node name="Left_Hand" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand" index="0"]
texture = SubResource("AtlasTexture_wfem3")
centered = false
offset = Vector2(-4, 0)
metadata/_edit_lock_ = true
[node name="Left_Lower_Arm" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm" index="1"]
texture = SubResource("AtlasTexture_auqeq")
centered = false
offset = Vector2(-5, 0)
metadata/_edit_lock_ = true
[node name="Eatbox" parent="." index="2"]
_damage = SubResource("Resource_2bm8y")
@ -93,9 +129,9 @@ _damage = SubResource("Resource_2bm8y")
[node name="Mover" parent="." index="4"]
_speed = SubResource("Resource_lt6ps")
[node name="HitPlayer" parent="." index="6"]
[node name="Armor" parent="." index="6"]
MaxHP = 375.0
[node name="HitPlayer" parent="." index="7"]
playlist = Array[AudioStream]([ExtResource("5_lt6ps"), ExtResource("6_kedip")])
channels = Array[String](["metal_hit", "hit"])
[node name="Armor" parent="." index="7"]
MaxHP = 375.0

View file

@ -41,79 +41,96 @@ _armor = NodePath("Armor")
material = SubResource("ShaderMaterial_sat5k")
[node name="RightUpperLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="1"]
scale = Vector2(0.999835, 0.999835)
[node name="RightLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg" index="1"]
scale = Vector2(0.999834, 0.999834)
[node name="RightFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg" index="0"]
[node name="RightLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg" index="1"]
scale = Vector2(0.999835, 0.999835)
[node name="RightFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg" index="0"]
scale = Vector2(0.999831, 0.999831)
[node name="LeftUpperLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="2"]
scale = Vector2(0.999829, 0.999829)
scale = Vector2(0.999832, 0.999832)
[node name="LeftLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg" index="1"]
scale = Vector2(0.999832, 0.999832)
scale = Vector2(0.99983, 0.99983)
[node name="LeftFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg" index="1"]
scale = Vector2(0.999829, 0.999829)
[node name="Body" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="3"]
scale = Vector2(0.999832, 0.999832)
scale = Vector2(0.999829, 0.999829)
[node name="RightUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="0"]
scale = Vector2(0.999828, 0.999828)
[node name="RightLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm" index="1"]
scale = Vector2(0.999827, 0.999827)
scale = Vector2(0.999828, 0.999828)
[node name="RightHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm" index="0"]
scale = Vector2(0.999828, 0.999828)
[node name="Tie" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="2"]
skew = -8.66652e-05
skew = -8.97646e-05
[node name="Head" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="3"]
scale = Vector2(0.999826, 0.999826)
scale = Vector2(0.999829, 0.999829)
[node name="Hat" type="RigidBody2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Head" index="0" node_paths=PackedStringArray("data")]
[node name="Left_Eye" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="1"]
position = Vector2(-4, -8.99999)
[node name="Jaw" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="2"]
position = Vector2(-2.87212, 2.69138)
rotation = -0.0719238
scale = Vector2(0.999829, 0.999829)
[node name="Jaw" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head" index="1"]
scale = Vector2(0.999829, 0.999829)
[node name="Hat" type="RigidBody2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head" index="4" node_paths=PackedStringArray("data")]
position = Vector2(-2.5, -13.5)
scale = Vector2(1.00043, 1.00043)
scale = Vector2(1.00086, 1.00086)
collision_layer = 128
collision_mask = 64
mass = 0.5
center_of_mass_mode = 1
freeze = true
script = ExtResource("3_w70im")
data = NodePath("../../../../../../../..")
data = NodePath("../../../../../../..")
maxAngle = 45.0
minTorque = -45.0
maxTorque = 45.0
Impulse = 100.0
[node name="Sprite" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Head/Hat" index="0" node_paths=PackedStringArray("armor")]
[node name="Sprite" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Hat" index="0" node_paths=PackedStringArray("armor")]
position = Vector2(-1, -12)
texture = ExtResource("4_qdhik")
script = ExtResource("5_ickyd")
armor = NodePath("../../../../../../../../../Armor")
armor = NodePath("../../../../../../../../Armor")
degradationStages = Array[Texture]([ExtResource("4_qdhik"), ExtResource("6_b6mal"), ExtResource("7_011r0")])
thresholdPercentage = Array[float]([1.0, 0.667, 0.333])
[node name="CollisionShape2D" type="CollisionShape2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Head/Hat" index="1"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Hat" index="1"]
position = Vector2(1, -6)
shape = SubResource("CircleShape2D_67t4t")
[node name="Jaw" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head" index="1"]
scale = Vector2(0.999828, 0.999828)
[node name="LeftUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="4"]
scale = Vector2(0.999829, 0.999829)
[node name="LeftLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm" index="1"]
scale = Vector2(0.999823, 0.999823)
[node name="Left_Lower_Arm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile" index="0"]
rotation = -0.109137
scale = Vector2(0.999998, 0.999998)
[node name="Left_Hand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm" index="0"]
position = Vector2(-0.99983, 12.9978)
rotation = -0.0899616
scale = Vector2(0.999656, 0.999656)
[node name="LeftLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm" index="2"]
scale = Vector2(0.999828, 0.999828)
[node name="LeftHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm" index="0"]
scale = Vector2(0.999827, 0.999827)
scale = Vector2(0.999826, 0.999826)
[node name="Eatbox" parent="." index="2"]
_damage = SubResource("Resource_w70im")
@ -121,13 +138,13 @@ _damage = SubResource("Resource_w70im")
[node name="Mover" parent="." index="4"]
_speed = SubResource("Resource_qof5v")
[node name="HitPlayer" parent="." index="6"]
playlist = Array[AudioStream]([ExtResource("7_0amn8"), ExtResource("7_67t4t")])
channels = Array[String](["plastic_hit", "hit"])
[node name="Armor" type="Node" parent="." index="7"]
[node name="Armor" type="Node" parent="." index="6"]
script = ExtResource("3_5s7in")
MaxHP = 135.0
[node name="HitPlayer" parent="." index="7"]
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/basic_zombie_walk/Zombie/Butt/Body/Head/Head/Hat" method="FallOff"]
[connection signal="ArmorLost" from="Armor" to="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Hat" method="FallOff"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=60 format=3 uid="uid://co11v3w8hbwgf"]
[gd_scene load_steps=65 format=3 uid="uid://co11v3w8hbwgf"]
[ext_resource type="Script" uid="uid://dildme6epx8l4" path="res://scripts/zombies/RuntimeZombieData.cs" id="1_qq3f1"]
[ext_resource type="AudioStream" uid="uid://dt13iugnnx4op" path="res://assets/audio/sfx/yuck_generic.tres" id="2_hh4qh"]
@ -9,7 +9,9 @@
[ext_resource type="Script" uid="uid://7hdj2k14lfe4" path="res://scripts/zombies/ZombieMover.cs" id="4_u5syx"]
[ext_resource type="Texture2D" uid="uid://dacgbwohpmeed" path="res://assets/sprites/zombies/basic.png" id="6_xnora"]
[ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="7_b3p4o"]
[ext_resource type="Script" uid="uid://dt5uj25u0g6y3" path="res://scripts/particles/FallParticle.cs" id="7_dn8ha"]
[ext_resource type="AnimationNodeStateMachine" uid="uid://dj0blope85bg7" path="res://resources/animations/zombies/basic_zombie_tree.tres" id="8_ckb7n"]
[ext_resource type="Script" uid="uid://dau0tfmlfiqmo" path="res://scripts/EntityHPObserver.cs" id="8_mc1kl"]
[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="10_ruqsf"]
[ext_resource type="Script" uid="uid://dwlwi42smgxkb" path="res://scripts/TimeScalableAnimationTree.cs" id="11_ccrjo"]
[ext_resource type="AudioStream" uid="uid://dyid55nhflwyn" path="res://assets/audio/sfx/chomp_generic.tres" id="11_vjrlo"]
@ -20,6 +22,7 @@
[ext_resource type="Resource" uid="uid://dsg1vjx76ifgu" path="res://resources/effects/GarlicEffect.tres" id="18_2q05d"]
[ext_resource type="Resource" uid="uid://7uj0oe656jfx" path="res://resources/effects/SnowSlow.tres" id="19_ccrjo"]
[ext_resource type="Script" uid="uid://c1x4n4nqyq72f" path="res://scripts/audio/ChannelSettings.cs" id="21_xnora"]
[ext_resource type="Script" uid="uid://dk32ln8c2574d" path="res://scripts/ZombieKillHandler.cs" id="23_mc1kl"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_63ls2"]
resource_local_to_scene = true
@ -170,10 +173,6 @@ region = Rect2(72, 2, 13, 26)
atlas = ExtResource("6_xnora")
region = Rect2(36, 0, 32, 29)
[sub_resource type="AtlasTexture" id="AtlasTexture_x5uj2"]
atlas = ExtResource("6_xnora")
region = Rect2(15, 17, 17, 6)
[sub_resource type="AtlasTexture" id="AtlasTexture_vcc72"]
atlas = ExtResource("6_xnora")
region = Rect2(93, 3, 2, 3)
@ -182,17 +181,27 @@ region = Rect2(93, 3, 2, 3)
atlas = ExtResource("6_xnora")
region = Rect2(105, 2, 3, 4)
[sub_resource type="AtlasTexture" id="AtlasTexture_x5uj2"]
atlas = ExtResource("6_xnora")
region = Rect2(15, 17, 17, 6)
[sub_resource type="CircleShape2D" id="CircleShape2D_dn8ha"]
[sub_resource type="AtlasTexture" id="AtlasTexture_djocr"]
atlas = ExtResource("6_xnora")
region = Rect2(2, 7, 6, 19)
[sub_resource type="AtlasTexture" id="AtlasTexture_auqeq"]
atlas = ExtResource("6_xnora")
region = Rect2(0, 32, 9, 15)
[sub_resource type="AtlasTexture" id="AtlasTexture_6y4ja"]
atlas = ExtResource("6_xnora")
region = Rect2(13, 2, 9, 10)
[sub_resource type="AtlasTexture" id="AtlasTexture_auqeq"]
atlas = ExtResource("6_xnora")
region = Rect2(0, 32, 9, 15)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ccrjo"]
radius = 3.00026
height = 16.007
[sub_resource type="Animation" id="Animation_x5uj2"]
tracks/0/type = "value"
@ -690,7 +699,7 @@ tracks/40/keys = {
tracks/41/type = "value"
tracks/41/imported = false
tracks/41/enabled = true
tracks/41/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand/Left_Hand:texture")
tracks/41/path = NodePath("Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm/Left_Hand:texture")
tracks/41/interp = 1
tracks/41/loop_wrap = true
tracks/41/keys = {
@ -702,7 +711,7 @@ tracks/41/keys = {
tracks/42/type = "value"
tracks/42/imported = false
tracks/42/enabled = true
tracks/42/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand/Left_Hand:offset")
tracks/42/path = NodePath("Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm/Left_Hand:offset")
tracks/42/interp = 1
tracks/42/loop_wrap = true
tracks/42/keys = {
@ -1190,7 +1199,7 @@ tracks/37/keys = {
tracks/38/type = "value"
tracks/38/imported = false
tracks/38/enabled = true
tracks/38/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand/Left_Hand:texture")
tracks/38/path = NodePath("Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm/Left_Hand:texture")
tracks/38/interp = 1
tracks/38/loop_wrap = true
tracks/38/keys = {
@ -1202,7 +1211,7 @@ tracks/38/keys = {
tracks/39/type = "value"
tracks/39/imported = false
tracks/39/enabled = true
tracks/39/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand/Left_Hand:offset")
tracks/39/path = NodePath("Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm/Left_Hand:offset")
tracks/39/interp = 1
tracks/39/loop_wrap = true
tracks/39/keys = {
@ -2701,7 +2710,7 @@ size = Vector2(16, 48)
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_2q05d"]
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_ccrjo"]
graph_offset = Vector2(-240, 63)
graph_offset = Vector2(-427, 26)
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_2q05d")
nodes/TimeScale/position = Vector2(60, 120)
nodes/Tree/node = ExtResource("8_ckb7n")
@ -2728,6 +2737,7 @@ freezeSound = ExtResource("3_ltj46")
MaxHP = 70.0
_player = NodePath("CanvasGroup/basic_zombie_walk/AnimationPlayer")
_tree = NodePath("AnimationTree")
metadata/_edit_vertical_guides_ = [-159.0]
[node name="CanvasGroup" type="CanvasGroup" parent="."]
material = SubResource("ShaderMaterial_63ls2")
@ -2740,7 +2750,7 @@ modification_stack = SubResource("SkeletonModificationStack2D_wn68q")
[node name="Butt" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie"]
position = Vector2(5, -35)
scale = Vector2(0.999909, 0.999909)
scale = Vector2(0.999904, 0.999904)
rest = Transform2D(1, 0, 0, 1, 5, -35)
editor_settings/show_bone_gizmo = false
@ -2764,13 +2774,13 @@ metadata/_edit_lock_ = true
[node name="RightLowerLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg"]
position = Vector2(-2, 12)
scale = Vector2(0.999835, 0.999835)
scale = Vector2(0.999841, 0.999841)
rest = Transform2D(1, 0, 0, 1, -2, 12)
editor_settings/show_bone_gizmo = false
[node name="RightFoot" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg"]
position = Vector2(-2, 14)
scale = Vector2(0.999833, 0.999833)
scale = Vector2(0.999831, 0.999831)
rest = Transform2D(1, 0, 0, 1, -2, 14)
auto_calculate_length_and_angle = false
length = 12.0
@ -2792,7 +2802,7 @@ metadata/_edit_lock_ = true
[node name="LeftUpperLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt"]
position = Vector2(6, 4)
scale = Vector2(0.999833, 0.999833)
scale = Vector2(0.999836, 0.999836)
rest = Transform2D(1, 0, 0, 1, 6, 4)
editor_settings/show_bone_gizmo = false
@ -2804,7 +2814,7 @@ metadata/_edit_lock_ = true
[node name="LeftLowerLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg"]
position = Vector2(-1, 13)
scale = Vector2(0.999832, 0.999832)
scale = Vector2(0.999834, 0.999834)
rest = Transform2D(1, 0, 0, 1, -1, 13)
editor_settings/show_bone_gizmo = false
@ -2816,7 +2826,7 @@ metadata/_edit_lock_ = true
[node name="LeftFoot" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg"]
position = Vector2(6, 10)
scale = Vector2(0.999834, 0.999834)
scale = Vector2(0.999832, 0.999832)
rest = Transform2D(1, 0, 0, 1, 6, 10)
auto_calculate_length_and_angle = false
length = 12.0
@ -2831,14 +2841,14 @@ metadata/_edit_lock_ = true
[node name="Body" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt"]
position = Vector2(1, -2)
scale = Vector2(0.999834, 0.999834)
scale = Vector2(0.999832, 0.999832)
rest = Transform2D(1, 0, 0, 1, 1, -2)
editor_settings/show_bone_gizmo = false
[node name="RightUpperArm" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
z_index = -1
position = Vector2(-14, -23)
scale = Vector2(0.999829, 0.999829)
scale = Vector2(0.999828, 0.999828)
rest = Transform2D(1, 0, 0, 1, -14, -23)
editor_settings/show_bone_gizmo = false
@ -2850,13 +2860,13 @@ metadata/_edit_lock_ = true
[node name="RightLowerArm" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm"]
position = Vector2(-2, 15)
scale = Vector2(0.999827, 0.999827)
scale = Vector2(0.99983, 0.99983)
rest = Transform2D(1, 0, 0, 1, -2, 15)
editor_settings/show_bone_gizmo = false
[node name="RightHand" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm"]
position = Vector2(-1, 13)
scale = Vector2(0.999829, 0.999829)
scale = Vector2(0.99983, 0.99983)
rest = Transform2D(1, 0, 0, 1, -1, 13)
auto_calculate_length_and_angle = false
length = 8.0
@ -2884,7 +2894,7 @@ metadata/_edit_lock_ = true
[node name="Tie" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
position = Vector2(-9, -21)
skew = -0.0001266
skew = -0.000184774
rest = Transform2D(1, 0, 0, 1, -9, -21)
auto_calculate_length_and_angle = false
length = 24.0
@ -2899,30 +2909,69 @@ metadata/_edit_lock_ = true
[node name="Head" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
position = Vector2(-10, -25)
scale = Vector2(0.999826, 0.999826)
scale = Vector2(0.999829, 0.999829)
rest = Transform2D(1, 0, 0, 1, -10, -25)
editor_settings/show_bone_gizmo = false
[node name="Head" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head"]
[node name="HeadParticle" type="RigidBody2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head" node_paths=PackedStringArray("data")]
collision_layer = 128
collision_mask = 64
freeze = true
script = ExtResource("7_dn8ha")
data = NodePath("../../../../../../..")
maxAngle = 45.0
minTorque = -45.0
maxTorque = 45.0
Impulse = 100.0
[node name="Head" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle"]
texture = SubResource("AtlasTexture_wn68q")
centered = false
offset = Vector2(-20, -24)
metadata/_edit_lock_ = true
[node name="Right_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
position = Vector2(-16, -8)
texture = SubResource("AtlasTexture_vcc72")
centered = false
offset = Vector2(-2, -2)
metadata/_edit_lock_ = true
[node name="Left_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
position = Vector2(-4, -9)
texture = SubResource("AtlasTexture_kto0i")
centered = false
offset = Vector2(-2, -2)
metadata/_edit_lock_ = true
[node name="Jaw" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
position = Vector2(-3, 3)
scale = Vector2(0.999827, 0.999827)
texture = SubResource("AtlasTexture_x5uj2")
centered = false
offset = Vector2(-12, -2)
metadata/_edit_lock_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle"]
position = Vector2(-4.58496, -8.21035)
shape = SubResource("CircleShape2D_dn8ha")
[node name="Observer" type="Node" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle" node_paths=PackedStringArray("_observedEntity")]
script = ExtResource("8_mc1kl")
_threshold = 0.0
_observedEntity = NodePath("../../../../../../../..")
[node name="Jaw" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head"]
position = Vector2(-3, 3)
scale = Vector2(0.99983, 0.99983)
scale = Vector2(0.999827, 0.999827)
rest = Transform2D(1, 0, 0, 1, -3, 3)
auto_calculate_length_and_angle = false
length = 11.0
bone_angle = 180.0
editor_settings/show_bone_gizmo = false
[node name="Jaw" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Jaw"]
texture = SubResource("AtlasTexture_x5uj2")
centered = false
offset = Vector2(-12, -2)
metadata/_edit_lock_ = true
[node name="RemoteTransform2D" type="RemoteTransform2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Jaw"]
remote_path = NodePath("../../HeadParticle/Head/Jaw")
[node name="RightEye" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head"]
position = Vector2(-16, -8)
@ -2932,11 +2981,8 @@ length = 2.0
bone_angle = 180.0
editor_settings/show_bone_gizmo = false
[node name="Right_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/RightEye"]
texture = SubResource("AtlasTexture_vcc72")
centered = false
offset = Vector2(-2, -2)
metadata/_edit_lock_ = true
[node name="RemoteTransform2D" type="RemoteTransform2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/RightEye"]
remote_path = NodePath("../../HeadParticle/Head/Right_Eye")
[node name="LeftEye" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head"]
position = Vector2(-4, -9)
@ -2946,15 +2992,12 @@ length = 2.0
bone_angle = 180.0
editor_settings/show_bone_gizmo = false
[node name="Left_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/LeftEye"]
texture = SubResource("AtlasTexture_kto0i")
centered = false
offset = Vector2(-2, -2)
metadata/_edit_lock_ = true
[node name="RemoteTransform2D" type="RemoteTransform2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/LeftEye"]
remote_path = NodePath("../../HeadParticle/Head/Left_Eye")
[node name="LeftUpperArm" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
position = Vector2(-1, -20)
scale = Vector2(0.999828, 0.999828)
scale = Vector2(0.999824, 0.999824)
rest = Transform2D(1, 0, 0, 1, -1, -20)
editor_settings/show_bone_gizmo = false
@ -2965,32 +3008,63 @@ centered = false
offset = Vector2(33, -12)
metadata/_edit_lock_ = true
[node name="HandProjectile" type="RigidBody2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm" node_paths=PackedStringArray("data")]
position = Vector2(-2, 14)
collision_layer = 128
collision_mask = 64
freeze = true
script = ExtResource("7_dn8ha")
data = NodePath("../../../../../../..")
minTorque = -45.0
maxTorque = 45.0
[node name="Left_Lower_Arm" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile"]
rotation = 0.396612
scale = Vector2(0.999999, 0.999999)
texture = SubResource("AtlasTexture_auqeq")
centered = false
offset = Vector2(-5, 0)
metadata/_edit_lock_ = true
[node name="Left_Hand" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm"]
show_behind_parent = true
position = Vector2(-0.999832, 12.9978)
rotation = 0.28535
scale = Vector2(0.999658, 0.999658)
texture = SubResource("AtlasTexture_6y4ja")
centered = false
offset = Vector2(-4, -1)
metadata/_edit_lock_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile"]
position = Vector2(-0.00104554, 13.0063)
shape = SubResource("CapsuleShape2D_ccrjo")
[node name="Observer" type="Node" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile" node_paths=PackedStringArray("_observedEntity")]
script = ExtResource("8_mc1kl")
_observedEntity = NodePath("../../../../../../../..")
[node name="LeftLowerArm" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm"]
position = Vector2(-2, 14)
scale = Vector2(0.999825, 0.999825)
scale = Vector2(0.999829, 0.999829)
rest = Transform2D(1, 0, 0, 1, -2, 14)
editor_settings/show_bone_gizmo = false
[node name="LeftHand" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm"]
position = Vector2(-1, 13)
scale = Vector2(0.999824, 0.999824)
scale = Vector2(0.999828, 0.999828)
rest = Transform2D(1, 0, 0, 1, -1, 13)
auto_calculate_length_and_angle = false
length = 6.0
bone_angle = 90.0
editor_settings/show_bone_gizmo = false
[node name="Left_Hand" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand"]
texture = SubResource("AtlasTexture_6y4ja")
centered = false
offset = Vector2(-4, -1)
metadata/_edit_lock_ = true
[node name="Left_Hand_Remote" type="RemoteTransform2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand"]
remote_path = NodePath("../../../HandProjectile/Left_Lower_Arm/Left_Hand")
[node name="Left_Lower_Arm" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm"]
texture = SubResource("AtlasTexture_auqeq")
centered = false
offset = Vector2(-5, 0)
metadata/_edit_lock_ = true
[node name="Left_Lower_Arm_Remote" type="RemoteTransform2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm"]
scale = Vector2(1.00017, 1.00017)
remote_path = NodePath("../../HandProjectile/Left_Lower_Arm")
[node name="AnimationPlayer" type="AnimationPlayer" parent="CanvasGroup/basic_zombie_walk"]
libraries = {
@ -3060,8 +3134,21 @@ effectsToMap = Array[Resource]([ExtResource("18_2q05d"), ExtResource("19_ccrjo")
streamsToMapTo = Array[AudioStream]([ExtResource("2_hh4qh"), ExtResource("3_ltj46")])
streamSettings = Array[Object]([null, SubResource("Resource_dn8ha")])
[node name="DeathHandler" type="Node" parent="." node_paths=PackedStringArray("_tree", "_collider")]
script = ExtResource("23_mc1kl")
_tree = NodePath("../AnimationTree")
_collider = NodePath("../Hitbox/CollisionShape2D")
[connection signal="HasBeenKilled" from="." to="DeathHandler" method="OnKilled"]
[connection signal="OnDamaged" from="." to="HitPlayer" method="Play"]
[connection signal="OnHPChanged" from="." to="CanvasGroup" method="DamageFlash"]
[connection signal="ThresholdReached" from="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Observer" to="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle" method="FallOff"]
[connection signal="ThresholdReached" from="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Observer" to="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/Jaw/RemoteTransform2D" method="queue_free"]
[connection signal="ThresholdReached" from="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Observer" to="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/RightEye/RemoteTransform2D" method="queue_free"]
[connection signal="ThresholdReached" from="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Observer" to="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/LeftEye/RemoteTransform2D" method="queue_free"]
[connection signal="ThresholdReached" from="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Observer" to="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile" method="FallOff"]
[connection signal="ThresholdReached" from="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Observer" to="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand/Left_Hand_Remote" method="queue_free"]
[connection signal="ThresholdReached" from="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Observer" to="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/Left_Lower_Arm_Remote" method="queue_free"]
[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"]

View file

@ -390,8 +390,8 @@ shape = SubResource("WorldBoundaryShape2D_3ghv7")
[node name="Floor5" type="StaticBody2D" parent="Lines"]
position = Vector2(528, 132)
collision_layer = 64
collision_mask = 0
collision_layer = 128
collision_mask = 64
[node name="CollisionShape2D" type="CollisionShape2D" parent="Lines/Floor5"]
shape = SubResource("WorldBoundaryShape2D_3ghv7")

View file

@ -10,7 +10,7 @@ public partial class Entity : Node2D
#region Health points
[Export] public float MaxHP;
public float HP;
[Signal] public delegate void OnHPChangedEventHandler(int deltaHP, Node origin);
[Signal] public delegate void OnHPChangedEventHandler(float deltaHP, Node origin);
[Signal] public delegate void OnDamagedEventHandler();
public virtual void TakeDamage(float amount, Node origin)

View file

@ -0,0 +1,32 @@
using Godot;
namespace Newlon.Components;
public partial class EntityHPObserver : Node
{
[Export] private float _threshold = 0.5f;
[Export] private bool _setGreater = false;
[Export] private Entity _observedEntity;
[Signal] public delegate void ThresholdReachedEventHandler();
public override void _Ready()
{
_observedEntity.OnHPChanged += OnHPChanged;
}
private void OnHPChanged(float delta, Node origin)
{
if (_setGreater == false && _observedEntity.HP / _observedEntity.MaxHP < _threshold)
{
EmitSignal(SignalName.ThresholdReached);
_observedEntity.OnHPChanged -= OnHPChanged;
QueueFree();
}
else if (_setGreater && _observedEntity.HP / _observedEntity.MaxHP > _threshold)
{
EmitSignal(SignalName.ThresholdReached);
_observedEntity.OnHPChanged -= OnHPChanged;
QueueFree();
}
}
}

View file

@ -0,0 +1 @@
uid://dau0tfmlfiqmo

View file

@ -0,0 +1,24 @@
using Godot;
using Newlon.Components.Zombies;
public partial class ZombieKillHandler : Node
{
[Export] private AnimationTree _tree;
[Export] private CollisionShape2D _collider;
private void OnKilled(RuntimeZombieData who)
{
var tween = CreateTween();
tween.TweenInterval(4.0);
tween.TweenCallback(Callable.From(() =>
{
((AnimationNodeStateMachinePlayback)_tree.Get("parameters/Tree/playback")).Travel("Death");
_collider.Disabled = true;
}));
tween.TweenInterval(3.0);
tween.TweenProperty(who, "modulate",new Color(1, 1, 1, 0),1.0);
tween.TweenCallback(Callable.From(() =>
{
who.Kill();
}));
}
}

View file

@ -0,0 +1 @@
uid://dk32ln8c2574d

View file

@ -2,6 +2,9 @@ using Godot;
using Newlon.Components.Level;
using Newlon.Components.Zombies;
namespace Newlon.Components;
[GlobalClass]
public partial class FallParticle : RigidBody2D
{
[Export] private RuntimeZombieData data;
@ -19,10 +22,11 @@ public partial class FallParticle : RigidBody2D
}
Callable.From(() =>
{
Reparent(PoolContainer.Instance.Zombies);
Reparent(PoolContainer.Instance.Particles);
float rng_angle = Mathf.DegToRad((float)GD.RandRange(minAngle, maxAngle));
float rng_torque = Mathf.DegToRad((float)GD.RandRange(minTorque, maxTorque));
ApplyImpulse(new Vector2(Mathf.Sin(rng_angle) * Impulse, Mathf.Cos(rng_angle) * Impulse));
if (Impulse != 0)
ApplyImpulse(new Vector2(Mathf.Sin(rng_angle) * Impulse, Mathf.Cos(rng_angle) * Impulse));
ApplyTorqueImpulse(rng_torque);
}).CallDeferred();
var tween = CreateTween();

View file

@ -10,6 +10,7 @@ public partial class RuntimeZombieData : Entity
private AudioStream garlicSound;
[Export]
private AudioStream freezeSound;
[Signal] public delegate void HasBeenKilledEventHandler(RuntimeZombieData who);
public bool AbleToEat = true;
public override void Heal(float amount, Node origin)
@ -44,9 +45,13 @@ public partial class RuntimeZombieData : Entity
}
}
#region Death sequence
private bool _killed = false;
public override void KillByDamage()
{
if (_killed) return;
_killed = true;
AbleToEat = false;
EmitSignal(SignalName.HasBeenKilled,this);
}
#endregion