运动自动形变/技能特效管理/修复动画问题

master
chendian 2 years ago
parent 90fd1662f9
commit 8735130f03

@ -11,7 +11,12 @@ hit_back_speed = 0.0
hit_back_duration = 0.0
hit_up_speed = 3.0
hit_up_duration = 0.1
pause_time = 0.0
pause_time = 0.1
is_floating = true
is_hit_down = false
is_rebound = false
is_force_pause = true
height = 2.0
radius = 0.0
size = Vector2(2, 1)
offset = Vector2(1, 0)

@ -16,6 +16,7 @@ action = "attack_light"
name = ""
skill_animation = ExtResource("3_3pp8a")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_mxlqc")])
attack_particle_list = Array[PackedScene]([])
free_lock = false
refresh_animation = false
sprite_frames = ExtResource("4_q0bln")

@ -1,9 +1,8 @@
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=7 format=3 uid="uid://b6x3jdiqtum6"]
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=6 format=3 uid="uid://b6x3jdiqtum6"]
[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/normal_hit.tres" id="1_6ven2"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="1_gik08"]
[ext_resource type="Animation" uid="uid://daopmieibx3b7" path="res://resource/skill_animation/hero01_long_attack01.tres" id="2_6nbpq"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="2_f3mmj"]
[ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="4_id85o"]
[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="5_xel5p"]
@ -17,7 +16,6 @@ action = "attack_light"
name = ""
skill_animation = ExtResource("2_6nbpq")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_6ven2")])
attack_particle = ExtResource("2_f3mmj")
free_lock = false
refresh_animation = false
sprite_frames = ExtResource("5_xel5p")

@ -1,8 +1,9 @@
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=6 format=3 uid="uid://cs32884hwqxd7"]
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=7 format=3 uid="uid://cs32884hwqxd7"]
[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/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="PackedScene" uid="uid://ns84g1jmmm56" path="res://scene/effect/particle/hero01_long_attack02.tscn" id="2_rjifv"]
[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"]
@ -16,6 +17,7 @@ action = "attack_light"
name = ""
skill_animation = ExtResource("2_jrgan")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_8fm1u")])
attack_particle = ExtResource("2_rjifv")
free_lock = false
refresh_animation = false
sprite_frames = ExtResource("3_jidy7")

@ -1,8 +1,9 @@
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=6 format=3 uid="uid://huxlxrmyulo"]
[gd_resource type="Resource" script_class="PlayerSkillCfg" load_steps=7 format=3 uid="uid://huxlxrmyulo"]
[ext_resource type="Resource" uid="uid://ckeuv5lhfk2s0" path="res://config/attack/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="PackedScene" uid="uid://bn2ktr7iynt5" path="res://scene/effect/particle/hero01_long_attack03_0.tscn" id="2_pykbt"]
[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"]
@ -16,6 +17,7 @@ action = "attack_light"
name = ""
skill_animation = ExtResource("2_ugt3f")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_7ai5j")])
attack_particle = ExtResource("2_pykbt")
free_lock = false
refresh_animation = false
sprite_frames = ExtResource("3_sr2og")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 37 KiB

File diff suppressed because one or more lines are too long

@ -78,13 +78,27 @@ tracks/5/keys = {
"method": &"attack"
}]
}
tracks/6/type = "value"
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("View:frame")
tracks/6/path = NodePath("Effect")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"cast_attack_particle"
}]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("View:frame")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,

@ -82,13 +82,30 @@ tracks/5/keys = {
"method": &"attack"
}]
}
tracks/6/type = "value"
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("View:frame")
tracks/6/path = NodePath("Effect")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0.1, 0.5),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"cast_attack_particle"
}, {
"args": [],
"method": &"cast_attack_particle"
}]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("View:frame")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,

@ -60,7 +60,7 @@ tracks/4/path = NodePath("Status:skill_move_speed")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.1, 0.5, 0.6),
"times": PackedFloat32Array(0.1, 0.4, 0.6),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [1.0, 3.0, 0.0]
@ -79,13 +79,27 @@ tracks/5/keys = {
"method": &"attack"
}]
}
tracks/6/type = "value"
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("View:frame")
tracks/6/path = NodePath("Effect")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0.4),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"cast_attack_particle"
}]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("View:frame")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,

@ -15,7 +15,7 @@ tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"update": 1,
"values": [ExtResource("2_3eu5o")]
}
tracks/1/type = "value"
@ -27,64 +27,52 @@ tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"update": 1,
"values": ["long_flash"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
tracks/2/path = NodePath("Status:break_level")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 0,
"values": [0, 1, 2, 3, 4]
"times": PackedFloat32Array(0, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [0, 3, 4]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Status:break_level")
tracks/3/path = NodePath("Status:speed_up_rate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1),
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0, 3, 4]
"values": [0.0, 0.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Status:speed_up_rate")
tracks/4/path = NodePath("Status:skill_move_speed")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.3),
"times": PackedFloat32Array(0.1, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0.0, 0.0]
"values": [6.0, 0.0]
}
tracks/5/type = "value"
tracks/5/type = "method"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Status:skill_move_speed")
tracks/5/path = NodePath("Effect")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.1, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [6.0, 0.0]
}
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("Effect")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"values": [{
@ -101,3 +89,15 @@ tracks/6/keys = {
"method": &"cast_after_image"
}]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("View:frame")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4]
}

@ -13,7 +13,7 @@ tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"update": 1,
"values": [ExtResource("1_54a73")]
}
tracks/1/type = "value"
@ -25,64 +25,52 @@ tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"update": 1,
"values": ["long_skill01"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
tracks/2/path = NodePath("Status:break_level")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
"times": PackedFloat32Array(0, 0.3, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [0, 3, 4]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Status:break_level")
tracks/3/path = NodePath("Status:speed_up_rate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.3, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"times": PackedFloat32Array(0.1, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0, 3, 4]
"values": [-0.5, -1.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Status:speed_up_rate")
tracks/4/path = NodePath("Status:skill_move_speed")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.1, 0.5),
"times": PackedFloat32Array(0.1, 0.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [-0.5, -1.0]
"values": [6.0, 0.0]
}
tracks/5/type = "value"
tracks/5/type = "method"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Status:skill_move_speed")
tracks/5/path = NodePath("Battle")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.1, 0.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [6.0, 0.0]
}
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("Battle")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0.4),
"transitions": PackedFloat32Array(1),
"values": [{
@ -90,3 +78,15 @@ tracks/6/keys = {
"method": &"attack"
}]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("View:frame")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
}

@ -14,7 +14,7 @@ tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"update": 1,
"values": [ExtResource("1_5wtdf")]
}
tracks/1/type = "value"
@ -26,83 +26,80 @@ tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"update": 1,
"values": ["long_skill02"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
tracks/2/path = NodePath("Status:break_level")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [0, 1, 2, 3, 4, 5, 6, 7]
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0, 3]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Status:break_level")
tracks/3/path = NodePath("Status:speed_up_rate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.5),
"times": PackedFloat32Array(0, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0, 3]
"values": [-0.5, -1.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Status:speed_up_rate")
tracks/4/path = NodePath("Status:skill_move_speed")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.2),
"times": PackedFloat32Array(0.1, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [-0.5, -1.0]
"values": [2.0, 0.0]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Status:skill_move_speed")
tracks/5/path = NodePath("Status:skill_float_speed")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.1, 0.2),
"times": PackedFloat32Array(0.3, 0.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [2.0, 0.0]
"values": [3.0, 0.0]
}
tracks/6/type = "value"
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("Status:skill_float_speed")
tracks/6/path = NodePath("Battle")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0.3, 0.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [3.0, 0.0]
"times": PackedFloat32Array(0.3),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"attack"
}]
}
tracks/7/type = "method"
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("Battle")
tracks/7/path = NodePath("View:frame")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0.3, 0.4),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"attack"
}, {
"args": [],
"method": &"attack"
}]
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7]
}

@ -8,11 +8,9 @@
[node name="Character" instance=ExtResource("1_pot50")]
[node name="Status" parent="." index="1"]
speed_up_rate = -0.5
[node name="View" parent="." index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.693056, 0)
animation = &"long_air_attack01"
[node name="Combo" type="Node3D" parent="." index="8"]
unique_name_in_owner = true

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://c101pt8hqvmbk"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="1_glj7d"]
[node name="Particle" instance=ExtResource("1_glj7d")]
transform = Transform3D(1, 0, 0, 0, 0.707107, -0.353553, 0, 0.707107, 0.353553, 0, 0, 0)
[node name="Slash" parent="." index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://ns84g1jmmm56"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="1_hciuf"]
[node name="Particle" instance=ExtResource("1_hciuf")]
transform = Transform3D(1, 0, 0, 0, -0.707107, 0.353553, 0, -0.707107, -0.353553, 0, 0, 0)
[node name="Slash" parent="." index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://bn2ktr7iynt5"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="1_p44mg"]
[node name="Particle" instance=ExtResource("1_p44mg")]
transform = Transform3D(1, 0, 0, 0, -0.707107, 0.353553, 0, -0.707107, -0.353553, 0, 0, 0)
[node name="Slash" parent="." index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://dj04l4oge27f0"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.tscn" id="1_078jk"]
[node name="Particle" instance=ExtResource("1_078jk")]
transform = Transform3D(1, 0, 0, 0, 0.5, 0.433012, 0, -0.866026, 0.25, 0, 0, 0)
[node name="Slash" parent="." index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://c5srkd0js0bwc"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/particle_slash_normal.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)
[node name="Slash" parent="." index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

@ -9,6 +9,7 @@
script = ExtResource("1_fx8ev")
[node name="Slash" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 0.5, 0, 0, 0)
material_override = ExtResource("1_6c80n")
cast_shadow = 0
emitting = false

@ -11,19 +11,11 @@ class HitInfo:
var dir : Vector2
var attack : AttackCfg
var hit_info_list = [] #命中信息
func attack():
if !status.skill_cfg:
return
var attack_list = status.skill_cfg.attack_list
if !attack_list:
print("未配置技能攻击",status.skill_cfg)
return
var attack_index = status.skill_attack_index
if attack_index >= len(attack_list):
attack_index = len(attack_list) - 1
var attack = attack_list[attack_index] as AttackCfg
var attack = status.skill_cfg.get_attack(status.skill_attack_index) as AttackCfg
status.skill_attack_index += 1
var enemy_list = Global.character_mgr.get_enemy_list(character.id())
var pos = character.pos()
var attack_dir = status.skill_dir.normalized()
@ -32,7 +24,7 @@ func attack():
var attack_radius = attack.radius
var offset_xz = attack_dir * Util.grid_float(attack.offset.x)
pos += Vector3(offset_xz.x,Util.grid_float(attack.offset.y),offset_xz.y)
var is_hit = false
var is_stuck = false
for enemy in enemy_list:
var target_pos = enemy.pos()
var target_radius = enemy.radius()
@ -43,9 +35,8 @@ func attack():
hit_info.to = enemy.id()
hit_info.dir = attack_dir
hit_info.attack = attack
hit_info_list.append(hit_info)
is_hit = true
if not is_hit:
is_stuck = is_stuck || settle(hit_info)
if !is_stuck and !attack.is_force_pause:
skill.on_attack_miss()
func add_attack(from:int,dir:Vector2,attack:AttackCfg):
@ -54,18 +45,13 @@ func add_attack(from:int,dir:Vector2,attack:AttackCfg):
hit_info.to = character.id()
hit_info.dir = dir
hit_info.attack = attack
hit_info_list.append(hit_info)
func _process(delta):
for hit_info in hit_info_list:
settle(hit_info)
hit_info_list.clear()
settle(hit_info)
func settle(hit_info:HitInfo):
func settle(hit_info:HitInfo) -> bool:
var character_from = Global.character_mgr.get_character(hit_info.from) as Character
var character_to = Global.character_mgr.get_character(hit_info.to) as Character
if !character_from or !character_to:
return
return false
var cfg_from = character_from.cfg()
var cfg_to = character_to.cfg()
@ -179,9 +165,6 @@ func settle(hit_info:HitInfo):
#闪白
character_to.add_buff("flash_white",0.1)
#形变
character_to.add_buff("deformation",0.1)
#卡帧
character_from.add_buff("pause",attack.pause_time)
character_to.add_buff("pause",attack.pause_time)
@ -194,6 +177,8 @@ func settle(hit_info:HitInfo):
elif is_break_stun:character_to.show_hit_text("Stun")
elif not is_break_skill:character_to.show_hit_text("Block")
return !is_break_skill
func add_mp(value:float):
var mp = character.get_status("mp")
var mp_max = character.get_status("mp_max")

@ -148,9 +148,7 @@ func on_end_flash_white(rate):status.flash_white_rate = 0
func on_update_shake_x(rate):status.shake_offset = Vector3((sin(rate * PI * 4) - 0.5)*0.02,0,0);
func on_end_shake_x(rate):status.shake_offset = Vector3.ZERO
func on_start_deformation(rate):
status.deformation_dir=Vector2(status.hit_back_speed,status.hit_up_speed)
status.deformation_rate = 1;
func on_start_deformation(rate):status.deformation_rate = 1;
func on_update_deformation(rate):status.deformation_rate = 1 - rate
func on_end_deformation(rate):status.deformation_rate = 0

@ -56,8 +56,11 @@ func cast_corpse():cast_image(corpse)
func cast_attack_particle():
if !status.skill_cfg:
return
var resource = status.skill_cfg.attack_particle as Resource
cast_particle(resource)
var attack_particle = status.skill_cfg.get_attack_particle(status.skill_attack_effect_index)
if !attack_particle:
print("未配置技能攻击特效:",status.skill_cfg.resource_path)
return
cast_particle(attack_particle)
func cast_particle(resource:Resource):
if !resource:
@ -65,11 +68,11 @@ func cast_particle(resource:Resource):
return
var new_particle = resource.instantiate() as Particle
new_particle.position = status.basic_offset
new_particle.name = "attack_particle"
var dir = status.skill_dir
new_particle.name = "particle"
var dir = status.skill_dir as Vector2
dir.x = abs(dir.x)
var angle = dir.angle_to(Vector2.RIGHT)
new_particle.rotation.y = angle
new_particle.rotation.y = angle if is_right else -angle
new_particle.scale.x = 1 if is_right else -1
add_child(new_particle)

@ -6,6 +6,7 @@ class_name Move
@onready var buff = (%Buff as Buff)
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
var velocity_cache : Vector3
func _process(delta):
if Global.is_level_loading_contorl:return
@ -14,12 +15,15 @@ func _process(delta):
update_move(delta)
update_speed_y(delta)
character.move_and_slide()
status.velocity_change = character.velocity.abs() - velocity_cache
velocity_cache = character.velocity.abs()
if character.velocity:
SignalManager.character_pos_changed.emit(character.id(),character.pos())
SignalManager.character_ui_pos_changed.emit(character.id(),character.ui_pos())
SignalManager.character_status_changed.emit(status.id,"pos2d",character.pos2D())
if is_hit_floor:
SignalManager.character_hit_floor.emit(character.id(),character.pos())
update_deformation(delta)
func update_on_floor(delta) -> bool:
var is_on_floor = character.is_on_floor()
@ -65,6 +69,15 @@ func update_move(delta):
if status.is_free_turn and status.move_dir.x != 0:
status.is_right = status.move_dir.x > 0
func update_deformation(delta):
var velocity_change_x = status.velocity_change.x
var velocity_change_y = status.velocity_change.y + status.velocity_change.z
var dir_x = 1 if velocity_change_x > 1 or velocity_change_y < -1 else 0
var dir_y = 1 if velocity_change_y > 1 or velocity_change_x < -1 else 0
if dir_x or dir_y:
status.deformation_dir=Vector2(dir_x,dir_y)
character.add_buff("deformation",0.2)
func jump():
character.velocity.y = status.cfg.move.jump_velocity
status.is_jumped = true

@ -34,6 +34,8 @@ func cast_skill(cfg:SkillCfg,cast_dir:Vector2):
status.skill_cfg = cfg
status.skill_dir = cast_dir
status.break_level = Enum.EBreakLevel.None
status.skill_attack_index = 0
status.skill_attack_effect_index = 0
if cast_dir.x != 0: status.is_right = cast_dir.x > 0
play(animation_name,-1,Setting.animation_speed_scale)
else:
@ -49,6 +51,8 @@ func cancel_skill():
status.is_skill_running = false
status.skill_cfg = null
status.break_level = Enum.EBreakLevel.Walk
status.skill_attack_index = 0
status.skill_attack_effect_index = 0
effect.release_effect()
view.reset()

@ -37,6 +37,7 @@ class_name Status
@export_category("移动状态")
@export var move_dir : Vector2 #移动方向
@export var velocity_change : Vector3 #一帧内速度变化值
@export var speed_up_rate : float #移动速度比率
@export var speed_xz : float #水平移动速度
@export var speed_y : float #竖直移动速度
@ -63,6 +64,7 @@ class_name Status
@export var skill_move_speed : float #技能位移速度
@export var skill_float_speed : float #技能y位移速度
@export var skill_attack_index : int #技能攻击段数
@export var skill_attack_effect_index : int #技能特效段数
@export_category("玩家技能状态")
@export var input_dir : Vector2 #指令方向

@ -149,19 +149,17 @@ func _on_animation_finished():
update_trans(true)
func update_material():
var material = material_override.next_pass as ShaderMaterial
var material2 = material_override as ShaderMaterial
call_deferred("_update_material")
func _update_material():
var material = material_override as ShaderMaterial
var material2 = material_override.next_pass as ShaderMaterial
var tex = sprite_frames.get_frame_texture(animation,frame)
material.set_shader_parameter("flash_white",status.flash_white_rate)
material.set_shader_parameter("deformation_dir",status.deformation_dir)
material2.set_shader_parameter("deformation_dir",status.deformation_dir)
material.set_shader_parameter("deformation_rate",status.deformation_rate*0.4)
material2.set_shader_parameter("deformation_rate",status.deformation_rate*0.4)
call_deferred("refresh_texture")
func refresh_texture():
var material = material_override as ShaderMaterial
var material2 = material_override.next_pass as ShaderMaterial
var tex = sprite_frames.get_frame_texture(animation,frame)
material.set_shader_parameter("tex",tex)
material2.set_shader_parameter("tex",tex)
@ -176,6 +174,7 @@ func play_animation(animation_name:String):
if animation_name == animation:
frame = 0
frame_progress = 0
play()
else:
play(animation_name,Setting.animation_speed_scale)

@ -13,6 +13,7 @@ class_name AttackCfg
@export var is_floating : bool #是否浮空技
@export var is_hit_down : bool #是否击落技
@export var is_rebound : bool #是否地面反弹技能
@export var is_force_pause : bool #是否强制卡帧
@export var height : float = 2 #判定框高度
@export var radius : float #圆形判定框 半径
@export var size : Vector2 = Vector2(2,1) #矩形判定框 大小

@ -6,7 +6,6 @@ class_name SkillCfg
@export var name : String
@export var skill_animation : Animation
@export var attack_list : Array[AttackCfg]
@export var attack_particle : PackedScene
@export var free_lock : bool
@export var refresh_animation : bool :
@ -15,12 +14,7 @@ class_name SkillCfg
func check_animation():
var res_name = Util.get_resource_name(self)
var skill_animation_path = "res://resource/skill_animation/%s.tres" %res_name
if !create_animation(res_name,skill_animation_path):
return
skill_animation = load(skill_animation_path)
func create_animation(res_name,path) -> bool:
var path = "res://resource/skill_animation/%s.tres" %res_name
if sprite_frames == null:
print("未设置技能动画资源")
return false
@ -36,6 +30,22 @@ func create_animation(res_name,path) -> bool:
animation.resource_name = res_name
Util.refresh_animation_by_sprite_frames(path,sprite_frames,animation_name,animation)
Util.refresh_animation_lib()
return true
skill_animation = load(path)
func get_attack(index:int)->AttackCfg:
if !attack_list:
return ResourceManager.cfg_attack_normal
if index >= len(attack_list):
index = len(attack_list) - 1
var attack = attack_list[index] as AttackCfg
return attack
func get_attack_particle(index:int)->Resource:
var res_name = Util.get_resource_name(self)
var path_index = "res://scene/effect/particle/%s_%d.tscn" % [res_name,index]
if ResourceLoader.exists(path_index):
return load(path_index)
var path_default = "res://scene/effect/particle/%s.tscn" % res_name
if ResourceLoader.exists(path_default):
return load(path_default)
return null

@ -3,14 +3,19 @@ class_name Particle
var life_time : float
var is_pause : bool = false
var particle_list : Array[GPUParticles3D]
var speed_scale_list = []
func _ready():
for child in get_children():
if child is GPUParticles3D:
var particle = child as GPUParticles3D
if particle.lifetime > life_time:
life_time = particle.lifetime
particle.restart()
particle_list.append(particle)
speed_scale_list.append(particle.speed_scale)
for particle : GPUParticles3D in particle_list:
if particle.lifetime > life_time:
life_time = particle.lifetime
particle.restart()
func _process(delta):
if is_pause:
@ -21,7 +26,7 @@ func _process(delta):
func set_pause(is_pause_set:bool):
is_pause = is_pause_set
for child in get_children():
if child is GPUParticles3D:
var particle = child as GPUParticles3D
particle.speed_scale = 0 if is_pause else 1
for i in range(len(particle_list)):
var particle = particle_list[i]
var speed_scale = speed_scale_list[i]
particle.speed_scale = 0 if is_pause else speed_scale

@ -16,4 +16,5 @@ var particle_hit_normal = load("res://scene/effect/particle/particle_hit_normal.
var cfg_character_player = load("res://config/character/hero01.tres")
var cfg_character_monster_test = load("res://config/character/monster02.tres")
#attack
var cfg_attack_normal = load("res://config/attack/normal_hit.tres")
var cfg_attack_rebound = load("res://config/attack/rebound.tres")

Loading…
Cancel
Save