From 4326f3c5a2b100dd6a97dfb815961149ab21fda9 Mon Sep 17 00:00:00 2001 From: chendian <-> Date: Thu, 26 Sep 2024 02:26:41 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=AE=8B=E5=BD=B1=E7=89=B9=E6=95=88=20?= =?UTF-8?q?=E8=93=84=E5=8A=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- render/shader/after_image.gdshader | 2 ++ .../character/hero01_fist_skill02.aseprite | Bin 11207 -> 11580 bytes .../hero01_fist_skill_charging.tres | 23 ++++-------------- .../animation_library.tres | 2 +- scene/launcher.tscn | 2 +- script/character/skill.gd | 6 ++--- 6 files changed, 12 insertions(+), 23 deletions(-) diff --git a/render/shader/after_image.gdshader b/render/shader/after_image.gdshader index 0d3e263..12bb21d 100644 --- a/render/shader/after_image.gdshader +++ b/render/shader/after_image.gdshader @@ -7,6 +7,8 @@ uniform float alpha; void fragment() { vec4 col = texture(tex, UV); if(col.a<0.5){discard;} + //col.rgb = mix(vec3(0.0), col.rgb, alpha * 0.5); + col.rgb = mix(vec3(dot(vec3(1.0), col.rgb) * 0.33333), col.rgb, alpha); ALBEDO = col.rgb; ALPHA = alpha; } diff --git a/resource/animation/character/hero01_fist_skill02.aseprite b/resource/animation/character/hero01_fist_skill02.aseprite index ccc1c11ba450690f26b1772b559bf26adca3656e..0a60a1d1a634b6a91ee14438ab2101dd99ab761e 100644 GIT binary patch delta 94 zcmX>ez9)*^Mwfx%!BXjs?7Nv6xh5ZGR%YgA5S%Q?qQYV*#2~d^KDa!x+Xtjx^CATU{wMTNyskU?^@Ad4mE=KXx-oQzzX f%_a00fmDJ#ALC|j89inoF`aR;y`&mg@D48kYfltc diff --git a/resource/skill_animation/hero01_fist_skill_charging.tres b/resource/skill_animation/hero01_fist_skill_charging.tres index 853a208..3173a7f 100644 --- a/resource/skill_animation/hero01_fist_skill_charging.tres +++ b/resource/skill_animation/hero01_fist_skill_charging.tres @@ -4,7 +4,6 @@ [resource] resource_name = "hero01_fist_charging" -length = 0.9 step = 0.1 tracks/0/type = "value" tracks/0/imported = false @@ -37,7 +36,7 @@ tracks/2/path = NodePath("%Battle") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { -"times": PackedFloat32Array(0.2, 0.4, 0.6, 0.8), +"times": PackedFloat32Array(0.3, 0.5, 0.7, 0.9), "transitions": PackedFloat32Array(1, 1, 1, 1), "values": [{ "args": [], @@ -80,24 +79,12 @@ tracks/4/keys = { tracks/5/type = "value" tracks/5/imported = false tracks/5/enabled = true -tracks/5/path = NodePath("Status:skill_move_speed") +tracks/5/path = NodePath("View:frame") tracks/5/interp = 1 tracks/5/loop_wrap = true tracks/5/keys = { -"times": PackedFloat32Array(0, 0.1), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [1.0, 0.0] -} -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), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1), +"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] +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] } diff --git a/resource/skill_animation_library/animation_library.tres b/resource/skill_animation_library/animation_library.tres index 0d4337a..9152689 100644 --- a/resource/skill_animation_library/animation_library.tres +++ b/resource/skill_animation_library/animation_library.tres @@ -1,4 +1,4 @@ -[gd_resource type="AnimationLibrary" load_steps=47 format=3 uid="uid://croik07a1qko5"] +[gd_resource type="AnimationLibrary" load_steps=45 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://cfapnjkj5dkws" path="res://resource/skill_animation/hero01_basic_flash.tres" id="1_46f01"] diff --git a/scene/launcher.tscn b/scene/launcher.tscn index cbf61c5..852eece 100644 --- a/scene/launcher.tscn +++ b/scene/launcher.tscn @@ -223,7 +223,7 @@ double_sided = false alpha_cut = 2 texture_filter = 0 sprite_frames = ExtResource("21_fmv7o") -animation = &"fist_skill_charging02" +animation = &"fist_skill_charging" [node name="Throw" type="AnimatedSprite3D" parent="EditorTool/Character"] unique_name_in_owner = true diff --git a/script/character/skill.gd b/script/character/skill.gd index c7e85e6..efc7ba8 100644 --- a/script/character/skill.gd +++ b/script/character/skill.gd @@ -154,7 +154,7 @@ func on_attack_miss(): func on_hold() -> void: - _frame_back(0) + _frame_back(1) func on_check_ground(frame_offset: int) -> void: @@ -186,9 +186,9 @@ func _frame_back(frame_offset: int) -> void: if not current_animation: return var frame: int = int(current_animation_position / Setting.animation_frame_rate) - frame_offset - frame = frame if frame >= 0 else 0 + frame = max(0, frame) var frame_pos: float = frame * Setting.animation_frame_rate - seek(frame_pos- Setting.animation_frame_rate / 2, true, true) + seek(frame_pos, true, true) func on_cast_sub_character() -> void: