墙体互动

master
chendian 1 year ago
parent 9df257acdf
commit 21b288986c

@ -0,0 +1,9 @@
# Editor configuration, see https://editorconfig.org
root = true
[*.gd]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

@ -14,8 +14,8 @@ is_rebound = false
is_stop_self = true
is_throw_check = false
is_throw_end = false
hit_back_speed = 6.0
hit_up_speed = -6.0
hit_back_speed = 7.0
hit_up_speed = -7.0
hit_back_duration = 0.05
hit_up_duration = 0.05
pause_time = 0.15

@ -14,8 +14,8 @@ is_rebound = false
is_stop_self = true
is_throw_check = false
is_throw_end = true
hit_back_speed = 6.0
hit_up_speed = -6.0
hit_back_speed = 7.0
hit_up_speed = -7.0
hit_back_duration = 0.05
hit_up_duration = 0.05
pause_time = 0.0

@ -5,18 +5,18 @@
[resource]
script = ExtResource("1_2fwsa")
damage_rate = 1.0
break_level = 1
break_level = 2
stun_attack = 10.0
damage_type = 2
damage_type = 1
is_floating = true
is_hit_down = false
is_rebound = true
is_stop_self = true
is_throw_check = false
is_throw_end = false
hit_back_speed = 0.0
hit_up_speed = 3.0
hit_back_duration = 0.0
hit_back_speed = 3.0
hit_up_speed = 4.0
hit_back_duration = 0.05
hit_up_duration = 0.05
pause_time = 0.15
pause_time = 0.0
is_force_pause = false

@ -0,0 +1,15 @@
shader_type spatial;
render_mode blend_add,unshaded,depth_test_disabled,cull_disabled;
uniform sampler2D tex_main : source_color;
uniform sampler2D tex_noise : source_color;
uniform sampler2D tex_mask : source_color;
void fragment() {
vec4 col_main = texture(tex_main, UV);
vec4 col_noise = texture(tex_noise, UV - 0.5 * vec2(mod(TIME, 2.0) - 1.0, 0));
vec4 col_mask = texture(tex_mask, UV);
vec4 col = (col_noise + col_main) * col_mask;
ALBEDO = col.rgb;
ALPHA = col_mask.r * COLOR.a;
}

@ -0,0 +1,15 @@
shader_type spatial;
render_mode unshaded,cull_disabled;
uniform sampler2D tex_main : source_color;
uniform sampler2D tex_noise : source_color;
void fragment() {
vec4 col = texture(tex_main, UV);
float noise_alpha = texture(tex_noise, UV).r;
if (COLOR.a >= noise_alpha){
noise_alpha = 1.0;
}
ALBEDO = COLOR.rgb;
ALPHA = COLOR.a * col.r * noise_alpha;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cvm7ouwqnp235"
path="res://.godot/imported/circle4.png-9a88e12df394f7eee2753e6eda35c5ca.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/particle/shape/circle4.png"
dest_files=["res://.godot/imported/circle4.png-9a88e12df394f7eee2753e6eda35c5ca.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://oxcyfuprk6a8"
path="res://.godot/imported/decal1.png-957eac5df67f2c0ba2501f6cb78618bc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/particle/shape/decal1.png"
dest_files=["res://.godot/imported/decal1.png-957eac5df67f2c0ba2501f6cb78618bc.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,68 +0,0 @@
[gd_scene load_steps=10 format=3 uid="uid://5d1a3s6x77wd"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_2t2j1"]
[ext_resource type="Texture2D" uid="uid://bjv7f83tdgq17" path="res://render/texture/decal/decal_explode.png" id="2_vkpca"]
[ext_resource type="Script" path="res://script/effect/particle_decal.gd" id="3_dwi0o"]
[ext_resource type="Texture2D" uid="uid://brgii0qi4s6kb" path="res://render/texture/decal/decal_dust.png" id="4_jxr0h"]
[ext_resource type="Texture2D" uid="uid://dkhmqgtc8tn1t" path="res://render/texture/decal/decal_shockwave.png" id="5_c3jkk"]
[ext_resource type="Texture2D" uid="uid://b6bfacouwy2hi" path="res://render/texture/decal/decal_glow.png" id="6_2la8o"]
[sub_resource type="Curve" id="Curve_w5jkx"]
max_value = 0.6
_data = [Vector2(0, 0), 0.0, 0.84, 0, 0, Vector2(0.0196078, 0.6), 0.0, 0.0, 0, 0, Vector2(1, 0.6), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="Curve" id="Curve_r6bwy"]
max_value = 1.5
_data = [Vector2(0, 1.06915), 0.0, 1.4, 0, 0, Vector2(1, 1.5), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="Curve" id="Curve_18e7g"]
min_value = 1.0
max_value = 2.0
_data = [Vector2(0, 1), 0.0, 1.4, 0, 0, Vector2(1, 2), 0.0, 0.0, 0, 0]
point_count = 2
[node name="Particle" type="Node3D"]
script = ExtResource("1_2t2j1")
[node name="DecalExplode" type="Decal" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
size = Vector3(1, 5, 1)
texture_albedo = ExtResource("2_vkpca")
modulate = Color(0, 0, 0, 1)
upper_fade = 21.3037
cull_mask = 1
script = ExtResource("3_dwi0o")
lifetime = 3.0
scale_curve = SubResource("Curve_w5jkx")
[node name="DecalDust" type="Decal" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
size = Vector3(1, 5, 1)
texture_albedo = ExtResource("4_jxr0h")
upper_fade = 21.3037
cull_mask = 1
script = ExtResource("3_dwi0o")
lifetime = 0.5
scale_curve = SubResource("Curve_r6bwy")
[node name="DecalShockwave" type="Decal" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
size = Vector3(1, 5, 1)
texture_albedo = ExtResource("5_c3jkk")
upper_fade = 21.3037
cull_mask = 1
script = ExtResource("3_dwi0o")
lifetime = 0.1
scale_curve = SubResource("Curve_18e7g")
[node name="DecalGlow" type="Decal" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
size = Vector3(1, 5, 1)
texture_albedo = ExtResource("6_2la8o")
upper_fade = 21.3037
cull_mask = 1
script = ExtResource("3_dwi0o")
lifetime = 0.1
scale_curve = SubResource("Curve_18e7g")

@ -0,0 +1,70 @@
[gd_scene load_steps=14 format=3 uid="uid://5d1a3s6x77wd"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_2t2j1"]
[ext_resource type="Texture2D" uid="uid://bjv7f83tdgq17" path="res://render/texture/decal/decal_explode.png" id="2_vkpca"]
[ext_resource type="Script" path="res://script/effect/particle_decal.gd" id="3_dwi0o"]
[ext_resource type="Shader" path="res://render/shader/particle_ground.gdshader" id="4_ppovm"]
[ext_resource type="Texture2D" uid="uid://cvm7ouwqnp235" path="res://render/texture/particle/shape/circle4.png" id="5_ckrbk"]
[sub_resource type="Curve" id="Curve_w5jkx"]
max_value = 0.6
_data = [Vector2(0, 0), 0.0, 0.84, 0, 0, Vector2(0.0196078, 0.6), 0.0, 0.0, 0, 0, Vector2(1, 0.6), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="ShaderMaterial" id="ShaderMaterial_70q7o"]
render_priority = 0
shader = ExtResource("4_ppovm")
shader_parameter/tex_main = ExtResource("5_ckrbk")
[sub_resource type="Curve" id="Curve_yx8ux"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.252308, 0.398295), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_vgydt"]
curve = SubResource("Curve_yx8ux")
[sub_resource type="Curve" id="Curve_o1uxt"]
max_value = 2.0
_data = [Vector2(0, 0.369062), 0.0, 1.4, 0, 0, Vector2(0.0923077, 1.60414), 0.0, 0.0, 0, 0, Vector2(1, 2), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_plhfa"]
curve = SubResource("Curve_o1uxt")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_ro7la"]
particle_flag_disable_z = true
angle_min = 1.07288e-05
angle_max = 720.0
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_plhfa")
alpha_curve = SubResource("CurveTexture_vgydt")
[sub_resource type="QuadMesh" id="QuadMesh_apjnk"]
[node name="Particle" type="Node3D"]
script = ExtResource("1_2t2j1")
[node name="DecalExplode" type="Decal" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
size = Vector3(1, 1, 1)
texture_albedo = ExtResource("2_vkpca")
modulate = Color(0, 0, 0, 1)
upper_fade = 21.3037
cull_mask = 1
script = ExtResource("3_dwi0o")
lifetime = 3.0
scale_curve = SubResource("Curve_w5jkx")
[node name="Shockwave" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0)
layers = 512
material_override = SubResource("ShaderMaterial_70q7o")
cast_shadow = 0
emitting = false
amount = 1
lifetime = 0.3
one_shot = true
fixed_fps = 60
local_coords = true
process_material = SubResource("ParticleProcessMaterial_ro7la")
draw_pass_1 = SubResource("QuadMesh_apjnk")

@ -0,0 +1,71 @@
[gd_scene load_steps=14 format=3 uid="uid://b1eg05rgvdjk"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_2t2j1"]
[ext_resource type="Texture2D" uid="uid://bjv7f83tdgq17" path="res://render/texture/decal/decal_explode.png" id="2_vkpca"]
[ext_resource type="Script" path="res://script/effect/particle_decal.gd" id="3_dwi0o"]
[ext_resource type="Shader" path="res://render/shader/particle_ground.gdshader" id="4_riq1c"]
[ext_resource type="Texture2D" uid="uid://cvm7ouwqnp235" path="res://render/texture/particle/shape/circle4.png" id="5_feq6c"]
[sub_resource type="Curve" id="Curve_yn1ni"]
max_value = 0.6
_data = [Vector2(0, 0), 0.0, 0.84, 0, 0, Vector2(0.0196078, 0.6), 0.0, 0.0, 0, 0, Vector2(1, 0.6), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0b0aa"]
render_priority = 0
shader = ExtResource("4_riq1c")
shader_parameter/tex_main = ExtResource("5_feq6c")
[sub_resource type="Curve" id="Curve_ll1if"]
_data = [Vector2(0, 0.52497), 0.0, -0.52497, 0, 1, Vector2(1, 0), -0.52497, 0.0, 1, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_m6i4p"]
curve = SubResource("Curve_ll1if")
[sub_resource type="Curve" id="Curve_63se2"]
max_value = 1.5
_data = [Vector2(0, 0.870585), 0.0, 0.629415, 0, 1, Vector2(1, 1.5), 0.629415, 0.0, 1, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_dlf32"]
curve = SubResource("Curve_63se2")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_t7n3k"]
particle_flag_disable_z = true
angle_min = 1.07288e-05
angle_max = 720.0
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_dlf32")
alpha_curve = SubResource("CurveTexture_m6i4p")
[sub_resource type="QuadMesh" id="QuadMesh_36ni8"]
[node name="Particle" type="Node3D"]
script = ExtResource("1_2t2j1")
[node name="DecalExplode" type="Decal" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
visible = false
size = Vector3(1, 1, 1)
texture_albedo = ExtResource("2_vkpca")
modulate = Color(0, 0, 0, 1)
upper_fade = 21.3037
cull_mask = 1
script = ExtResource("3_dwi0o")
lifetime = 5.0
scale_curve = SubResource("Curve_yn1ni")
[node name="Shockwave" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0)
layers = 512
material_override = SubResource("ShaderMaterial_0b0aa")
cast_shadow = 0
emitting = false
amount = 1
lifetime = 0.3
one_shot = true
fixed_fps = 60
local_coords = true
process_material = SubResource("ParticleProcessMaterial_t7n3k")
draw_pass_1 = SubResource("QuadMesh_36ni8")

@ -24,7 +24,7 @@ shader_parameter/tex_gradient = ExtResource("3_16hna")
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.370536, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_l34bo"]
[sub_resource type="CurveTexture" id="CurveTexture_fa6y5"]
curve = SubResource("Curve_7oqkb")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_m0ar0"]
@ -34,7 +34,7 @@ angle_max = 180.0
angular_velocity_min = -720.0
angular_velocity_max = -720.0
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_l34bo")
alpha_curve = SubResource("CurveTexture_fa6y5")
[sub_resource type="Curve" id="Curve_a8a1y"]
_data = [Vector2(0, 0.538462), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]

@ -1,5 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://ds7mp5l20ypb6"]
[ext_resource type="PackedScene" uid="uid://5d1a3s6x77wd" path="res://scene/effect/particle/_particle_hit_ground.tscn" id="1_tw6qm"]
[ext_resource type="PackedScene" uid="uid://5d1a3s6x77wd" path="res://scene/effect/particle/_particle_hit_ground_heavy.tscn" id="1_tw6qm"]
[node name="Particle" instance=ExtResource("1_tw6qm")]
is_ground = true

@ -56,7 +56,7 @@ shader_parameter/tex_main = ExtResource("4_xpm5f")
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_44xyr"]
[sub_resource type="CurveTexture" id="CurveTexture_xa3ue"]
curve = SubResource("Curve_wtvsj")
[sub_resource type="Curve" id="Curve_g8aux"]
@ -64,7 +64,7 @@ max_value = 5.0
_data = [Vector2(0, 2.42692), 0.0, 1.4, 0, 0, Vector2(1, 5), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_ikpkp"]
[sub_resource type="CurveTexture" id="CurveTexture_b5gk3"]
curve = SubResource("Curve_g8aux")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_7his1"]
@ -72,8 +72,8 @@ particle_flag_disable_z = true
angle_min = 1.07288e-05
angle_max = 720.0
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_ikpkp")
alpha_curve = SubResource("CurveTexture_44xyr")
scale_curve = SubResource("CurveTexture_b5gk3")
alpha_curve = SubResource("CurveTexture_xa3ue")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_vkw8i"]
render_priority = 0

@ -1,19 +1,18 @@
[gd_scene load_steps=40 format=3 uid="uid://dpewyvwr7358m"]
[gd_scene load_steps=40 format=3 uid="uid://c4dkjflnmub2i"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_c4i0s"]
[ext_resource type="Shader" path="res://render/shader/particle.gdshader" id="2_028e2"]
[ext_resource type="Texture2D" uid="uid://ccl81e2qroccb" path="res://render/texture/particle/shape/flare2.png" id="3_h47rb"]
[ext_resource type="Texture2D" uid="uid://bslhqlcg8cw2l" path="res://render/texture/particle/shape/flare3.png" id="4_x4pau"]
[ext_resource type="Texture2D" uid="uid://colhtjt8jon3v" path="res://render/texture/particle/shape/smoke.png" id="5_ji4m5"]
[ext_resource type="Shader" path="res://render/shader/trail.gdshader" id="6_jp3yv"]
[ext_resource type="Texture2D" uid="uid://b0bmvub81xvmf" path="res://render/texture/particle/shape/glow.png" id="7_u8iqs"]
[ext_resource type="PackedScene" uid="uid://5d1a3s6x77wd" path="res://scene/effect/particle/_particle_hit_ground.tscn" id="8_x8r0p"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_0hdix"]
[ext_resource type="Shader" path="res://render/shader/particle.gdshader" id="2_2wrtm"]
[ext_resource type="Texture2D" uid="uid://ccl81e2qroccb" path="res://render/texture/particle/shape/flare2.png" id="3_wumfi"]
[ext_resource type="Texture2D" uid="uid://bslhqlcg8cw2l" path="res://render/texture/particle/shape/flare3.png" id="4_rdon4"]
[ext_resource type="Texture2D" uid="uid://colhtjt8jon3v" path="res://render/texture/particle/shape/smoke.png" id="5_sadxh"]
[ext_resource type="Shader" path="res://render/shader/trail.gdshader" id="6_hwy8t"]
[ext_resource type="Texture2D" uid="uid://b0bmvub81xvmf" path="res://render/texture/particle/shape/glow.png" id="7_1ufmd"]
[ext_resource type="PackedScene" uid="uid://5d1a3s6x77wd" path="res://scene/effect/particle/_particle_hit_ground_heavy.tscn" id="8_t740e"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dkmkb"]
render_priority = 0
shader = ExtResource("2_028e2")
shader_parameter/is_billboard = null
shader_parameter/tex_main = ExtResource("3_h47rb")
shader = ExtResource("2_2wrtm")
shader_parameter/tex_main = ExtResource("3_wumfi")
[sub_resource type="Curve" id="Curve_n5hkj"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
@ -50,9 +49,8 @@ alpha_curve = SubResource("CurveTexture_hdmmt")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_i0f24"]
render_priority = 0
shader = ExtResource("2_028e2")
shader_parameter/is_billboard = null
shader_parameter/tex_main = ExtResource("4_x4pau")
shader = ExtResource("2_2wrtm")
shader_parameter/tex_main = ExtResource("4_rdon4")
[sub_resource type="Curve" id="Curve_3uvr5"]
_data = [Vector2(0, 0.461538), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
@ -87,15 +85,14 @@ alpha_curve = SubResource("CurveTexture_1og0n")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_vkw8i"]
render_priority = 0
shader = ExtResource("2_028e2")
shader_parameter/is_billboard = false
shader_parameter/tex_main = ExtResource("5_ji4m5")
shader = ExtResource("2_2wrtm")
shader_parameter/tex_main = ExtResource("5_sadxh")
[sub_resource type="Curve" id="Curve_didyq"]
_data = [Vector2(0, 0.32967), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_3pi6l"]
[sub_resource type="CurveTexture" id="CurveTexture_dtiw7"]
curve = SubResource("Curve_didyq")
[sub_resource type="Curve" id="Curve_6dnuy"]
@ -103,7 +100,7 @@ max_value = 4.0
_data = [Vector2(0, 1.75824), 0.0, 0.0, 0, 0, Vector2(1, 2.76923), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_skg43"]
[sub_resource type="CurveTexture" id="CurveTexture_bjor0"]
curve = SubResource("Curve_6dnuy")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_gjwvd"]
@ -114,9 +111,9 @@ velocity_pivot = Vector3(0, 0, 1)
spread = 180.0
initial_velocity_max = 0.2
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_skg43")
scale_curve = SubResource("CurveTexture_bjor0")
color = Color(0.521569, 0.509804, 0.501961, 1)
alpha_curve = SubResource("CurveTexture_3pi6l")
alpha_curve = SubResource("CurveTexture_dtiw7")
[sub_resource type="QuadMesh" id="QuadMesh_0kefl"]
@ -124,34 +121,34 @@ alpha_curve = SubResource("CurveTexture_3pi6l")
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_wpjie"]
[sub_resource type="CurveTexture" id="CurveTexture_bb4kj"]
curve = SubResource("Curve_axcwu")
[sub_resource type="Gradient" id="Gradient_q1rex"]
offsets = PackedFloat32Array(0, 0.285714, 1)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 0.52549, 1, 0, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_x4ksg"]
[sub_resource type="GradientTexture1D" id="GradientTexture1D_f6oto"]
gradient = SubResource("Gradient_q1rex")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_5lomq"]
spread = 180.0
initial_velocity_min = 4.0
initial_velocity_max = 5.0
color_ramp = SubResource("GradientTexture1D_x4ksg")
alpha_curve = SubResource("CurveTexture_wpjie")
color_ramp = SubResource("GradientTexture1D_f6oto")
alpha_curve = SubResource("CurveTexture_bb4kj")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hrjt4"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_rvlet"]
render_priority = 0
shader = ExtResource("6_jp3yv")
shader_parameter/tex_main = ExtResource("7_u8iqs")
shader = ExtResource("6_hwy8t")
shader_parameter/tex_main = ExtResource("7_1ufmd")
[sub_resource type="RibbonTrailMesh" id="RibbonTrailMesh_urftu"]
material = SubResource("ShaderMaterial_hrjt4")
material = SubResource("ShaderMaterial_rvlet")
size = 0.1
[node name="Particle" type="Node3D"]
script = ExtResource("1_c4i0s")
script = ExtResource("1_0hdix")
[node name="Slash" type="GPUParticles3D" parent="."]
layers = 512
@ -202,4 +199,5 @@ trail_lifetime = 0.1
process_material = SubResource("ParticleProcessMaterial_5lomq")
draw_pass_1 = SubResource("RibbonTrailMesh_urftu")
[node name="Particle" parent="." instance=ExtResource("8_x8r0p")]
[node name="Particle" parent="." instance=ExtResource("8_t740e")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)

@ -0,0 +1,10 @@
[gd_scene load_steps=3 format=3 uid="uid://dpewyvwr7358m"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_c4i0s"]
[ext_resource type="PackedScene" uid="uid://b1eg05rgvdjk" path="res://scene/effect/particle/_particle_hit_ground_normal.tscn" id="8_x8r0p"]
[node name="Particle" type="Node3D"]
script = ExtResource("1_c4i0s")
[node name="Particle" parent="." instance=ExtResource("8_x8r0p")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)

@ -2,7 +2,7 @@
extends Node3D
enum EActionType {Pressed, Released}
enum EDamageType {Sharp, Blunt, Ground}
enum EDamageType {Sharp, Blunt}
enum ECharacterType {Player, Monster, Bullet, Soul}
enum ETeam {Player, Monster}
enum EStance {

@ -6,6 +6,7 @@ var character_mgr: CharacterManager
var item_mgr: ItemManager
var level_mgr: LevelManager
var ui_mgr: UIManager
var effect_mgr: EffectManager
#全局状态
var is_level_loading: bool
var is_control_pause: bool

@ -19,7 +19,7 @@ func attack1() -> void:
return
var attack: AttackCfg = status.skill_cfg.get_attack1()
var attack_box: AttackBoxCfg = status.skill_cfg.get_attack1_box()
_attack(attack, attack_box)
add_attack(attack, attack_box)
func attack2() -> void:
@ -27,27 +27,28 @@ func attack2() -> void:
return
var attack: AttackCfg = status.skill_cfg.get_attack2()
var attack_box: AttackBoxCfg = status.skill_cfg.get_attack2_box()
_attack(attack, attack_box)
add_attack(attack, attack_box)
func character_attack1() -> bool:
var attack: AttackCfg = status.cfg.get_attack1()
var attack_box: AttackBoxCfg = status.cfg.get_attack1_box()
return _attack(attack, attack_box)
return add_attack(attack, attack_box)
func character_attack2() -> bool:
var attack: AttackCfg = status.cfg.get_attack2()
var attack_box: AttackBoxCfg = status.cfg.get_attack2_box()
return _attack(attack, attack_box)
return add_attack(attack, attack_box)
func _attack(attack: AttackCfg, attack_box: AttackBoxCfg) -> bool:
func add_attack(attack: AttackCfg, attack_box: AttackBoxCfg, hit_self: bool = false, attack_dir: Vector2 = Vector2.ZERO) -> bool:
if not attack or not attack_box:
return false
var pos: Vector3 = character.pos()
var attack_dir: Vector2 = status.skill_dir.normalized()
var pos: Vector3 = character.pos()
if not attack_dir:
attack_dir = status.skill_dir.normalized()
var result: Array[Character]
if attack_box.is_throw:
var target: Character = Global.character_mgr.get_character(status.throw_target)
@ -65,9 +66,9 @@ func _attack(attack: AttackCfg, attack_box: AttackBoxCfg) -> bool:
if target == null:
is_hit = true
continue
if target.team() == character.team():
if hit_self != (target.team() == character.team()):
continue
var hit_result: HitResult = add_attack(character.id(), target.id(), attack_dir, attack)
var hit_result: HitResult = settle(character.id(), target.id(), attack_dir, attack)
on_attack_hit(hit_result)
is_hit = true
if !is_hit and !attack.is_force_pause:
@ -87,7 +88,7 @@ func _debug_draw_attack_box(shape: Shape3D, offset: Vector3) -> void:
return
func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResult:
func settle(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResult:
var hit_result: HitResult = HitResult.new()
var character_from: Character = Global.character_mgr.get_character(from) as Character
@ -104,7 +105,6 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul
var has_shield = shield > 0
var is_floating: bool = attack.is_floating or not character_to.get_status("is_on_floor")
var is_hit_down: bool = attack.is_hit_down and not character_to.get_status("is_on_floor")
var is_rebound: bool = attack.is_rebound
var is_break_shield: bool = false
@ -132,7 +132,6 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul
damage *= 0.5
is_floating = is_break_skill and is_floating
is_hit_down = is_break_skill and is_hit_down
#造成伤害
if has_shield:
@ -213,7 +212,7 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul
#受击动画
var trigger_hit: String = ""
if is_rebound: trigger_hit="rebound"
elif is_floating: trigger_hit = "air_hit_down" if is_hit_down else "air_hit_up"
elif is_floating: trigger_hit = "air_hit_down" if attack.hit_up_speed<0 else "air_hit_up"
elif is_stun: trigger_hit="stun_hit"
elif break_level_sub == 3: trigger_hit="lhit"
elif break_level_sub == 2: trigger_hit="mhit"
@ -235,9 +234,7 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul
var character_dir: Vector2 = character_from.pos2D() - character_to.pos2D()
var dist = clamp(character_dir.length(), 0, 1)
hit_back_speed = max(hit_back_limit_curve.sample(dist), hit_back_speed)
if is_hit_down:
character_to.add_buff("hit_down", -1)
elif not is_break_skill_real:
if not is_break_skill_real:
hit_up_speed *= 0.75
character_to.set_hit_move(dir, hit_back_speed, hit_up_speed)

@ -112,7 +112,7 @@ func on_start_die(rate)->void:
func on_end_die(rate)->void: add_buff("die2", -1)
func on_update_die2(rate)->void: if status.is_on_floor: remove_buff("die2")
func on_update_die2(rate)->void: if status.is_on_floor and not status.is_rising: remove_buff("die2")
func on_end_die2(rate)->void:

@ -138,7 +138,8 @@ func _cast_particle(resource: Resource, is_attach: bool, offset: Vector3, scale:
if offset:
new_particle.position = offset
else:
new_particle.position = status.basic_offset
if not new_particle.is_ground:
new_particle.position = status.basic_offset
add_child(new_particle)
if !is_attach:
temp_release_particle_list.append(new_particle)
@ -156,4 +157,3 @@ func _release_effect(particle: Particle):
particle.position = pos
remove_child(particle)
SignalManager.effect_create.emit(particle)

@ -9,6 +9,7 @@ var after_image_speed_max: float = 10
@onready var status: Status = (%Status as Status)
@onready var buff: Buff = (%Buff as Buff)
@onready var effect: Effect = (%Effect as Effect)
@onready var battle: Battle = (%Battle as Battle)
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
var velocity_cache: Vector3
@ -113,10 +114,14 @@ func update_move_check(delta):
var normal_speed: float = velocity.dot(normal)
if normal_speed < -6:
#墙体互动
character.velocity = velocity - normal * normal_speed * 2
character.add_buff("floating", -1)
elif normal_speed <-2:
Global.effect_mgr.cast_particle(ResourceManager.particle_hit_ground_heavy, character.pos(), normal)
var velocity_new = velocity - normal * normal_speed * 2
var attack_dir = Vector2(velocity_new.x, velocity_new.z).normalized()
character.velocity = Vector3.ZERO
battle.add_attack(ResourceManager.cfg_attack_rebound, ResourceManager.cfg_attack_box_rebound, true, attack_dir)
elif normal_speed <-3:
#反弹
Global.effect_mgr.cast_particle(ResourceManager.particle_hit_ground_normal, character.pos(), normal)
character.velocity = velocity - normal * normal_speed * 1.5
character.add_buff("floating", -1)

@ -67,6 +67,7 @@ func check_action_pressed(key: String) -> bool:
"weapon_next": combo.weapon_index_change(1)
"test_1":
Global.character_mgr.create_character(ResourceManager.cfg_character_monster_test0, Enum.ETeam.Monster, character.pos())
# Global.effect_mgr.cast_particle(ResourceManager.particle_hit_ground_normal, character.pos(), Vector3.UP)
_: return false
return true

@ -8,7 +8,6 @@ class_name AttackCfg
@export_group("类型标记")
@export var damage_type: Enum.EDamageType = Enum.EDamageType.Sharp # 伤害类型
@export var is_floating: bool #是否浮空技
@export var is_hit_down: bool #是否击落技
@export var is_rebound: bool #是否地面反弹技能
@export var is_stop_self: bool = true #是否命中时停止自身位移
@export var is_throw_check: bool #是否投技检测

@ -12,6 +12,9 @@ var material: ShaderMaterial
func on_ready():
if not target or not target.sprite_frames:
queue_free()
return
image.sprite_frames = target.sprite_frames
image.animation = target.animation
image.frame = target.frame

@ -2,6 +2,7 @@ extends EffectBase
class_name Particle
@export var is_billboard: bool
@export var is_ground: bool
var sub_particle_list: Array[Particle] = []
var particle_list: Array[GPUParticles3D] = []

@ -1,7 +1,8 @@
extends Node3D
class_name EffectManager
func _ready():
#Global.character_mgr = self
Global.effect_mgr = self
SignalManager.effect_create.connect(on_effect_create)
@ -9,8 +10,11 @@ func on_effect_create(effect: Node3D):
add_child(effect)
func cast_particle(resource: Resource, pos: Vector3, rotation = Vector3.ZERO):
func cast_particle(resource: Resource, pos: Vector3, direction = Vector3.UP) -> void:
var new_particle: Particle = resource.instantiate() as Particle
new_particle.position = pos
new_particle.rotation = rotation
add_child(new_particle)
new_particle.position = pos
if direction.angle_to(Vector3.UP) > 0.01:
new_particle.look_at(pos + direction)
else:
new_particle.rotation.x = deg_to_rad(-90)

@ -23,7 +23,9 @@ var particle_hit_sharp_normal: PackedScene = load("res://scene/effect/particle/p
var particle_hit_sharp_mid: PackedScene = load("res://scene/effect/particle/particle_hit_sharp_mid.tscn")
var particle_hit_sharp_heavy: PackedScene = load("res://scene/effect/particle/particle_hit_sharp_heavy.tscn")
var particle_hit_sharp_block: PackedScene = load("res://scene/effect/particle/particle_hit_sharp_block.tscn")
var particle_hit_ground: PackedScene = load("res://scene/effect/particle/particle_hit_ground.tscn")
#hit_ground
var particle_hit_ground_normal: PackedScene = load("res://scene/effect/particle/particle_hit_ground_normal.tscn")
var particle_hit_ground_heavy: PackedScene = load("res://scene/effect/particle/particle_hit_ground_heavy.tscn")
#hit_material
var particle_material_cloth: PackedScene = load("res://scene/effect/particle/particle_material_cloth.tscn")
#collect
@ -43,6 +45,7 @@ var cfg_character_monster_test1: CharacterCfg = load("res://config/character/mon
var cfg_character_monster_test2: CharacterCfg = load("res://config/character/monster02.tres") as CharacterCfg
var cfg_character_monster_test3: CharacterCfg = load("res://config/character/monster03.tres") as CharacterCfg
#attack
var cfg_attack_normal: AttackCfg = load("res://config/attack/sharp_normal_hit.tres") as AttackCfg
var cfg_attack_box_normal: AttackCfg = load("res://config/attack_box/circle_normal.tres") as AttackCfg
var cfg_attack_rebound: AttackCfg = load("res://config/attack/rebound.tres") as AttackCfg
var cfg_attack_normal: AttackCfg = load("res://config/attack/sharp_normal_hit.tres") as AttackCfg
var cfg_attack_box_normal: AttackBoxCfg = load("res://config/attack_box/circle_normal.tres") as AttackBoxCfg
var cfg_attack_rebound: AttackCfg = load("res://config/attack/rebound.tres") as AttackCfg
var cfg_attack_box_rebound: AttackBoxCfg = load("res://config/attack_box/circle_normal.tres") as AttackBoxCfg

@ -73,7 +73,7 @@ func on_character_hit_text(id: int, value: String) -> void:
return
var headbar_meta = headbar_map[id]
var headbar: Headbar = headbar_meta.headbar as Headbar
# headbar.on_hit_text(value)
headbar.on_hit_text(value)
func on_character_hit_damage(id: int, value: float) -> void:
@ -81,7 +81,7 @@ func on_character_hit_damage(id: int, value: float) -> void:
return
var headbar_meta = headbar_map[id]
var headbar: Headbar = headbar_meta.headbar as Headbar
# headbar.on_hit_damage(value)
headbar.on_hit_damage(value)
func on_character_die(id: int) -> void:

Loading…
Cancel
Save