master
chendian 2 years ago
parent 514c4e2cc1
commit 4463bb7b9d

@ -0,0 +1,23 @@
[gd_resource type="Resource" script_class="SkillPlayerCfg" load_steps=6 format=3 uid="uid://dkxgra6y2u30l"]
[ext_resource type="Resource" uid="uid://bsqk3q6mccllg" path="res://config/attack/normal_hit.tres" id="1_h0ykq"]
[ext_resource type="Script" path="res://script/config/player_skill_cfg.gd" id="2_mje6b"]
[ext_resource type="Animation" uid="uid://dxgqn5fa7aokj" path="res://resource/skill_animation/hero01_fist_air_skill01.tres" id="3_q461t"]
[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="4_seudu"]
[ext_resource type="Resource" uid="uid://c6alg8pmqfdxm" path="res://config/weapon/fist.tres" id="5_70pp4"]
[resource]
script = ExtResource("2_mje6b")
weapon = ExtResource("5_70pp4")
stance_from = 10
stance_to = 0
break_level = 3
action = "attack_heavy"
name = ""
skill_animation = ExtResource("3_q461t")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_h0ykq")])
sub_character_list = Array[Resource("res://script/config/character_cfg.gd")]([])
free_lock = false
refresh_animation = false
sprite_frames = ExtResource("4_seudu")
animation_name = "fist_air_skill01"

@ -0,0 +1,18 @@
from PIL import Image
# Open the image
image = Image.open('decal_shockwave.png')
# Get the image size
width, height = image.size
# Modify each pixel's RGBA value
for x in range(width):
for y in range(height):
r, g, b, a = image.getpixel((x, y))
# Modify the RGBA values here
# For example, invert the colors
image.putpixel((x, y), (255,255,255,r))
# Save the modified image
image.save('decal_shockwave.png')

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://brgii0qi4s6kb"
path="res://.godot/imported/decal_dust.png-018d105ab63df278ad4deeb5e793a989.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/shape/decal_dust.png"
dest_files=["res://.godot/imported/decal_dust.png-018d105ab63df278ad4deeb5e793a989.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

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bjv7f83tdgq17"
path="res://.godot/imported/explodeDecal.png-98bda2cf336166681eaff595a5bec12f.ctex"
path="res://.godot/imported/decal_explode.png-469403a7e0538c7d5588ac39ef569a1a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/shape/explodeDecal.png"
dest_files=["res://.godot/imported/explodeDecal.png-98bda2cf336166681eaff595a5bec12f.ctex"]
source_file="res://render/texture/shape/decal_explode.png"
dest_files=["res://.godot/imported/decal_explode.png-469403a7e0538c7d5588ac39ef569a1a.ctex"]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b6bfacouwy2hi"
path="res://.godot/imported/decal_glow.png-60e7c65c14d9ba83f9accaada44f46cd.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/shape/decal_glow.png"
dest_files=["res://.godot/imported/decal_glow.png-60e7c65c14d9ba83f9accaada44f46cd.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: 51 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dkhmqgtc8tn1t"
path="res://.godot/imported/decal_shockwave.png-ff3f5745d48dd37c112ee6075801a729.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/shape/decal_shockwave.png"
dest_files=["res://.godot/imported/decal_shockwave.png-ff3f5745d48dd37c112ee6075801a729.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

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ceu7b4nuktlgy"
path="res://.godot/imported/swordDecal.png-152ce59ae7b5e48a88a78d43374add4a.ctex"
path="res://.godot/imported/decal_sword.png-ca0e8413a122e9ea54f5877a2e742f7f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/shape/swordDecal.png"
dest_files=["res://.godot/imported/swordDecal.png-152ce59ae7b5e48a88a78d43374add4a.ctex"]
source_file="res://render/texture/shape/decal_sword.png"
dest_files=["res://.godot/imported/decal_sword.png-ca0e8413a122e9ea54f5877a2e742f7f.ctex"]
[params]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

@ -0,0 +1,122 @@
[gd_resource type="Animation" load_steps=2 format=3 uid="uid://dxgqn5fa7aokj"]
[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="1_0ac7k"]
[resource]
resource_name = "hero01_fist_air_skill01"
length = 0.9
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("View:sprite_frames")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [ExtResource("1_0ac7k")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("View:animation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": ["fist_air_skill01"]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("View:frame")
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),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Status:break_level")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.1, 0.8),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [0, 3, 4]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Status:speed_up_rate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.3, 0.7),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [-0.5, -1.0]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Status:skill_move_speed")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.2, 0.4),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [5.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.6),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"attack"
}]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("Status:skill_float_speed")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0.2, 0.2001, 0.4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [-4.0, -4.0, 0.0]
}
tracks/8/type = "method"
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/path = NodePath("Effect")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/keys = {
"times": PackedFloat32Array(0.2, 0.6),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"cast_attack_particle"
}, {
"args": [],
"method": &"cast_attack_particle"
}]
}

@ -1,4 +1,4 @@
[gd_resource type="AnimationLibrary" load_steps=25 format=3 uid="uid://croik07a1qko5"]
[gd_resource type="AnimationLibrary" load_steps=26 format=3 uid="uid://croik07a1qko5"]
[ext_resource type="Animation" uid="uid://t01a4jvp8srr" path="res://resource/skill_animation/hero01_fist_attack01.tres" id="1_4bwwm"]
[ext_resource type="Animation" uid="uid://p8l0puqxrkwh" path="res://resource/skill_animation/hero01_long_air_attack01.tres" id="1_b46g3"]
@ -16,6 +16,7 @@
[ext_resource type="Animation" uid="uid://dk1o3gqhjmuvh" path="res://resource/skill_animation/hero01_long_attack04.tres" id="4_36e6x"]
[ext_resource type="Animation" uid="uid://6u3dhxly760l" path="res://resource/skill_animation/hero01_fist_attack04.tres" id="4_087em"]
[ext_resource type="Animation" uid="uid://dkkqys8el1u6g" path="res://resource/skill_animation/hero01_common_skill02.tres" id="4_vtwy2"]
[ext_resource type="Animation" uid="uid://dxgqn5fa7aokj" path="res://resource/skill_animation/hero01_fist_air_skill01.tres" id="5_df32u"]
[ext_resource type="Animation" uid="uid://cwm116apu63n1" path="res://resource/skill_animation/hero01_long_flash.tres" id="5_fumom"]
[ext_resource type="Animation" uid="uid://bjnkrte7660pt" path="res://resource/skill_animation/hero01_long_skill01.tres" id="5_kt0qw"]
[ext_resource type="Animation" uid="uid://iprcbf277rf4" path="res://resource/skill_animation/hero01_long_skill02.tres" id="7_ui68j"]
@ -31,6 +32,7 @@ _data = {
"hero01_common_skill0102": ExtResource("2_8l02x"),
"hero01_common_skill0103": ExtResource("3_ily05"),
"hero01_common_skill02": ExtResource("4_vtwy2"),
"hero01_fist_air_skill01": ExtResource("5_df32u"),
"hero01_fist_attack01": ExtResource("1_4bwwm"),
"hero01_fist_attack02": ExtResource("2_vx7p1"),
"hero01_fist_attack03": ExtResource("3_lo6yb"),

@ -2,7 +2,7 @@
[ext_resource type="PackedScene" uid="uid://8rcvw1vnjcf7" path="res://scene/character/character.tscn" id="1_pot50"]
[ext_resource type="Script" path="res://script/character/player/combo.gd" id="2_i44w8"]
[ext_resource type="SpriteFrames" uid="uid://bhsotj76tuovy" path="res://resource/animation/character/hero01_fist_attack.aseprite" id="2_oua0x"]
[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="2_rubkv"]
[ext_resource type="Script" path="res://script/character/player/player_input.gd" id="3_n07go"]
[ext_resource type="Script" path="res://script/character/player/core.gd" id="3_rxdse"]
[ext_resource type="Script" path="res://script/character/player/player_info.gd" id="4_mi1lk"]
@ -12,8 +12,8 @@
[node name="View" parent="." index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.693056, 0)
sprite_frames = ExtResource("2_oua0x")
animation = &"fist_attack05"
sprite_frames = ExtResource("2_rubkv")
animation = &"fist_air_skill01"
[node name="Combo" type="Node3D" parent="." index="8"]
unique_name_in_owner = true

@ -1,10 +1,9 @@
[gd_scene load_steps=3 format=3 uid="uid://b12fa5bpdmhms"]
[gd_scene load_steps=2 format=3 uid="uid://b12fa5bpdmhms"]
[ext_resource type="SpriteFrames" uid="uid://cwe8setoi6bd" path="res://resource/animation/character/hero01_move.aseprite" id="1_1twno"]
[ext_resource type="Script" path="res://script/effect/afterimage.gd" id="2_grtq1"]
[node name="AfterImage" type="AnimatedSprite3D"]
pixel_size = 0.02
sprite_frames = ExtResource("1_1twno")
animation = &"idle_loop"
[node name="AfterImage" type="Node3D"]
script = ExtResource("2_grtq1")
life_time = 0.2
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."]

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=3 uid="uid://dfdt6u2dbig3e"]
[ext_resource type="PackedScene" uid="uid://me2heq5v1c5q" path="res://scene/effect/particle/particle_dash_normal.tscn" id="1_1r02f"]
[node name="Particle" instance=ExtResource("1_1r02f")]

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

@ -0,0 +1,41 @@
[gd_scene load_steps=6 format=3 uid="uid://me2heq5v1c5q"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_5usbn"]
[ext_resource type="Material" uid="uid://dtyosukxpf33d" path="res://render/material/effect_slash.tres" id="2_w7v70"]
[ext_resource type="Material" uid="uid://dubkkji6sm8on" path="res://render/process_material/slash_normal.tres" id="3_uy3s2"]
[ext_resource type="ArrayMesh" uid="uid://dq207a0waxk0j" path="res://render/mesh/slash1.obj" id="4_1ed4g"]
[ext_resource type="Material" uid="uid://bkbuvtya3uk3x" path="res://render/material/effect_skew1.tres" id="5_uwxv5"]
[node name="Particle" type="Node3D"]
script = ExtResource("1_5usbn")
[node name="Slash" type="GPUParticles3D" parent="."]
layers = 512
material_override = ExtResource("2_w7v70")
cast_shadow = 0
gi_mode = 0
emitting = false
amount = 1
lifetime = 0.25
one_shot = true
speed_scale = 1.5
fixed_fps = 60
local_coords = true
process_material = ExtResource("3_uy3s2")
draw_pass_1 = ExtResource("4_1ed4g")
[node name="Skew1" type="GPUParticles3D" parent="."]
transform = Transform3D(0.99, 0, 0, 0, 0.99, 0, 0, 0, 0.99, 0, 0, 0)
layers = 512
material_override = ExtResource("5_uwxv5")
cast_shadow = 0
gi_mode = 0
emitting = false
amount = 1
lifetime = 0.25
one_shot = true
speed_scale = 1.5
fixed_fps = 60
local_coords = true
process_material = ExtResource("3_uy3s2")
draw_pass_1 = ExtResource("4_1ed4g")

@ -0,0 +1,65 @@
[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/shape/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/shape/decal_dust.png" id="4_jxr0h"]
[ext_resource type="Texture2D" uid="uid://dkhmqgtc8tn1t" path="res://render/texture/shape/decal_shockwave.png" id="5_c3jkk"]
[ext_resource type="Texture2D" uid="uid://b6bfacouwy2hi" path="res://render/texture/shape/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)
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")
cull_mask = 1
script = ExtResource("3_dwi0o")
lifetime = 0.5
scale_curve = SubResource("Curve_r6bwy")
rotate = 15
[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")
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")
cull_mask = 1
script = ExtResource("3_dwi0o")
lifetime = 0.1
scale_curve = SubResource("Curve_18e7g")

@ -1,9 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://cxj65e7teugyw"]
[ext_resource type="Texture2D" uid="uid://bd7kst3jrrma5" path="res://render/texture/shape/readiness_bullet.png" id="1_qpapc"]
[ext_resource type="Texture2D" uid="uid://bd7kst3jrrma5" path="res://render/texture/shape/readiness_bullet.png" id="1_30j48"]
[node name="ReadinessHero" type="Decal"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
size = Vector3(1, 1, 1)
texture_albedo = ExtResource("1_qpapc")
texture_albedo = ExtResource("1_30j48")
cull_mask = 1

@ -1,9 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://7ej8d4b1lc0v"]
[ext_resource type="Texture2D" uid="uid://dpsxejelj58f8" path="res://render/texture/shape/readiness_hero.png" id="1_gkbai"]
[ext_resource type="Texture2D" uid="uid://dpsxejelj58f8" path="res://render/texture/shape/readiness_hero.png" id="1_msawg"]
[node name="ReadinessHero" type="Decal"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.358925, 0)
size = Vector3(1, 1, 1)
texture_albedo = ExtResource("1_gkbai")
texture_albedo = ExtResource("1_msawg")
cull_mask = 1

@ -3,9 +3,9 @@ class_name Effect
@onready var afterimage = preload("res://scene/effect/afterimage/normal.tscn")
@onready var corpse = preload("res://scene/effect/afterimage/normal.tscn")
@onready var readiness_hero = preload("res://scene/effect/decal/readiness_hero.tscn")
@onready var readiness_monster = preload("res://scene/effect/decal/readiness_monster.tscn")
@onready var readiness_bullet = preload("res://scene/effect/decal/readiness_bullet.tscn")
@onready var readiness_hero = preload("res://scene/effect/readiness/readiness_hero.tscn")
@onready var readiness_monster = preload("res://scene/effect/readiness/readiness_monster.tscn")
@onready var readiness_bullet = preload("res://scene/effect/readiness/readiness_bullet.tscn")
@onready var character = (get_owner() as Character)
@onready var view = (%View as View)
@ -50,7 +50,7 @@ func cast_image(res:Resource):
new_afterimage.position = character.view_pos()
new_afterimage.name = "afterimage"
new_afterimage.velocity = character.velocity / 4
view.clone(new_afterimage)
new_afterimage.target = view
SignalManager.effect_create.emit(new_afterimage)
func cast_after_image():cast_image(afterimage)
@ -59,6 +59,7 @@ func cast_attack_particle():
if !status.skill_cfg:
return
var attack_particle = status.skill_cfg.get_attack_particle(status.skill_attack_effect_index)
status.skill_attack_effect_index += 1
if !attack_particle:
print("未配置技能攻击特效:",status.skill_cfg.resource_path)
return
@ -68,7 +69,7 @@ func cast_particle(resource:Resource):
if !resource:
print("未配置技能特效")
return
var new_particle = resource.instantiate() as Particle
var new_particle = resource.instantiate() as Particle
new_particle.position = status.basic_offset
new_particle.name = "particle"
var dir = status.skill_dir as Vector2

@ -163,13 +163,6 @@ func _update_material():
material.set_shader_parameter("tex",tex)
material2.set_shader_parameter("tex",tex)
func clone(target:AnimatedSprite3D):
target.sprite_frames = sprite_frames
target.animation = animation
target.frame = frame
target.frame_progress = frame_progress
target.scale.x = scale.x
func play_animation(animation_name:String):
if not sprite_frames.has_animation(animation_name):
return

@ -1,22 +1,20 @@
extends AnimatedSprite3D
extends EffectBase
class_name Afterimage
@export var duration_max:float = 0.2
@export var is_moving:bool = true
@export var is_moving : bool = true
@onready var image = $AnimatedSprite3D as AnimatedSprite3D
var velocity : Vector3
var target : AnimatedSprite3D
var duration:float
var velocity:Vector3
func _ready():
duration = duration_max
func _process(delta):
func on_ready():
image.sprite_frames = target.sprite_frames
image.animation = target.animation
image.frame = target.frame
image.frame_progress = target.frame_progress
image.scale.x = target.scale.x
image.pixel_size = Setting.pixel_size
func on_process(delta):
if is_moving:
position += velocity*delta
var rate = duration / duration_max
modulate.a = rate
duration-=delta
if duration<=0:
queue_free()
image.modulate.a = rate

@ -0,0 +1,29 @@
extends Node3D
class_name EffectBase
@export var life_time : float = 1
var life_time_now : float
var is_pause : bool = false
var rate : float
func _ready():
life_time_now = life_time
on_ready()
func _process(delta):
if is_pause:
return
life_time_now -= delta
if life_time_now <= 0:
queue_free()
return
rate = life_time_now / life_time
on_process(delta)
func set_pause(is_pause_set:bool):
is_pause = is_pause_set
on_set_pause(is_pause_set)
func on_ready():pass
func on_process(delta:float):pass
func on_set_pause(is_pause_set:bool):pass

@ -1,31 +1,33 @@
extends Node3D
extends EffectBase
class_name Particle
var life_time : float
var is_pause : bool = false
var particle_list : Array[GPUParticles3D]
var speed_scale_list = []
var decal_list = []
func _ready():
func on_ready():
for child in get_children():
if child is GPUParticles3D:
var particle = child as GPUParticles3D
particle_list.append(particle)
speed_scale_list.append(particle.speed_scale)
particle.restart()
elif child is ParticleDecal:
decal_list.append(child)
else:
continue
if child.lifetime > life_time_now:
life_time_now = child.lifetime
for particle : GPUParticles3D in particle_list:
if particle.lifetime > life_time:
life_time = particle.lifetime
particle.restart()
if particle.lifetime > life_time_now:
life_time_now = particle.lifetime
func _process(delta):
if is_pause:
return
life_time -= delta
if life_time <= 0:
queue_free()
func on_process(delta:float):
for decal : ParticleDecal in decal_list:
decal.on_process(delta)
func set_pause(is_pause_set:bool):
is_pause = is_pause_set
func on_set_pause(is_pause_set:bool):
for i in range(len(particle_list)):
var particle = particle_list[i]
var speed_scale = speed_scale_list[i]

@ -0,0 +1,30 @@
extends Decal
class_name ParticleDecal
@export var lifetime : float = 1
@export var gradient : Gradient
@export var scale_curve : Curve
@export var rotate : int
var lifetime_now : float
func on_process(delta:float):
lifetime_now += delta
var rate = lifetime_now / lifetime
if rate > 1:
return
#色带
if gradient:
modulate = gradient.sample(rate)
else:
modulate.a = 1 - rate
#缩放曲线
if scale_curve:
var scale_sample = scale_curve.sample(rate)
scale = Vector3(scale_sample,1,scale_sample)
#旋转
rotation_degrees.y = rotate * rate
Loading…
Cancel
Save