diff --git a/config/attack_box/box_large.tres b/config/attack_box/box_large.tres index 1063732..14cb85e 100644 --- a/config/attack_box/box_large.tres +++ b/config/attack_box/box_large.tres @@ -3,8 +3,9 @@ [ext_resource type="Script" path="res://script/config/attack_box_cfg.gd" id="1_661yg"] [sub_resource type="BoxShape3D" id="BoxShape3D_87jhu"] +size = Vector3(2, 2, 2) [resource] script = ExtResource("1_661yg") shape = SubResource("BoxShape3D_87jhu") -offset = Vector2(0.5, 0.5) +offset = Vector2(1, 1) diff --git a/config/attack_box/box_normal.tres b/config/attack_box/box_normal.tres index 1359b03..1afba74 100644 --- a/config/attack_box/box_normal.tres +++ b/config/attack_box/box_normal.tres @@ -3,8 +3,9 @@ [ext_resource type="Script" path="res://script/config/attack_box_cfg.gd" id="1_d4mqn"] [sub_resource type="BoxShape3D" id="BoxShape3D_87jhu"] +size = Vector3(1.6, 1.2, 1.2) [resource] script = ExtResource("1_d4mqn") shape = SubResource("BoxShape3D_87jhu") -offset = Vector2(0.5, 0.5) +offset = Vector2(0.8, 0.6) diff --git a/config/skill_player_weapon/hero01_long_air_attack01.tres b/config/skill_player_weapon/hero01_long_air_attack01.tres index bf294d4..16f5a54 100644 --- a/config/skill_player_weapon/hero01_long_air_attack01.tres +++ b/config/skill_player_weapon/hero01_long_air_attack01.tres @@ -1,7 +1,8 @@ -[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://rib7hj11oscr"] +[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=7 format=3 uid="uid://rib7hj11oscr"] -[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/sharp_normal_hit.tres" id="1_mxlqc"] +[ext_resource type="Resource" uid="uid://d3mcp8sf6qbmd" path="res://config/attack/sharp_normal_hit.tres" id="1_mxlqc"] [ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="2_hh5ph"] +[ext_resource type="Resource" uid="uid://bqejjllfy03h3" path="res://config/attack_box/box_normal.tres" id="2_nk4i8"] [ext_resource type="Animation" uid="uid://p8l0puqxrkwh" path="res://resource/skill_animation/hero01_long_air_attack01.tres" id="3_3pp8a"] [ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="4_q0bln"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="5_s1k6m"] @@ -17,6 +18,7 @@ name = "" skill_animation = ExtResource("3_3pp8a") free_lock = false attack1 = ExtResource("1_mxlqc") +attack1_box = ExtResource("2_nk4i8") refresh_animation = false sprite_frames = ExtResource("4_q0bln") animation_name = "long_air_attack01" diff --git a/config/skill_player_weapon/hero01_long_air_attack02.tres b/config/skill_player_weapon/hero01_long_air_attack02.tres index a220647..93731e0 100644 --- a/config/skill_player_weapon/hero01_long_air_attack02.tres +++ b/config/skill_player_weapon/hero01_long_air_attack02.tres @@ -1,7 +1,8 @@ -[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://c675lckg7ly25"] +[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=7 format=3 uid="uid://c675lckg7ly25"] -[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/sharp_normal_hit.tres" id="1_qfkyy"] +[ext_resource type="Resource" uid="uid://d3mcp8sf6qbmd" path="res://config/attack/sharp_normal_hit.tres" id="1_qfkyy"] [ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="2_gjjhv"] +[ext_resource type="Resource" uid="uid://bqejjllfy03h3" path="res://config/attack_box/box_normal.tres" id="2_xxivk"] [ext_resource type="Animation" uid="uid://cjfy6ia1ukyiu" path="res://resource/skill_animation/hero01_long_air_attack02.tres" id="3_76yga"] [ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="4_ahm2t"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="5_nkec4"] @@ -17,6 +18,7 @@ name = "" skill_animation = ExtResource("3_76yga") free_lock = false attack1 = ExtResource("1_qfkyy") +attack1_box = ExtResource("2_xxivk") refresh_animation = false sprite_frames = ExtResource("4_ahm2t") animation_name = "long_air_attack02" diff --git a/config/skill_player_weapon/hero01_long_air_attack03.tres b/config/skill_player_weapon/hero01_long_air_attack03.tres index 07fc6d2..806f001 100644 --- a/config/skill_player_weapon/hero01_long_air_attack03.tres +++ b/config/skill_player_weapon/hero01_long_air_attack03.tres @@ -1,7 +1,8 @@ -[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://b705py5rht5i3"] +[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=7 format=3 uid="uid://b705py5rht5i3"] [ext_resource type="Resource" uid="uid://dj7tchh0202t2" path="res://config/attack/sharp_mid_hit_down.tres" id="1_rccpt"] [ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="2_0x7hh"] +[ext_resource type="Resource" uid="uid://diedb7vw7eyxp" path="res://config/attack_box/box_mid.tres" id="2_2wu8a"] [ext_resource type="Animation" uid="uid://bh5s2t3cbobpp" path="res://resource/skill_animation/hero01_long_air_attack03.tres" id="3_1erk8"] [ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="4_wrd60"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="5_u3vas"] @@ -17,6 +18,7 @@ name = "" skill_animation = ExtResource("3_1erk8") free_lock = false attack1 = ExtResource("1_rccpt") +attack1_box = ExtResource("2_2wu8a") refresh_animation = false sprite_frames = ExtResource("4_wrd60") animation_name = "long_air_attack03" diff --git a/config/skill_player_weapon/hero01_long_attack02.tres b/config/skill_player_weapon/hero01_long_attack02.tres index c1e357e..320c0fe 100644 --- a/config/skill_player_weapon/hero01_long_attack02.tres +++ b/config/skill_player_weapon/hero01_long_attack02.tres @@ -1,8 +1,9 @@ -[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://kpr8aqmnyv2k"] +[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=7 format=3 uid="uid://kpr8aqmnyv2k"] -[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/sharp_normal_hit.tres" id="1_8fm1u"] +[ext_resource type="Resource" uid="uid://d3mcp8sf6qbmd" path="res://config/attack/sharp_normal_hit.tres" id="1_8fm1u"] [ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_e0fqi"] [ext_resource type="Animation" uid="uid://bf6jaraltouun" path="res://resource/skill_animation/hero01_long_attack02.tres" id="2_jrgan"] +[ext_resource type="Resource" uid="uid://bqejjllfy03h3" path="res://config/attack_box/box_normal.tres" id="2_s06n4"] [ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_jidy7"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="4_novna"] @@ -17,6 +18,7 @@ name = "" skill_animation = ExtResource("2_jrgan") free_lock = false attack1 = ExtResource("1_8fm1u") +attack1_box = ExtResource("2_s06n4") refresh_animation = false sprite_frames = ExtResource("3_jidy7") animation_name = "long_attack02" diff --git a/config/skill_player_weapon/hero01_long_attack03.tres b/config/skill_player_weapon/hero01_long_attack03.tres index a5363fc..c50e88a 100644 --- a/config/skill_player_weapon/hero01_long_attack03.tres +++ b/config/skill_player_weapon/hero01_long_attack03.tres @@ -1,8 +1,9 @@ -[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://qele60lk54e1"] +[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=7 format=3 uid="uid://5ufjc1dso0y8"] -[ext_resource type="Resource" uid="uid://ckeuv5lhfk2s0" path="res://config/attack/sharp_normal_hit_back.tres" id="1_7ai5j"] +[ext_resource type="Resource" uid="uid://btg40rn2f36c2" path="res://config/attack/sharp_normal_hit_back.tres" id="1_7ai5j"] [ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_uaib7"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="2_8uqiw"] +[ext_resource type="Resource" uid="uid://diedb7vw7eyxp" path="res://config/attack_box/box_mid.tres" id="2_j0l20"] [ext_resource type="Animation" uid="uid://c8yueqe7rjn60" path="res://resource/skill_animation/hero01_long_attack03.tres" id="2_ugt3f"] [ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_sr2og"] @@ -17,7 +18,9 @@ name = "" skill_animation = ExtResource("2_ugt3f") free_lock = false attack1 = ExtResource("1_7ai5j") +attack1_box = ExtResource("2_j0l20") attack2 = ExtResource("1_7ai5j") +attack2_box = ExtResource("2_j0l20") refresh_animation = false sprite_frames = ExtResource("3_sr2og") animation_name = "long_attack03" diff --git a/config/skill_player_weapon/hero01_long_attack04.tres b/config/skill_player_weapon/hero01_long_attack04.tres index 06645b2..e9dcb23 100644 --- a/config/skill_player_weapon/hero01_long_attack04.tres +++ b/config/skill_player_weapon/hero01_long_attack04.tres @@ -1,10 +1,12 @@ -[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=7 format=3 uid="uid://dvdr5vd1vbe12"] +[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=9 format=3 uid="uid://dvdr5vd1vbe12"] [ext_resource type="Resource" uid="uid://bv4uoey1liqoq" path="res://config/attack/sharp_heavy_hit_blow.tres" id="1_8ipjq"] [ext_resource type="Resource" uid="uid://c87w2x5qfqdns" path="res://config/attack/blunt_normal_hit_back.tres" id="1_44ai1"] [ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_xsxbs"] +[ext_resource type="Resource" uid="uid://bqejjllfy03h3" path="res://config/attack_box/box_normal.tres" id="2_5jvmg"] [ext_resource type="Animation" uid="uid://dk1o3gqhjmuvh" path="res://resource/skill_animation/hero01_long_attack04.tres" id="2_sam6s"] [ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_w7h1m"] +[ext_resource type="Resource" uid="uid://bnfnjdw0tms3h" path="res://config/attack_box/box_large.tres" id="4_7j0pm"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="4_plyre"] [resource] @@ -18,7 +20,9 @@ name = "" skill_animation = ExtResource("2_sam6s") free_lock = false attack1 = ExtResource("1_44ai1") +attack1_box = ExtResource("2_5jvmg") attack2 = ExtResource("1_8ipjq") +attack2_box = ExtResource("4_7j0pm") refresh_animation = false sprite_frames = ExtResource("3_w7h1m") animation_name = "long_attack04" diff --git a/config/skill_player_weapon/hero01_long_skill01.tres b/config/skill_player_weapon/hero01_long_skill01.tres index de33bf9..73182c0 100644 --- a/config/skill_player_weapon/hero01_long_skill01.tres +++ b/config/skill_player_weapon/hero01_long_skill01.tres @@ -1,8 +1,9 @@ -[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://cwqbhrv8bd5vn"] +[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=7 format=3 uid="uid://cwqbhrv8bd5vn"] -[ext_resource type="Resource" uid="uid://cae3dxpuqfcux" path="res://config/attack/sharp_mid_hit.tres" id="1_7yroh"] +[ext_resource type="Resource" uid="uid://qmivx7ntfrki" path="res://config/attack/sharp_mid_hit.tres" id="1_7yroh"] [ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_ud5ph"] [ext_resource type="Animation" uid="uid://bjnkrte7660pt" path="res://resource/skill_animation/hero01_long_skill01.tres" id="2_ewts2"] +[ext_resource type="Resource" uid="uid://bqejjllfy03h3" path="res://config/attack_box/box_normal.tres" id="2_xyemx"] [ext_resource type="SpriteFrames" uid="uid://dhfqj1dxldqao" path="res://resource/animation/character/hero01_long_skill01.aseprite" id="3_qwjfl"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="4_3bf64"] @@ -17,6 +18,7 @@ name = "" skill_animation = ExtResource("2_ewts2") free_lock = false attack1 = ExtResource("1_7yroh") +attack1_box = ExtResource("2_xyemx") refresh_animation = false sprite_frames = ExtResource("3_qwjfl") animation_name = "long_skill01" diff --git a/config/skill_player_weapon/hero01_long_skill02.tres b/config/skill_player_weapon/hero01_long_skill02.tres index 9eb0a0d..1ae39aa 100644 --- a/config/skill_player_weapon/hero01_long_skill02.tres +++ b/config/skill_player_weapon/hero01_long_skill02.tres @@ -1,7 +1,8 @@ -[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://vvftj1wk88xj"] +[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=7 format=3 uid="uid://vvftj1wk88xj"] [ext_resource type="Resource" uid="uid://ckbf40c75bfqf" path="res://config/attack/sharp_normal_hit_up.tres" id="1_edtv7"] [ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="2_1xtt1"] +[ext_resource type="Resource" uid="uid://diedb7vw7eyxp" path="res://config/attack_box/box_mid.tres" id="2_tsg38"] [ext_resource type="Animation" uid="uid://iprcbf277rf4" path="res://resource/skill_animation/hero01_long_skill02.tres" id="3_b7s0y"] [ext_resource type="SpriteFrames" uid="uid://dhfqj1dxldqao" path="res://resource/animation/character/hero01_long_skill01.aseprite" id="4_rbnly"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="5_u5xo6"] @@ -17,6 +18,7 @@ name = "" skill_animation = ExtResource("3_b7s0y") free_lock = false attack1 = ExtResource("1_edtv7") +attack1_box = ExtResource("2_tsg38") refresh_animation = false sprite_frames = ExtResource("4_rbnly") animation_name = "long_skill02" diff --git a/render/process_material/slash_normal.tres b/render/process_material/slash_normal.tres index 2b353c0..7289807 100644 --- a/render/process_material/slash_normal.tres +++ b/render/process_material/slash_normal.tres @@ -1,8 +1,8 @@ [gd_resource type="ParticleProcessMaterial" load_steps=5 format=3 uid="uid://dubkkji6sm8on"] [sub_resource type="Gradient" id="Gradient_fjosh"] -offsets = PackedFloat32Array(0, 0.0894942, 0.684825, 1) -colors = PackedColorArray(0.278431, 0.65098, 1, 0, 0.278431, 0.65098, 1, 1, 0.278431, 0.65098, 1, 0.941176, 0.278431, 0.65098, 1, 0) +offsets = PackedFloat32Array(0, 0.239796, 0.684825, 1) +colors = PackedColorArray(1, 1, 1, 1, 0.278431, 0.65098, 1, 1, 0.278431, 0.65098, 1, 0.941176, 0.278431, 0.65098, 1, 0) [sub_resource type="GradientTexture1D" id="GradientTexture1D_cypke"] gradient = SubResource("Gradient_fjosh") @@ -23,6 +23,5 @@ spread = 0.0 angular_velocity_min = -720.0 angular_velocity_max = -720.0 gravity = Vector3(0, 0, 0) -tangential_accel_min = -100.0 scale_curve = SubResource("CurveTexture_81bpg") color_ramp = SubResource("GradientTexture1D_cypke") diff --git a/render/shader/effect_skew1.gdshader b/render/shader/effect_skew1.gdshader index 5f38029..c164c3e 100644 --- a/render/shader/effect_skew1.gdshader +++ b/render/shader/effect_skew1.gdshader @@ -10,7 +10,6 @@ uniform sampler2D screenTexture : hint_screen_texture; void fragment() { - vec2 uv2 = UV - 1.0 * vec2(mod(TIME, 2.0) - 1.0, 0); vec4 col_mask = texture(tex_mask, UV); float noiseValueX = (texture(noise, UV + (TIME * speedView)).r * 2.0) - 1.0; // Range: -1.0 to 1.0 diff --git a/render/shader/effect_slash.gdshader b/render/shader/effect_slash.gdshader index ed31e59..b39a034 100644 --- a/render/shader/effect_slash.gdshader +++ b/render/shader/effect_slash.gdshader @@ -4,12 +4,21 @@ render_mode blend_add,unshaded,depth_test_disabled; uniform sampler2D tex_main : source_color; uniform sampler2D tex_noise : source_color; uniform sampler2D tex_mask : source_color; +uniform sampler2D tex_mask2 : source_color; +uniform sampler2D screenTexture : hint_screen_texture; 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_mask * COLOR * 1.0 + (col_noise + col_main) * COLOR; - ALBEDO = col.rgb; - ALPHA = col_mask.r * COLOR.a; + + vec4 col_mask2 = texture(tex_mask2, UV); + float noiseValueX = col_noise.r; + float noiseValueY = col_noise.r; + vec2 noiseDistort = vec2(noiseValueX, noiseValueY) * 0.1 * col_mask2.r; + vec3 distortedScreenTexture = vec3(texture(screenTexture, SCREEN_UV + noiseDistort).rgb); + + ALBEDO = (distortedScreenTexture *4.0 + col.rgb * col_mask.r) * COLOR.rgb; + ALPHA = col_mask2.r * COLOR.a; } diff --git a/render/texture/particle/mask/mask9.png b/render/texture/particle/mask/mask9.png new file mode 100644 index 0000000..7435b7d Binary files /dev/null and b/render/texture/particle/mask/mask9.png differ diff --git a/render/texture/particle/mask/mask9.png.import b/render/texture/particle/mask/mask9.png.import new file mode 100644 index 0000000..883ac2f --- /dev/null +++ b/render/texture/particle/mask/mask9.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1e2fcr0nucku" +path="res://.godot/imported/mask9.png-4358c0d9b828032acfaa12e2c6b20a17.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://render/texture/particle/mask/mask9.png" +dest_files=["res://.godot/imported/mask9.png-4358c0d9b828032acfaa12e2c6b20a17.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 diff --git a/scene/character/character.tscn b/scene/character/character.tscn index dfb1506..de5964c 100644 --- a/scene/character/character.tscn +++ b/scene/character/character.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=16 format=3 uid="uid://8rcvw1vnjcf7"] +[gd_scene load_steps=19 format=3 uid="uid://8rcvw1vnjcf7"] [ext_resource type="Script" path="res://script/character/character.gd" id="1_tonbs"] +[ext_resource type="Script" path="res://script/character/hitbox.gd" id="2_6xf87"] [ext_resource type="Script" path="res://script/character/status.gd" id="2_txdip"] [ext_resource type="Shader" path="res://render/shader/character.gdshader" id="3_ed424"] [ext_resource type="Script" path="res://script/character/move.gd" id="4_66r53"] @@ -13,7 +14,16 @@ [ext_resource type="Script" path="res://script/character/buff.gd" id="9_jlnhy"] [ext_resource type="Script" path="res://script/character/effect.gd" id="12_eyfcd"] -[sub_resource type="CylinderShape3D" id="CylinderShape3D_qajx7"] +[sub_resource type="CylinderShape3D" id="CylinderShape3D_mmrro"] +height = 1.0 + +[sub_resource type="Curve" id="Curve_v7nnw"] +_data = [Vector2(0, 0.498516), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CylinderShape3D" id="CylinderShape3D_ehwx5"] +height = 1.0 +radius = 1.0 [sub_resource type="ShaderMaterial" id="ShaderMaterial_3u7mw"] render_priority = 0 @@ -29,12 +39,22 @@ _data = [Vector2(0, 6), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] point_count = 2 [node name="Character" type="CharacterBody3D"] -collision_layer = 16 +collision_layer = 2 script = ExtResource("1_tonbs") [node name="Collision" type="CollisionShape3D" parent="."] unique_name_in_owner = true -shape = SubResource("CylinderShape3D_qajx7") +shape = SubResource("CylinderShape3D_mmrro") + +[node name="Pushbox" type="Area3D" parent="."] +unique_name_in_owner = true +collision_layer = 16 +collision_mask = 16 +script = ExtResource("2_6xf87") +pushbox_curve = SubResource("Curve_v7nnw") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Pushbox"] +shape = SubResource("CylinderShape3D_ehwx5") [node name="Status" type="Node3D" parent="."] unique_name_in_owner = true @@ -81,5 +101,7 @@ hit_back_limit_curve = SubResource("Curve_e7j3f") unique_name_in_owner = true script = ExtResource("12_eyfcd") +[connection signal="area_entered" from="Pushbox" to="Pushbox" method="on_area_entered"] +[connection signal="area_exited" from="Pushbox" to="Pushbox" method="on_area_exited"] [connection signal="animation_finished" from="View" to="View" method="_on_animation_finished"] [connection signal="animation_finished" from="Skill" to="Skill" method="_on_animation_finished"] diff --git a/scene/character/player.tscn b/scene/character/player.tscn index b379fa2..b967755 100644 --- a/scene/character/player.tscn +++ b/scene/character/player.tscn @@ -10,7 +10,7 @@ [node name="Character" instance=ExtResource("1_pot50")] -[node name="View" parent="." index="2"] +[node name="View" parent="." index="3"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.693056, 0) sprite_frames = ExtResource("2_7gyv2") animation = &"long_attack01" diff --git a/scene/effect/particle/_particle_fist1.tscn b/scene/effect/particle/_particle_fist1.tscn new file mode 100644 index 0000000..ae433f9 --- /dev/null +++ b/scene/effect/particle/_particle_fist1.tscn @@ -0,0 +1,59 @@ +[gd_scene load_steps=12 format=3 uid="uid://cohy1qv35n57q"] + +[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_2o8k8"] +[ext_resource type="Shader" path="res://render/shader/effect_slash.gdshader" id="2_f3m3g"] +[ext_resource type="Texture2D" uid="uid://c4byf37he3mjt" path="res://render/texture/particle/noise/noise1.png" id="3_paeu0"] +[ext_resource type="Texture2D" uid="uid://csjm7d1tg6b50" path="res://render/texture/particle/mask/mask6.png" id="4_0yec6"] +[ext_resource type="Texture2D" uid="uid://c1e2fcr0nucku" path="res://render/texture/particle/mask/mask9.png" id="4_btc32"] +[ext_resource type="Texture2D" uid="uid://dd3e7ol8qa5eq" path="res://render/texture/particle/noise/noise2.png" id="5_yf7h5"] +[ext_resource type="Material" uid="uid://dubkkji6sm8on" path="res://render/process_material/slash_normal.tres" id="6_ceio5"] +[ext_resource type="ArrayMesh" uid="uid://dq207a0waxk0j" path="res://render/mesh/slash1.obj" id="7_tkeme"] +[ext_resource type="Shader" path="res://render/shader/effect_skew1.gdshader" id="8_7m8x8"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_hupcc"] +render_priority = 0 +shader = ExtResource("2_f3m3g") +shader_parameter/tex_main = ExtResource("3_paeu0") +shader_parameter/tex_noise = ExtResource("5_yf7h5") +shader_parameter/tex_mask = ExtResource("4_btc32") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_ntvqm"] +render_priority = 0 +shader = ExtResource("8_7m8x8") +shader_parameter/distortionView = 0.03 +shader_parameter/speedView = 0.5 +shader_parameter/noise = ExtResource("3_paeu0") +shader_parameter/tex_mask = ExtResource("4_0yec6") + +[node name="Particle" type="Node3D"] +script = ExtResource("1_2o8k8") + +[node name="Slash" type="GPUParticles3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) +layers = 512 +material_override = SubResource("ShaderMaterial_hupcc") +cast_shadow = 0 +gi_mode = 0 +amount = 1 +lifetime = 0.25 +speed_scale = 1.8 +fixed_fps = 60 +local_coords = true +process_material = ExtResource("6_ceio5") +draw_pass_1 = ExtResource("7_tkeme") + +[node name="Skew1" type="GPUParticles3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) +layers = 512 +material_override = SubResource("ShaderMaterial_ntvqm") +cast_shadow = 0 +gi_mode = 0 +emitting = false +amount = 1 +lifetime = 0.25 +one_shot = true +speed_scale = 1.8 +fixed_fps = 60 +local_coords = true +process_material = ExtResource("6_ceio5") +draw_pass_1 = ExtResource("7_tkeme") diff --git a/scene/effect/particle/_particle_slash1.tscn b/scene/effect/particle/_particle_slash1.tscn index 9d58212..eae6b81 100644 --- a/scene/effect/particle/_particle_slash1.tscn +++ b/scene/effect/particle/_particle_slash1.tscn @@ -1,13 +1,12 @@ -[gd_scene load_steps=11 format=3 uid="uid://b2h4pcmlii7dg"] +[gd_scene load_steps=14 format=3 uid="uid://b2h4pcmlii7dg"] [ext_resource type="Script" path="res://script/effect/particle.gd" id="1_fx8ev"] [ext_resource type="Shader" path="res://render/shader/effect_slash.gdshader" id="2_a0jwb"] -[ext_resource type="Material" uid="uid://dubkkji6sm8on" path="res://render/process_material/slash_normal.tres" id="2_eq67i"] [ext_resource type="Texture2D" uid="uid://c4byf37he3mjt" path="res://render/texture/particle/noise/noise1.png" id="3_fvsr3"] [ext_resource type="ArrayMesh" uid="uid://dq207a0waxk0j" path="res://render/mesh/slash1.obj" id="3_idjnm"] [ext_resource type="Texture2D" uid="uid://csjm7d1tg6b50" path="res://render/texture/particle/mask/mask6.png" id="4_wvohg"] +[ext_resource type="Texture2D" uid="uid://c1e2fcr0nucku" path="res://render/texture/particle/mask/mask9.png" id="5_n15k1"] [ext_resource type="Texture2D" uid="uid://dd3e7ol8qa5eq" path="res://render/texture/particle/noise/noise2.png" id="5_ymh7m"] -[ext_resource type="Shader" path="res://render/shader/effect_skew1.gdshader" id="8_gng47"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_hupcc"] render_priority = 0 @@ -15,14 +14,31 @@ shader = ExtResource("2_a0jwb") shader_parameter/tex_main = ExtResource("3_fvsr3") shader_parameter/tex_noise = ExtResource("5_ymh7m") shader_parameter/tex_mask = ExtResource("4_wvohg") +shader_parameter/tex_mask2 = ExtResource("5_n15k1") -[sub_resource type="ShaderMaterial" id="ShaderMaterial_ntvqm"] -render_priority = 0 -shader = ExtResource("8_gng47") -shader_parameter/distortionView = 0.03 -shader_parameter/speedView = 0.5 -shader_parameter/noise = ExtResource("3_fvsr3") -shader_parameter/tex_mask = ExtResource("4_wvohg") +[sub_resource type="Curve" id="Curve_7oqkb"] +_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"] +curve = SubResource("Curve_7oqkb") + +[sub_resource type="Gradient" id="Gradient_dobti"] +offsets = PackedFloat32Array(0, 0.137755) +colors = PackedColorArray(1, 1, 1, 1, 0.352133, 0.726909, 1, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_q36ua"] +gradient = SubResource("Gradient_dobti") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_m0ar0"] +particle_flag_rotate_y = true +angle_min = 180.0 +angle_max = 180.0 +angular_velocity_min = -720.0 +angular_velocity_max = -720.0 +gravity = Vector3(0, 0, 0) +color_ramp = SubResource("GradientTexture1D_q36ua") +alpha_curve = SubResource("CurveTexture_l34bo") [node name="Particle" type="Node3D"] script = ExtResource("1_fx8ev") @@ -40,21 +56,9 @@ one_shot = true speed_scale = 1.8 fixed_fps = 60 local_coords = true -process_material = ExtResource("2_eq67i") +process_material = SubResource("ParticleProcessMaterial_m0ar0") draw_pass_1 = ExtResource("3_idjnm") -[node name="Skew1" type="GPUParticles3D" parent="."] -transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) -layers = 512 -material_override = SubResource("ShaderMaterial_ntvqm") -cast_shadow = 0 -gi_mode = 0 -emitting = false -amount = 1 -lifetime = 0.25 -one_shot = true -speed_scale = 1.8 -fixed_fps = 60 -local_coords = true -process_material = ExtResource("2_eq67i") -draw_pass_1 = ExtResource("3_idjnm") +[node name="CSGBox3D" type="CSGBox3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.555449, 0) +visible = false diff --git a/scene/effect/particle/hero01_long_attack04.tscn b/scene/effect/particle/hero01_long_attack04.tscn index 4f4f1f8..d155c30 100644 --- a/scene/effect/particle/hero01_long_attack04.tscn +++ b/scene/effect/particle/hero01_long_attack04.tscn @@ -3,4 +3,4 @@ [ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/_particle_slash1.tscn" id="1_5b0hk"] [node name="Particle" instance=ExtResource("1_5b0hk")] -transform = Transform3D(1.2, 0, 0, 0, 0.707107, -0.353553, 0, 0.707107, 0.353553, 0, 0, 0) +transform = Transform3D(1.6, 0, 0, 0, 0.707107, -0.353553, 0, 0.707107, 0.353553, 0, 0, 0) diff --git a/script/character/character.gd b/script/character/character.gd index d531107..1980e51 100644 --- a/script/character/character.gd +++ b/script/character/character.gd @@ -2,6 +2,7 @@ extends CharacterBody3D class_name Character @onready var collision = (%Collision) +@onready var pushbox = (%Pushbox) @onready var status = (%Status as Status) @onready var view = (%View as View) @onready var buff = (%Buff as Buff) @@ -16,9 +17,11 @@ func init(id:int,cfg:CharacterCfg,team:Enum.ETeam): var half_height = Setting.pixel_size * cfg.sprite_harf_height var height = half_height * 2 var width = Setting.pixel_size * cfg.sprite_width - var body_scale = Vector3(width,half_height,width) + var body_scale = Vector3(width,height,width) collision.position = Vector3(0,half_height,0) collision.scale = body_scale + pushbox.position = Vector3(0,half_height,0) + pushbox.scale = body_scale status.basic_offset = Vector3(0,half_height,0) status.ui_offset = Vector3(0,height*1.1,0) status.ui_center_offset = Vector3(0,half_height,0) diff --git a/script/character/effect.gd b/script/character/effect.gd index 1350fdc..8f92182 100644 --- a/script/character/effect.gd +++ b/script/character/effect.gd @@ -97,6 +97,7 @@ func _cast_particle(resource:Resource ,is_attach:bool): func release_effect(): for particle:Particle in particle_list(): _release_effect(particle) + temp_release_particle_list.clear() func _release_effect(particle:Particle): particle.set_pause(false) diff --git a/script/character/hitbox.gd b/script/character/hitbox.gd new file mode 100644 index 0000000..fea17d7 --- /dev/null +++ b/script/character/hitbox.gd @@ -0,0 +1,36 @@ +extends Area3D +class_name PushBox + +@export var pushbox_curve : Curve + +@onready var character = (get_owner() as Character) +@onready var radius = $CollisionShape3D.shape.radius * scale.x + +var pushbox_list = [] + +func _process(delta): + var speed_dir = character.get_status("speed_dir") as Vector2 + if speed_dir.length() == 0: + return + var speed_down_push_rate = 0 + var pos = character.pos2D() + for pushbox:PushBox in pushbox_list: + var target_pos = pushbox.character.pos2D() + var dir = target_pos - pos + if speed_dir.dot(dir) <= 0: + continue + var dist = dir.length() + if dist == 0: + continue + var dist_rate = clamp(dist/(radius+pushbox.radius),0,1) + speed_down_push_rate = max(speed_down_push_rate,pushbox_curve.sample(dist_rate)) + character.set_status("speed_down_push_rate",speed_down_push_rate) + +func on_area_entered(area:Area3D): + if area is PushBox: + pushbox_list.append(area) + +func on_area_exited(area:Area3D): + if area is PushBox: + pushbox_list.erase(area) + diff --git a/script/character/move.gd b/script/character/move.gd index c4ad19a..7b73a95 100644 --- a/script/character/move.gd +++ b/script/character/move.gd @@ -51,20 +51,20 @@ func update_move(delta): var skill_velocity = status.skill_dir * status.skill_move_speed var hit_back_velocity = status.hit_back_dir * status.hit_back_speed move_velocity += skill_velocity + hit_back_velocity + status.speed_dir = Vector2(move_velocity.x,move_velocity.y) + if status.skill_move_speed >0: + move_velocity *= (1-status.speed_down_push_rate) if move_velocity.length() == 0: move_velocity = Vector2(character.velocity.x,character.velocity.z); if status.is_on_floor: move_velocity = Util.vector_reduce(move_velocity,Setting.drag_ground*delta) else: move_velocity = Util.vector_reduce(move_velocity,Setting.drag_air*delta) - else: - move_velocity.x = move_velocity.x - move_velocity.y = move_velocity.y character.velocity.x = move_velocity.x character.velocity.z = move_velocity.y - + status.speed_xz = Vector2(character.velocity.x,character.velocity.z).length() if status.is_free_turn and status.move_dir.x != 0: status.is_right = status.move_dir.x > 0 diff --git a/script/character/status.gd b/script/character/status.gd index c78d958..1a394b5 100644 --- a/script/character/status.gd +++ b/script/character/status.gd @@ -37,7 +37,9 @@ class_name Status @export_category("移动状态") @export var move_dir : Vector2 #移动方向 +@export var speed_dir : Vector2 #速度方向 @export var velocity_change : Vector3 #一帧内速度变化值 +@export var speed_down_push_rate : float #来自软阻挡的速度减少比率 @export var speed_up_rate : float #移动速度比率 @export var speed_xz : float #水平移动速度 @export var speed_y : float #竖直移动速度