diff --git a/config/attack/blunt_heavy_dash_1.tres b/config/attack/blunt_heavy_dash_1.tres new file mode 100644 index 0000000..4863826 --- /dev/null +++ b/config/attack/blunt_heavy_dash_1.tres @@ -0,0 +1,22 @@ +[gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://dabkv6mk63mx8"] + +[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_q10v1"] + +[resource] +script = ExtResource("1_q10v1") +damage_rate = 0.5 +break_level = 1 +stun_attack = 10.0 +damage_type = 1 +is_floating = false +is_hit_down = false +is_rebound = false +is_stop_self = false +is_throw_check = false +is_throw_end = false +hit_back_speed = 6.0 +hit_up_speed = 1.0 +hit_back_duration = 0.1 +hit_up_duration = 0.05 +pause_time = 0.05 +is_force_pause = true diff --git a/config/attack/blunt_heavy_dash_2.tres b/config/attack/blunt_heavy_dash_2.tres new file mode 100644 index 0000000..b99bc1f --- /dev/null +++ b/config/attack/blunt_heavy_dash_2.tres @@ -0,0 +1,22 @@ +[gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://bgqotp7ayrjc1"] + +[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_a550s"] + +[resource] +script = ExtResource("1_a550s") +damage_rate = 0.5 +break_level = 2 +stun_attack = 10.0 +damage_type = 1 +is_floating = true +is_hit_down = false +is_rebound = false +is_stop_self = true +is_throw_check = false +is_throw_end = false +hit_back_speed = 8.0 +hit_up_speed = 2.0 +hit_back_duration = 0.1 +hit_up_duration = 0.05 +pause_time = 0.2 +is_force_pause = true diff --git a/config/attack/blunt_normal_hit.tres b/config/attack/blunt_normal_hit.tres index 2a79e90..adddc4f 100644 --- a/config/attack/blunt_normal_hit.tres +++ b/config/attack/blunt_normal_hit.tres @@ -12,6 +12,8 @@ is_floating = false is_hit_down = false is_rebound = false is_stop_self = true +is_throw_check = false +is_throw_end = false hit_back_speed = 2.0 hit_up_speed = 2.0 hit_back_duration = 0.05 diff --git a/config/attack/blunt_normal_hit_up.tres b/config/attack/blunt_normal_hit_up.tres index 7820b83..b4992cb 100644 --- a/config/attack/blunt_normal_hit_up.tres +++ b/config/attack/blunt_normal_hit_up.tres @@ -12,6 +12,8 @@ is_floating = true is_hit_down = false is_rebound = false 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.05 diff --git a/config/attack/blunt_starfall_1.tres b/config/attack/blunt_starfall_1.tres index 781a8d4..f38d323 100644 --- a/config/attack/blunt_starfall_1.tres +++ b/config/attack/blunt_starfall_1.tres @@ -11,7 +11,9 @@ damage_type = 1 is_floating = false is_hit_down = false is_rebound = false -is_stop_self = true +is_stop_self = false +is_throw_check = false +is_throw_end = false hit_back_speed = 2.0 hit_up_speed = 2.0 hit_back_duration = 0.05 diff --git a/config/attack/blunt_starfall_2.tres b/config/attack/blunt_starfall_2.tres index d057ef2..607571b 100644 --- a/config/attack/blunt_starfall_2.tres +++ b/config/attack/blunt_starfall_2.tres @@ -11,7 +11,9 @@ damage_type = 1 is_floating = true is_hit_down = false is_rebound = false -is_stop_self = true +is_stop_self = false +is_throw_check = false +is_throw_end = false hit_back_speed = 3.0 hit_up_speed = 3.0 hit_back_duration = 0.05 diff --git a/config/attack/sharp_heavy_hit_blow.tres b/config/attack/sharp_heavy_hit_blow.tres index 96bebe6..a3ddfec 100644 --- a/config/attack/sharp_heavy_hit_blow.tres +++ b/config/attack/sharp_heavy_hit_blow.tres @@ -12,6 +12,8 @@ is_floating = true is_hit_down = false is_rebound = false is_stop_self = true +is_throw_check = false +is_throw_end = false hit_back_speed = 10.0 hit_up_speed = 2.0 hit_back_duration = 0.05 diff --git a/config/attack/sharp_mid_hit_up.tres b/config/attack/sharp_mid_hit_up.tres index 9e4771d..c0d9f73 100644 --- a/config/attack/sharp_mid_hit_up.tres +++ b/config/attack/sharp_mid_hit_up.tres @@ -12,6 +12,8 @@ is_floating = true is_hit_down = false is_rebound = false 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 diff --git a/config/attack_box/box_large.tres b/config/attack_box/box_large.tres index 14cb85e..dc09f6e 100644 --- a/config/attack_box/box_large.tres +++ b/config/attack_box/box_large.tres @@ -9,3 +9,4 @@ size = Vector3(2, 2, 2) script = ExtResource("1_661yg") shape = SubResource("BoxShape3D_87jhu") offset = Vector2(1, 1) +is_throw = false diff --git a/config/attack_box/box_mid.tres b/config/attack_box/box_mid.tres index 888d60f..2346ee7 100644 --- a/config/attack_box/box_mid.tres +++ b/config/attack_box/box_mid.tres @@ -9,3 +9,4 @@ size = Vector3(1.6, 1.2, 1.2) script = ExtResource("1_hxvsy") shape = SubResource("BoxShape3D_87jhu") offset = Vector2(0.8, 0.6) +is_throw = false diff --git a/config/attack_box/box_normal.tres b/config/attack_box/box_normal.tres index 1afba74..1085de0 100644 --- a/config/attack_box/box_normal.tres +++ b/config/attack_box/box_normal.tres @@ -9,3 +9,4 @@ size = Vector3(1.6, 1.2, 1.2) script = ExtResource("1_d4mqn") shape = SubResource("BoxShape3D_87jhu") offset = Vector2(0.8, 0.6) +is_throw = false diff --git a/config/attack_box/box_small.tres b/config/attack_box/box_small.tres index a98b545..03924b7 100644 --- a/config/attack_box/box_small.tres +++ b/config/attack_box/box_small.tres @@ -9,3 +9,4 @@ size = Vector3(1.2, 0.8, 1) script = ExtResource("1_gmrbh") shape = SubResource("BoxShape3D_87jhu") offset = Vector2(0.6, 0.4) +is_throw = false diff --git a/config/attack_box/circle_mid.tres b/config/attack_box/circle_mid.tres index 0929152..ba0b55d 100644 --- a/config/attack_box/circle_mid.tres +++ b/config/attack_box/circle_mid.tres @@ -10,3 +10,4 @@ radius = 1.5 script = ExtResource("1_w2uwt") shape = SubResource("CylinderShape3D_pmh6g") offset = Vector2(0, 0) +is_throw = false diff --git a/config/attack_box/circle_normal.tres b/config/attack_box/circle_normal.tres index 36b4b7b..aca3a10 100644 --- a/config/attack_box/circle_normal.tres +++ b/config/attack_box/circle_normal.tres @@ -9,3 +9,4 @@ height = 1.0 script = ExtResource("1_8rhve") shape = SubResource("CylinderShape3D_pmh6g") offset = Vector2(0, 0) +is_throw = false diff --git a/config/character_mp/player.tres b/config/character_mp/player.tres index 196a1cc..f9ee126 100644 --- a/config/character_mp/player.tres +++ b/config/character_mp/player.tres @@ -10,3 +10,4 @@ recover_speed = -10.0 recover_cd = 2.0 add_rate_attack = 1.0 add_rate_hit = 1.0 +charging_speed = 50.0 diff --git a/config/skill_player_basic/hero01_basic_air_flash.tres b/config/skill_player_basic/hero01_basic_air_flash.tres index 33b5ed0..54c0e66 100644 --- a/config/skill_player_basic/hero01_basic_air_flash.tres +++ b/config/skill_player_basic/hero01_basic_air_flash.tres @@ -15,6 +15,8 @@ ignore_push = true stance_from = 101 stance_to = 10 break_level = 1 +is_charging = false +mp_cost = 0 refresh_animation = false sprite_frames = ExtResource("3_ciqr7") animation_name = "basic_air_flash" diff --git a/config/skill_player_basic/hero01_basic_flash.tres b/config/skill_player_basic/hero01_basic_flash.tres index 238c26e..7f240bc 100644 --- a/config/skill_player_basic/hero01_basic_flash.tres +++ b/config/skill_player_basic/hero01_basic_flash.tres @@ -15,6 +15,8 @@ ignore_push = true stance_from = 100 stance_to = 0 break_level = 1 +is_charging = false +mp_cost = 0 refresh_animation = false sprite_frames = ExtResource("3_i6jjr") animation_name = "basic_flash" diff --git a/config/skill_player_weapon/hero01_fist_air_attack01.tres b/config/skill_player_weapon/hero01_fist_air_attack01.tres index 43b9738..87e0788 100644 --- a/config/skill_player_weapon/hero01_fist_air_attack01.tres +++ b/config/skill_player_weapon/hero01_fist_air_attack01.tres @@ -21,6 +21,8 @@ attack1_box = ExtResource("2_ipoga") stance_from = 10 stance_to = 11 break_level = 3 +is_charging = false +mp_cost = 0 refresh_animation = false sprite_frames = ExtResource("5_7yyxp") animation_name = "fist_air_attack01" diff --git a/config/skill_player_weapon/hero01_fist_air_skill01.tres b/config/skill_player_weapon/hero01_fist_air_skill01.tres index b5c4bd2..e651b4c 100644 --- a/config/skill_player_weapon/hero01_fist_air_skill01.tres +++ b/config/skill_player_weapon/hero01_fist_air_skill01.tres @@ -1,9 +1,9 @@ [gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=8 format=3 uid="uid://dkxgra6y2u30l"] -[ext_resource type="Resource" uid="uid://dib6g7t6p5ac2" path="res://config/attack/blunt_normal_hit.tres" id="1_5njeh"] +[ext_resource type="Resource" uid="uid://by6jd5xqjml2m" path="res://config/attack/blunt_starfall_1.tres" id="1_dfu42"] [ext_resource type="Resource" uid="uid://57sukcw6ewqo" path="res://config/attack_box/circle_normal.tres" id="2_cvjvy"] [ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="2_mje6b"] -[ext_resource type="Resource" uid="uid://ctbdt77yyubxn" path="res://config/attack/blunt_normal_hit_up.tres" id="3_1yg3a"] +[ext_resource type="Resource" uid="uid://d26ok8as50xe5" path="res://config/attack/blunt_starfall_2.tres" id="3_m2yio"] [ext_resource type="Animation" uid="uid://dxgqn5fa7aokj" path="res://resource/skill_animation/hero01_fist_air_skill01.tres" id="3_q461t"] [ext_resource type="Resource" uid="uid://decgfcx2xsj8i" path="res://config/attack_box/circle_mid.tres" id="4_lpsn0"] [ext_resource type="Resource" uid="uid://c6alg8pmqfdxm" path="res://config/weapon/fist.tres" id="5_70pp4"] @@ -17,12 +17,14 @@ skill_animation = ExtResource("3_q461t") range = 0.0 free_lock = false ignore_push = true -attack1 = ExtResource("1_5njeh") +attack1 = ExtResource("1_dfu42") attack1_box = ExtResource("2_cvjvy") -attack2 = ExtResource("3_1yg3a") +attack2 = ExtResource("3_m2yio") attack2_box = ExtResource("4_lpsn0") stance_from = 10 stance_to = 0 break_level = 3 +is_charging = false +mp_cost = 0 refresh_animation = false animation_name = "" diff --git a/config/skill_player_weapon/hero01_fist_attack04.tres b/config/skill_player_weapon/hero01_fist_attack04.tres index 8a24232..c069056 100644 --- a/config/skill_player_weapon/hero01_fist_attack04.tres +++ b/config/skill_player_weapon/hero01_fist_attack04.tres @@ -1,7 +1,8 @@ -[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=5 format=3 uid="uid://b4aysymwqtvtd"] +[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=6 format=3 uid="uid://b4aysymwqtvtd"] [ext_resource type="Resource" uid="uid://duu05cr8gk5v4" path="res://config/attack/blunt_mid_hit_blow.tres" id="1_s12sc"] [ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="2_mhuew"] +[ext_resource type="Resource" uid="uid://diedb7vw7eyxp" path="res://config/attack_box/box_mid.tres" id="2_ur730"] [ext_resource type="Animation" uid="uid://6u3dhxly760l" path="res://resource/skill_animation/hero01_fist_attack04.tres" id="3_bst70"] [ext_resource type="Resource" uid="uid://c6alg8pmqfdxm" path="res://config/weapon/fist.tres" id="5_gn3tt"] @@ -15,8 +16,11 @@ range = 0.0 free_lock = false ignore_push = false attack1 = ExtResource("1_s12sc") +attack1_box = ExtResource("2_ur730") stance_from = 3 stance_to = 4 break_level = 3 +is_charging = false +mp_cost = 0 refresh_animation = false animation_name = "" diff --git a/config/skill_player_weapon/hero01_fist_skill_charging.tres b/config/skill_player_weapon/hero01_fist_skill_charging.tres new file mode 100644 index 0000000..c2024a8 --- /dev/null +++ b/config/skill_player_weapon/hero01_fist_skill_charging.tres @@ -0,0 +1,28 @@ +[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=7 format=3 uid="uid://ddao8mcrle2f8"] + +[ext_resource type="Resource" uid="uid://dib6g7t6p5ac2" path="res://config/attack/blunt_normal_hit.tres" id="1_ky7rf"] +[ext_resource type="Resource" uid="uid://bqejjllfy03h3" path="res://config/attack_box/box_normal.tres" id="2_f0wco"] +[ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="3_w4gtt"] +[ext_resource type="Animation" uid="uid://cpjdw0tugv0rc" path="res://resource/skill_animation/hero01_fist_skill_charging.tres" id="4_od8hj"] +[ext_resource type="SpriteFrames" uid="uid://bvnjq6vtioip" path="res://resource/animation/character/hero01_fist_skill02.aseprite" id="5_vubp6"] +[ext_resource type="Resource" uid="uid://c6alg8pmqfdxm" path="res://config/weapon/fist.tres" id="6_g4asv"] + +[resource] +script = ExtResource("3_w4gtt") +weapon = ExtResource("6_g4asv") +action = "attack_heavy" +name = "" +skill_animation = ExtResource("4_od8hj") +range = 0.0 +free_lock = false +ignore_push = false +attack1 = ExtResource("1_ky7rf") +attack1_box = ExtResource("2_f0wco") +stance_from = 0 +stance_to = 20 +break_level = 3 +is_charging = true +mp_cost = 0 +refresh_animation = false +sprite_frames = ExtResource("5_vubp6") +animation_name = "fist_skill_charging" diff --git a/config/skill_player_weapon/hero01_fist_skill_charging01.tres b/config/skill_player_weapon/hero01_fist_skill_charging01.tres new file mode 100644 index 0000000..2c0de5a --- /dev/null +++ b/config/skill_player_weapon/hero01_fist_skill_charging01.tres @@ -0,0 +1,28 @@ +[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=7 format=3 uid="uid://dluhxw6id315f"] + +[ext_resource type="Resource" uid="uid://c87w2x5qfqdns" path="res://config/attack/blunt_normal_hit_back.tres" id="1_58od0"] +[ext_resource type="Resource" uid="uid://dja8jwx16njmf" path="res://config/attack_box/box_small.tres" id="2_g13qo"] +[ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="3_2ac48"] +[ext_resource type="Animation" uid="uid://b0a1nnw2e13sg" path="res://resource/skill_animation/hero01_fist_skill_charging01.tres" id="4_5jjbu"] +[ext_resource type="SpriteFrames" uid="uid://bvnjq6vtioip" path="res://resource/animation/character/hero01_fist_skill02.aseprite" id="5_dqml8"] +[ext_resource type="Resource" uid="uid://c6alg8pmqfdxm" path="res://config/weapon/fist.tres" id="6_cdc0k"] + +[resource] +script = ExtResource("3_2ac48") +weapon = ExtResource("6_cdc0k") +action = "none" +name = "" +skill_animation = ExtResource("4_5jjbu") +range = 0.0 +free_lock = false +ignore_push = false +attack1 = ExtResource("1_58od0") +attack1_box = ExtResource("2_g13qo") +stance_from = 99 +stance_to = 2 +break_level = 3 +is_charging = false +mp_cost = 0 +refresh_animation = false +sprite_frames = ExtResource("5_dqml8") +animation_name = "fist_skill_charging01" diff --git a/config/skill_player_weapon/hero01_fist_skill_charging02.tres b/config/skill_player_weapon/hero01_fist_skill_charging02.tres new file mode 100644 index 0000000..26e8a86 --- /dev/null +++ b/config/skill_player_weapon/hero01_fist_skill_charging02.tres @@ -0,0 +1,31 @@ +[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=8 format=3 uid="uid://bte5vxx66f3er"] + +[ext_resource type="Resource" uid="uid://dabkv6mk63mx8" path="res://config/attack/blunt_heavy_dash_1.tres" id="1_vjxka"] +[ext_resource type="Resource" uid="uid://dja8jwx16njmf" path="res://config/attack_box/box_small.tres" id="2_j2c3s"] +[ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="3_qfj4h"] +[ext_resource type="Resource" uid="uid://bgqotp7ayrjc1" path="res://config/attack/blunt_heavy_dash_2.tres" id="3_ymalh"] +[ext_resource type="Animation" uid="uid://b0a1nnw2e13sg" path="res://resource/skill_animation/hero01_fist_skill_charging01.tres" id="4_nuqat"] +[ext_resource type="SpriteFrames" uid="uid://bvnjq6vtioip" path="res://resource/animation/character/hero01_fist_skill02.aseprite" id="5_cqeqk"] +[ext_resource type="Resource" uid="uid://c6alg8pmqfdxm" path="res://config/weapon/fist.tres" id="6_cbvvk"] + +[resource] +script = ExtResource("3_qfj4h") +weapon = ExtResource("6_cbvvk") +action = "none" +name = "" +skill_animation = ExtResource("4_nuqat") +range = 0.0 +free_lock = false +ignore_push = false +attack1 = ExtResource("1_vjxka") +attack1_box = ExtResource("2_j2c3s") +attack2 = ExtResource("3_ymalh") +attack2_box = ExtResource("2_j2c3s") +stance_from = 99 +stance_to = 2 +break_level = 3 +is_charging = false +mp_cost = 1 +refresh_animation = false +sprite_frames = ExtResource("5_cqeqk") +animation_name = "fist_skill_charging01" diff --git a/config/skill_player_weapon/hero01_long_air_attack03.tres b/config/skill_player_weapon/hero01_long_air_attack03.tres index e058f81..71b33b3 100644 --- a/config/skill_player_weapon/hero01_long_air_attack03.tres +++ b/config/skill_player_weapon/hero01_long_air_attack03.tres @@ -18,5 +18,7 @@ attack1 = ExtResource("1_5rgpl") stance_from = 12 stance_to = 10 break_level = 3 +is_charging = false +mp_cost = 0 refresh_animation = false animation_name = "" diff --git a/resource/animation/character/hero01_fist_attack.aseprite b/resource/animation/character/hero01_fist_attack.aseprite index 92c8c79..b017feb 100644 Binary files a/resource/animation/character/hero01_fist_attack.aseprite and b/resource/animation/character/hero01_fist_attack.aseprite differ diff --git a/resource/animation/character/hero01_fist_attack.png b/resource/animation/character/hero01_fist_attack.png index d48b0b0..719171d 100644 Binary files a/resource/animation/character/hero01_fist_attack.png and b/resource/animation/character/hero01_fist_attack.png differ diff --git a/resource/animation/character/hero01_fist_skill02.aseprite b/resource/animation/character/hero01_fist_skill02.aseprite new file mode 100644 index 0000000..ccc1c11 Binary files /dev/null and b/resource/animation/character/hero01_fist_skill02.aseprite differ diff --git a/resource/animation/character/hero01_fist_skill02.aseprite.import b/resource/animation/character/hero01_fist_skill02.aseprite.import new file mode 100644 index 0000000..5f80492 --- /dev/null +++ b/resource/animation/character/hero01_fist_skill02.aseprite.import @@ -0,0 +1,25 @@ +[remap] + +importer="Aseprite SpriteFrames Import" +type="SpriteFrames" +uid="uid://bvnjq6vtioip" +path="res://.godot/imported/hero01_fist_skill02.aseprite-4bb30d5efb90538d9e36d3bc8790bcf8.res" + +[deps] + +source_file="res://resource/animation/character/hero01_fist_skill02.aseprite" +dest_files=["res://.godot/imported/hero01_fist_skill02.aseprite-4bb30d5efb90538d9e36d3bc8790bcf8.res"] + +[params] + +spritesheet/layout=0 +spritesheet/fixed_rows_count=1 +spritesheet/fixed_columns_count=1 +spritesheet/border_type=0 +spritesheet/trim=false +spritesheet/ignore_empty=false +spritesheet/merge_duplicates=false +animation/default/name="default" +animation/default/direction=0 +animation/default/repeat_count=0 +animation/autoplay="" diff --git a/resource/animation/character/hero01_fist_skill02.png b/resource/animation/character/hero01_fist_skill02.png new file mode 100644 index 0000000..47757d0 Binary files /dev/null and b/resource/animation/character/hero01_fist_skill02.png differ diff --git a/resource/animation/character/hero01_fist_skill02.png.import b/resource/animation/character/hero01_fist_skill02.png.import new file mode 100644 index 0000000..302d93e --- /dev/null +++ b/resource/animation/character/hero01_fist_skill02.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://hbjquxosxr6m" +path.s3tc="res://.godot/imported/hero01_fist_skill02.png-638045339be15fe119ff828d17af30da.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://resource/animation/character/hero01_fist_skill02.png" +dest_files=["res://.godot/imported/hero01_fist_skill02.png-638045339be15fe119ff828d17af30da.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +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/resource/skill_animation/hero01_fist_skill02.tres b/resource/skill_animation/hero01_fist_skill02.tres index 0990369..9ac2628 100644 --- a/resource/skill_animation/hero01_fist_skill02.tres +++ b/resource/skill_animation/hero01_fist_skill02.tres @@ -86,7 +86,7 @@ tracks/7/path = NodePath("Status:break_level") tracks/7/interp = 1 tracks/7/loop_wrap = true tracks/7/keys = { -"times": PackedFloat32Array(0, 0.5, 0.7), +"times": PackedFloat32Array(0, 0.6, 0.8), "transitions": PackedFloat32Array(1, 1, 1), "update": 1, "values": [0, 3, 4] diff --git a/resource/skill_animation/hero01_fist_skill_charging.tres b/resource/skill_animation/hero01_fist_skill_charging.tres new file mode 100644 index 0000000..853a208 --- /dev/null +++ b/resource/skill_animation/hero01_fist_skill_charging.tres @@ -0,0 +1,103 @@ +[gd_resource type="Animation" load_steps=2 format=3 uid="uid://cpjdw0tugv0rc"] + +[ext_resource type="SpriteFrames" uid="uid://bvnjq6vtioip" path="res://resource/animation/character/hero01_fist_skill02.aseprite" id="1_u677e"] + +[resource] +resource_name = "hero01_fist_charging" +length = 0.9 +step = 0.1 +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_u677e")] +} +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_skill_charging"] +} +tracks/2/type = "method" +tracks/2/imported = false +tracks/2/enabled = true +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), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"values": [{ +"args": [], +"method": &"check_charging1" +}, { +"args": [], +"method": &"check_charging2" +}, { +"args": [], +"method": &"check_charging3" +}, { +"args": [], +"method": &"hold" +}] +} +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), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [3] +} +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, 0.7), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"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, 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), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8] +} diff --git a/resource/skill_animation/hero01_fist_skill_charging01.tres b/resource/skill_animation/hero01_fist_skill_charging01.tres new file mode 100644 index 0000000..0360d5a --- /dev/null +++ b/resource/skill_animation/hero01_fist_skill_charging01.tres @@ -0,0 +1,108 @@ +[gd_resource type="Animation" load_steps=2 format=3 uid="uid://b0a1nnw2e13sg"] + +[ext_resource type="SpriteFrames" uid="uid://bvnjq6vtioip" path="res://resource/animation/character/hero01_fist_skill02.aseprite" id="1_hdywk"] + +[resource] +resource_name = "hero01_fist_skill_charging01" +length = 0.7 +step = 0.1 +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_hdywk")] +} +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_skill_charging01"] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Status:break_level") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.4, 0.6), +"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:speed_up_rate") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0.1, 0.2), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [-0.5, -1.0] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +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), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [2.0, 0.0] +} +tracks/5/type = "method" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("Battle") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0.2), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"attack1" +}] +} +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.1), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"cast_attack_particle1" +}] +} +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), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6] +} diff --git a/resource/skill_animation/hero01_fist_skill_charging02.tres b/resource/skill_animation/hero01_fist_skill_charging02.tres new file mode 100644 index 0000000..0f2b862 --- /dev/null +++ b/resource/skill_animation/hero01_fist_skill_charging02.tres @@ -0,0 +1,151 @@ +[gd_resource type="Animation" load_steps=2 format=3 uid="uid://bbq4e0a0eyrke"] + +[ext_resource type="SpriteFrames" uid="uid://bvnjq6vtioip" path="res://resource/animation/character/hero01_fist_skill02.aseprite" id="1_0pidd"] + +[resource] +resource_name = "hero01_fist_skill_charging02" +length = 0.9 +step = 0.1 +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_0pidd")] +} +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_skill_charging02"] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Status:break_level") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.5, 0.7), +"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:speed_up_rate") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0, 0.2), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [-0.5, -1.0] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +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), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [8.0, 0.0] +} +tracks/5/type = "method" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("Battle") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 1.1), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"values": [{ +"args": [], +"method": &"attack1" +}, { +"args": [], +"method": &"attack1" +}, { +"args": [], +"method": &"attack2" +}, { +"args": [], +"method": &"attack1" +}] +} +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), +"transitions": PackedFloat32Array(1, 1, 1), +"values": [{ +"args": [], +"method": &"cast_after_image" +}, { +"args": [], +"method": &"cast_after_image" +}, { +"args": [], +"method": &"cast_after_image" +}] +} +tracks/7/type = "method" +tracks/7/imported = false +tracks/7/enabled = true +tracks/7/path = NodePath("Effect") +tracks/7/interp = 1 +tracks/7/loop_wrap = true +tracks/7/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"cast_attack_particle1" +}] +} +tracks/8/type = "method" +tracks/8/imported = false +tracks/8/enabled = true +tracks/8/path = NodePath("Battle") +tracks/8/interp = 1 +tracks/8/loop_wrap = true +tracks/8/keys = { +"times": PackedFloat32Array(0.3), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"stop" +}] +} +tracks/9/type = "value" +tracks/9/imported = false +tracks/9/enabled = true +tracks/9/path = NodePath("View:frame") +tracks/9/interp = 1 +tracks/9/loop_wrap = true +tracks/9/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] +} diff --git a/resource/skill_animation_library/animation_library.tres b/resource/skill_animation_library/animation_library.tres index 5e2aa83..8a5d4e2 100644 --- a/resource/skill_animation_library/animation_library.tres +++ b/resource/skill_animation_library/animation_library.tres @@ -1,8 +1,9 @@ -[gd_resource type="AnimationLibrary" load_steps=42 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"] [ext_resource type="Animation" uid="uid://p8l0puqxrkwh" path="res://resource/skill_animation/hero01_long_air_attack01.tres" id="1_b46g3"] +[ext_resource type="Animation" uid="uid://cpjdw0tugv0rc" path="res://resource/skill_animation/hero01_fist_skill_charging.tres" id="1_nd54y"] [ext_resource type="Animation" uid="uid://73awn8b7c63v" path="res://resource/skill_animation/hero01_basic_air_flash.tres" id="1_np5aa"] [ext_resource type="Animation" uid="uid://daopmieibx3b7" path="res://resource/skill_animation/hero01_long_attack01.tres" id="1_nwjtl"] [ext_resource type="Animation" uid="uid://dokxns0q44rux" path="res://resource/skill_animation/hero01_common_skill0101.tres" id="1_vt4qf"] @@ -39,6 +40,8 @@ [ext_resource type="Animation" uid="uid://batvpnk7jfc2a" path="res://resource/skill_animation/hero01_fist_skill02.tres" id="20_dv6vj"] [ext_resource type="Animation" uid="uid://cj0lnanjp7xfo" path="res://resource/skill_animation/hero01_fist_skill01.tres" id="20_xaont"] [ext_resource type="Animation" uid="uid://cjc6sis2xn1yy" path="res://resource/skill_animation/hero01_long_air_skill02.tres" id="21_ks43l"] +[ext_resource type="Animation" uid="uid://b0a1nnw2e13sg" path="res://resource/skill_animation/hero01_fist_skill_charging01.tres" id="23_12bpf"] +[ext_resource type="Animation" uid="uid://bbq4e0a0eyrke" path="res://resource/skill_animation/hero01_fist_skill_charging02.tres" id="24_j0oqq"] [ext_resource type="Animation" uid="uid://h8hm3kbecdx8" path="res://resource/skill_animation/hero01_remote01.tres" id="33_7i37k"] [ext_resource type="Animation" uid="uid://q7qlw0a7hfjt" path="res://resource/skill_animation/hero01_slash01.tres" id="38_lyels"] @@ -63,8 +66,12 @@ _data = { "hero01_fist_attack03": ExtResource("3_lo6yb"), "hero01_fist_attack04": ExtResource("4_087em"), "hero01_fist_attack05": ExtResource("2_y7w3h"), +"hero01_fist_charging": ExtResource("1_nd54y"), "hero01_fist_skill01": ExtResource("20_xaont"), "hero01_fist_skill02": ExtResource("20_dv6vj"), +"hero01_fist_skill_charging": ExtResource("1_nd54y"), +"hero01_fist_skill_charging01": ExtResource("23_12bpf"), +"hero01_fist_skill_charging02": ExtResource("24_j0oqq"), "hero01_flash": ExtResource("16_ctotk"), "hero01_long_air_attack01": ExtResource("1_b46g3"), "hero01_long_air_attack02": ExtResource("2_8wtap"), diff --git a/scene/ai/bullet02.tscn b/scene/ai/bullet02.tscn index cd2ec15..e1ecebf 100644 --- a/scene/ai/bullet02.tscn +++ b/scene/ai/bullet02.tscn @@ -8,7 +8,7 @@ [node name="BeehaveTree" type="Node" node_paths=PackedStringArray("blackboard")] script = ExtResource("1_go1b5") -blackboard = NodePath("@Node@19221") +blackboard = NodePath("@Node@19481") [node name="SequenceComposite" type="Node" parent="."] script = ExtResource("2_k8nph") diff --git a/scene/effect/particle/hero01_fist_skill_charging02.tscn b/scene/effect/particle/hero01_fist_skill_charging02.tscn new file mode 100644 index 0000000..b2ff7f0 --- /dev/null +++ b/scene/effect/particle/hero01_fist_skill_charging02.tscn @@ -0,0 +1,5 @@ +[gd_scene load_steps=2 format=3 uid="uid://b7w4fyjsxni7v"] + +[ext_resource type="PackedScene" uid="uid://cxopc3y11lwg1" path="res://scene/effect/particle/_particle_dash1.tscn" id="1_v05rj"] + +[node name="Particle" instance=ExtResource("1_v05rj")] diff --git a/scene/launcher.tscn b/scene/launcher.tscn index f543ef0..c77796a 100644 --- a/scene/launcher.tscn +++ b/scene/launcher.tscn @@ -18,7 +18,7 @@ [ext_resource type="PackedScene" uid="uid://0uonhojhfgi" path="res://scene/ui/menu_screen.tscn" id="10_sky2n"] [ext_resource type="Script" path="res://script/manager/input_manager.gd" id="12_vfqm4"] [ext_resource type="Script" path="res://script/character/status.gd" id="18_nr8sb"] -[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="19_ocnwn"] +[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="19_ds2c6"] [ext_resource type="SpriteFrames" uid="uid://2cb8lknel0ih" path="res://resource/animation/character/basic_move.aseprite" id="20_4ni1a"] [ext_resource type="AnimationLibrary" uid="uid://croik07a1qko5" path="res://resource/skill_animation_library/animation_library.tres" id="22_qyapv"] [ext_resource type="Script" path="res://script/character/skill.gd" id="23_783eu"] @@ -100,6 +100,18 @@ tracks/4/keys = { "update": 1, "values": [0] } +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("Status:speed_up_rate") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [-1.0] +} [sub_resource type="AnimationLibrary" id="AnimationLibrary_avnjy"] _data = { @@ -190,13 +202,13 @@ pixel_size = 0.02 double_sided = false alpha_cut = 2 texture_filter = 0 -sprite_frames = ExtResource("19_ocnwn") -animation = &"fist_skill02" -frame = 9 +sprite_frames = ExtResource("19_ds2c6") +animation = &"fist_air_skill01" +frame = 8 [node name="Throw" type="AnimatedSprite3D" parent="EditorTool/Character"] unique_name_in_owner = true -transform = Transform3D(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +transform = Transform3D(-1, 0, 0, 0, -1, 1.50996e-07, 0, -1.50996e-07, -1, 0, 0, 0) pixel_size = 0.02 sprite_frames = ExtResource("20_4ni1a") animation = &"idle_loop" diff --git a/script/_global/enum.gd b/script/_global/enum.gd index 760386e..cc0b296 100644 --- a/script/_global/enum.gd +++ b/script/_global/enum.gd @@ -8,6 +8,7 @@ enum ETeam {Player, Monster} enum EStance { GroundIdle, Ground1, Ground2, Ground3, Ground4, Ground5, Ground6, Ground7, AirIdle = 10, Air1, Air2, Air3, + Charging = 20, None = 99, GroundAny = 100, AirAny = 101, diff --git a/script/character/battle.gd b/script/character/battle.gd index fcda041..58ae54a 100644 --- a/script/character/battle.gd +++ b/script/character/battle.gd @@ -155,12 +155,8 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul #mp累加 if not is_remote: - character_from.add_mp(damage * cfg_from.mp.add_rate_attack) - character_from.remove_buff("mp_recover") - character_from.add_buff("mp_recover_cd", status.cfg.mp.recover_cd) - character_to.add_mp(damage * cfg_to.mp.add_rate_hit) - character_to.remove_buff("mp_recover") - character_to.add_buff("mp_recover_cd", status.cfg.mp.recover_cd) + character_from.add_mp_sub(damage * cfg_from.mp.add_rate_attack, true) + character_to.add_mp_sub(damage * cfg_to.mp.add_rate_hit, true) #投技检测 if attack.is_throw_check and not character_to.get_status("is_be_throw") and status.throw_target == 0: @@ -255,46 +251,76 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul return hit_result -func add_mp(value: float): +func add_mp_sub(value: float, from_battle: bool): var mp = character.get_status("mp") var mp_max = character.get_status("mp_max") var mp_sub = character.get_status("mp_sub") var mp_sub_max = character.get_status("mp_sub_max") + value = min(mp_sub_max-mp_sub, value) - if value == mp_sub_max-mp_sub: - var mp_add = min(mp_max-mp, 1) - if mp_add > 0: - character.set_status("mp", mp+mp_add) - character.set_status("mp_sub", 0) - else: + var mp_sub_full = value == mp_sub_max-mp_sub + var mp_full = mp == mp_max + if mp_sub_full: + #mp_sub已满 + if mp_full: + #mp已满 character.set_status("mp_sub", mp_sub_max) character.remove_buff("mp_recover_cd") character.remove_buff("mp_recover") + else: + #mp未满 + character.set_status("mp", mp+1) + character.set_status("mp_sub", 0) else: character.set_status("mp_sub", mp_sub+value) + if from_battle: + character.remove_buff("mp_recover") + character.add_buff("mp_recover_cd", status.cfg.mp.recover_cd) + + +func cost_mp(value: int): + var mp = character.get_status("mp") + var mp_max = character.get_status("mp_max") + var mp_new = mp-value + mp_new = min(mp_new, mp_max) + mp_new = max(mp_new, 0) + character.set_status("mp", mp_new) + character.remove_buff("mp_recover") + character.add_buff("mp_recover_cd", status.cfg.mp.recover_cd) + + +func check_ground(): skill.on_check_ground(0) + + +func check_ground1(): skill.on_check_ground(1) + -func check_ground(): - skill.on_check_ground(0) +func check_ground2(): skill.on_check_ground(2) -func check_ground1(): - skill.on_check_ground(1) +func check_charging1(): skill.on_check_charging(1) -func check_ground2(): - skill.on_check_ground(2) +func check_charging2(): skill.on_check_charging(2) -func cast_sub_character(): - skill.on_cast_sub_character() +func check_charging3(): skill.on_check_charging(3) + + +func cast_sub_character(): skill.on_cast_sub_character() + + +func hold(): skill.on_hold() func stop(): move.stop() -func on_attack_hit(hit_result: HitResult): +func on_attack_hit(hit_result: HitResult) -> void: + if not status.skill_cfg: + return var skill_name: String = status.skill_cfg.get_res_name() if hit_result.is_hit: on_attack_hit_trigger(skill_name, "hit") @@ -308,7 +334,19 @@ func on_attack_hit_trigger(skill_name: String, trigger_name: String) -> void: call(func_name) +func on_skill_release_trigger(skill_name: String) -> void: + var func_name: String = "on_%s_release" % skill_name + if has_method(func_name): + call(func_name) + + func on_hero01_fist_skill01_break(): var target: int = status.throw_target skill.cast_skill_by_name("hero01_fist_skill02", status.move_dir) status.throw_target = target + + +func on_hero01_fist_skill_charging_release(): + match status.charging_level: + 0: skill.cast_skill_by_name("hero01_fist_skill_charging01", status.move_dir) + _: skill.cast_skill_by_name("hero01_fist_skill_charging02", status.move_dir) diff --git a/script/character/buff.gd b/script/character/buff.gd index 29b7723..6741816 100644 --- a/script/character/buff.gd +++ b/script/character/buff.gd @@ -147,16 +147,12 @@ func on_end_mp_recover_cd(rate)->void: add_buff("mp_recover", -1) func on_update_mp_recover(rate)->void: var mp_add: float = get_process_delta_time() * status.cfg.mp.recover_speed - if mp_add == 0: - remove_buff("mp_recover") - elif mp_add > 0: - mp_add = min(status.mp_sub_max - status.mp_sub, mp_add) - character.add_mp(mp_add) - elif mp_add < 0: - mp_add = max(-status.mp_sub, mp_add) - if mp_add == 0: - remove_buff("mp_recoveres://config/attack/rebound.tres") - character.set_status("mp_sub", status.mp_sub+mp_add) + character.add_mp_sub(mp_add, false) + + +func on_update_charging(rate)->void: + var mp_add: float = get_process_delta_time() * status.cfg.mp.charging_speed + character.add_mp_sub(mp_add, true) func on_end_stun_recover_break_cd(rate)->void: add_buff("stun_recover_break", -1) diff --git a/script/character/character.gd b/script/character/character.gd index 56fa205..a0fdcce 100644 --- a/script/character/character.gd +++ b/script/character/character.gd @@ -165,8 +165,12 @@ func show_hit_damage(value: float): SignalManager.character_hit_damage.emit(id(), value) -func add_mp(value: float): - battle.add_mp(value) +func add_mp_sub(value: float, from_battle: bool): + battle.add_mp_sub(value, from_battle) + + +func cost_mp(value: int): + battle.cost_mp(value) func set_target(target: int): diff --git a/script/character/player/combo.gd b/script/character/player/combo.gd index eb8bde2..6c85d12 100644 --- a/script/character/player/combo.gd +++ b/script/character/player/combo.gd @@ -6,13 +6,14 @@ class_name Combo @onready var skill: Skill = (%Skill as Skill) @onready var move: Move = (%Move as Move) @onready var core: Core = (%Core as Core) +@onready var battle: Battle = (%Battle as Battle) class InputData: var action: String var alive_time: float -var input_list: Array[Variant] = [] #指令缓存 +var input_list: Array[InputData] = [] #指令缓存 func _ready(): @@ -27,12 +28,26 @@ func _ready(): func _process(delta): update_input_alive(delta) + update_charging() update_break() update_move() +func update_charging() -> void: + if not status.is_charging: + return + var release_key: String = "%s_release" % status.skill_action_key + for i in range(0, len(input_list)): + var input: InputData = input_list[i] + if not input.action == release_key: + continue + refresh_input(i) + battle.on_skill_release_trigger(status.skill_cfg.get_res_name()) + break + + func update_input_alive(delta): - var input_list_new: Array[Variant] = [] + var input_list_new: Array[InputData] = [] for input in input_list: input.alive_time -= delta if input.alive_time > 0: @@ -61,8 +76,8 @@ func update_break_cancel() -> bool: func update_break_jump() -> bool: for i in range(0, len(input_list)): - var input = input_list[i] - if input.action == "jump" and not status.is_jumped: + var input: InputData = input_list[i] + if (input.action == "jump") and not status.is_jumped: refresh_input(i) skill.cancel_skill() move.jump() @@ -84,7 +99,7 @@ func update_break_walk() -> bool: func update_break_by_level(break_level: Enum.EBreakLevel) -> bool: for i in range(0, len(input_list)): - var input = input_list[i] + var input: InputData = input_list[i] if not input.action in skill.skill_map: continue for skill_cfg: SkillCfg in skill.skill_map[input.action]: @@ -104,7 +119,7 @@ func update_break_by_level(break_level: Enum.EBreakLevel) -> bool: if skill_cfg.weapon != status.weapon_list[status.weapon_index]: continue #施放技能 - skill.cast_skill(skill_cfg, status.input_dir) + skill.cast_skill(skill_cfg, status.input_dir, input.action) refresh_input(i) if true: return true diff --git a/script/character/player/player_input.gd b/script/character/player/player_input.gd index 599da6f..969dbe0 100644 --- a/script/character/player/player_input.gd +++ b/script/character/player/player_input.gd @@ -40,7 +40,8 @@ func on_input_action_released(action_name: String) -> void: Global.ui_mgr.input_action(action_name, false) if Global.is_control_pause: return - action.check_action(action_name, false) + if not action.check_action(action_name, false): + combo.add_input_action("%s_release" % action_name) return diff --git a/script/character/skill.gd b/script/character/skill.gd index 7c60902..adf2f1a 100644 --- a/script/character/skill.gd +++ b/script/character/skill.gd @@ -5,6 +5,7 @@ class_name Skill @onready var view: View = (%View as View) @onready var status: Status = (%Status as Status) @onready var effect: Effect = (%Effect as Effect) +@onready var buff: Buff = (%Buff as Buff) var skill_dict: Dictionary = {} #name -> skill var skill_map: Dictionary = {} #input -> skillCfg[] @@ -44,7 +45,7 @@ func cast_skill_by_name(name: String, cast_dir: Vector2): cast_skill(cfg, cast_dir) -func cast_skill(cfg: SkillCfg, cast_dir: Vector2): +func cast_skill(cfg: SkillCfg, cast_dir: Vector2, action_key: String = "") -> void: break_skill() if cast_dir.length() == 0: cast_dir = Vector2.RIGHT if status.is_right else Vector2.LEFT @@ -54,19 +55,30 @@ func cast_skill(cfg: SkillCfg, cast_dir: Vector2): cast_dir = character.pos2D().direction_to(target.pos2D()).normalized() var animation_name: String = "animation_library/%s" % cfg.get_res_name() - if has_animation(animation_name): - status.speed_up_rate = -1 - status.is_free_control = false - status.is_free_turn = false - status.is_skill_running = true - status.skill_cfg = cfg - status.skill_dir = cast_dir - status.break_level = Enum.EBreakLevel.None - status.stance = cfg.stance_to - if cast_dir.x != 0: status.is_right = cast_dir.x > 0 - play(animation_name, -1, Setting.animation_speed_scale) - else: + if not has_animation(animation_name): print("技能animation不存在", animation_name) + return + + if status.mp < cfg.mp_cost: + #todo mp不足 + print("mp不足") + return + + character.cost_mp(cfg.mp_cost) + status.speed_up_rate = -1 + status.is_free_control = false + status.is_free_turn = false + status.is_skill_running = true + status.skill_cfg = cfg + status.skill_dir = cast_dir + status.break_level = Enum.EBreakLevel.None + status.stance = cfg.stance_to + status.is_charging = cfg.is_charging + status.skill_action_key = action_key + if cfg.is_charging: + buff.add_buff("charging", -1) + if cast_dir.x != 0: status.is_right = cast_dir.x > 0 + play(animation_name, -1, Setting.animation_speed_scale) func break_skill(): @@ -82,6 +94,10 @@ func break_skill(): status.speed_down_push_rate = 0 status.skill_move_stop = false status.is_speed_y_freeze = false + status.is_charging = false + status.charging_level = 0 + status.skill_action_key = "" + buff.remove_buff("charging") if status.throw_target != 0: var character_to: Character = Global.character_mgr.get_character(status.throw_target) character_to.set_status("is_be_throw", false) @@ -96,19 +112,41 @@ func cancel_skill(): func on_attack_miss(): # 攻击未命中时跳帧 - advance(Setting.animation_frame_rate) + _frame_forward() + + +func on_hold() -> void: + _frame_back(0) func on_check_ground(frame_offset: int) -> void: if status.is_on_floor: # 落地检测成功时跳帧 - advance(Setting.animation_frame_rate) + _frame_forward() else: - # 落地检测失败时回退半帧 - var frame: int = int(current_animation_position / Setting.animation_frame_rate) - frame_offset - frame = frame if frame >= 0 else 0 - var frame_pos: float = frame * Setting.animation_frame_rate - seek(frame_pos- Setting.animation_frame_rate / 2, true, true) + _frame_back(frame_offset) + + +func on_check_charging(charging_level: int) -> void: + if status.charging_level >= charging_level: + _frame_forward() + return + if status.mp >= charging_level: + status.charging_level += 1 + _frame_forward() + return + _frame_back(1) + + +func _frame_forward() -> void: + advance(Setting.animation_frame_rate) + + +func _frame_back(frame_offset: int) -> void: + var frame: int = int(current_animation_position / Setting.animation_frame_rate) - frame_offset + frame = frame if frame >= 0 else 0 + var frame_pos: float = frame * Setting.animation_frame_rate + seek(frame_pos- Setting.animation_frame_rate / 2, true, true) func on_cast_sub_character() -> void: diff --git a/script/character/status.gd b/script/character/status.gd index b5c12cb..afabcd1 100644 --- a/script/character/status.gd +++ b/script/character/status.gd @@ -64,6 +64,7 @@ class_name Status @export var skill_move_speed: float #技能位移速度 @export var skill_move_stop: bool #技能位移速度是否停止生效 @export var skill_float_speed: float #技能y位移速度 +@export var skill_action_key: String #技能输入指令 @export_category("玩家技能状态") @export var input_dir: Vector2 #指令方向 @export var stance: Enum.EStance #技能姿态 @@ -75,6 +76,8 @@ class_name Status @export var core_active_list: Array[Variant] = [] #主动核心列表 8个 @export var core_passive_list: Array[Variant] = [] #被动核心列表 @export var is_switch: bool #是否切换到核心释放模式 +@export var is_charging: bool #是否蓄力 +@export var charging_level: int #蓄力等级 @export_category("动画触发器") @export var trigger_jump: bool #跳跃 @export var trigger_hit: bool #受击-地面-轻 diff --git a/script/config/mp_cfg.gd b/script/config/mp_cfg.gd index 85ec18d..30c4b24 100644 --- a/script/config/mp_cfg.gd +++ b/script/config/mp_cfg.gd @@ -7,3 +7,4 @@ class_name MpCfg @export var recover_cd: float = 2 #次级mp恢复延迟 @export var add_rate_attack: float = 1 #次级mp攻击时增加系数 @export var add_rate_hit: float = 1 #次级mp受击时增加系数 +@export var charging_speed: float = 10 #次级mp蓄力速度 diff --git a/script/config/skill_cfg.gd b/script/config/skill_cfg.gd index cb1207e..4a93725 100644 --- a/script/config/skill_cfg.gd +++ b/script/config/skill_cfg.gd @@ -15,6 +15,8 @@ class_name SkillCfg @export var stance_from: Enum.EStance = Enum.EStance.GroundAny @export var stance_to: Enum.EStance @export var break_level: Enum.EBreakLevel = Enum.EBreakLevel.Break +@export var is_charging: bool +@export var mp_cost: int @export var refresh_animation: bool: get: return false