From fd1688efa056860face1d2399efc1036de5da504 Mon Sep 17 00:00:00 2001 From: chendian <-> Date: Sat, 8 Mar 2025 06:19:36 +0800 Subject: [PATCH] =?UTF-8?q?buff=E4=BC=98=E5=8C=96=E3=80=81=E5=8F=8D?= =?UTF-8?q?=E5=BC=B9=E5=8F=96=E6=B6=88aoe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/attack/blunt_heavy_dash_1.tres | 4 +- config/attack/blunt_heavy_dash_2.tres | 4 +- config/attack/blunt_heavy_hit_blow.tres | 1 - config/attack/blunt_mid_hit_blow.tres | 1 - config/attack/blunt_mid_hit_down.tres | 1 - config/attack/blunt_mid_hit_down_back.tres | 1 - config/attack/blunt_mid_hit_down_forward.tres | 1 - config/attack/blunt_normal_hit.tres | 1 - config/attack/blunt_normal_hit_back.tres | 1 - config/attack/blunt_normal_hit_sweep.tres | 1 - config/attack/blunt_normal_hit_up.tres | 1 - config/attack/blunt_normal_hit_up_back.tres | 1 - config/attack/blunt_normal_none.tres | 1 - config/attack/blunt_starfall_1.tres | 4 +- config/attack/blunt_starfall_2.tres | 1 - config/attack/blunt_tackle.tres | 2 +- config/attack/blunt_throw_check_hit.tres | 4 +- config/attack/blunt_throw_end_hit_down.tres | 1 - config/attack/rebound.tres | 6 +- config/attack/sharp_heavy_hit_back.tres | 1 - config/attack/sharp_heavy_hit_blow.tres | 1 - config/attack/sharp_light_hit_up.tres | 2 +- config/attack/sharp_mid_hit.tres | 5 +- config/attack/sharp_mid_hit_blow.tres | 1 - config/attack/sharp_mid_hit_down.tres | 2 +- config/attack/sharp_mid_hit_up.tres | 4 +- config/attack/sharp_normal_hit.tres | 1 - config/attack/sharp_normal_hit_back.tres | 5 +- config/attack/sharp_normal_hit_back_hard.tres | 1 - config/attack/sharp_normal_hit_blow.tres | 2 +- config/attack/sharp_normal_hit_down.tres | 1 - config/attack/sharp_normal_hit_up.tres | 4 +- config/attack/sharp_normal_none.tres | 1 - config/attack_box/rebound.tres | 8 +- script/_global/struct.gd | 1 + script/character/ai/ai.gd | 7 +- script/character/battle.gd | 8 +- script/character/battle_attack_area.gd | 3 - script/character/buff.gd | 163 ++++++++++-------- script/config/attack_box_cfg.gd | 1 + script/config/attack_cfg.gd | 1 - 41 files changed, 120 insertions(+), 140 deletions(-) diff --git a/config/attack/blunt_heavy_dash_1.tres b/config/attack/blunt_heavy_dash_1.tres index 8a60008..82a3792 100644 --- a/config/attack/blunt_heavy_dash_1.tres +++ b/config/attack/blunt_heavy_dash_1.tres @@ -1,6 +1,6 @@ [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"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_q10v1"] [resource] script = ExtResource("1_q10v1") @@ -9,8 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = false -is_rebound = false -is_stop_self = false is_throw_check = false is_throw_end = false hit_back_speed = 6.0 diff --git a/config/attack/blunt_heavy_dash_2.tres b/config/attack/blunt_heavy_dash_2.tres index 7435bc0..fc6e40f 100644 --- a/config/attack/blunt_heavy_dash_2.tres +++ b/config/attack/blunt_heavy_dash_2.tres @@ -1,6 +1,6 @@ [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"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_a550s"] [resource] script = ExtResource("1_a550s") @@ -9,8 +9,6 @@ break_level = 2 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false -is_stop_self = false is_throw_check = false is_throw_end = false hit_back_speed = 10.0 diff --git a/config/attack/blunt_heavy_hit_blow.tres b/config/attack/blunt_heavy_hit_blow.tres index fcb9a8b..1f974f7 100644 --- a/config/attack/blunt_heavy_hit_blow.tres +++ b/config/attack/blunt_heavy_hit_blow.tres @@ -9,7 +9,6 @@ break_level = 3 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 8.0 diff --git a/config/attack/blunt_mid_hit_blow.tres b/config/attack/blunt_mid_hit_blow.tres index 7821810..2678566 100644 --- a/config/attack/blunt_mid_hit_blow.tres +++ b/config/attack/blunt_mid_hit_blow.tres @@ -9,7 +9,6 @@ break_level = 2 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 3.0 diff --git a/config/attack/blunt_mid_hit_down.tres b/config/attack/blunt_mid_hit_down.tres index 2c6ce56..33afc9a 100644 --- a/config/attack/blunt_mid_hit_down.tres +++ b/config/attack/blunt_mid_hit_down.tres @@ -9,7 +9,6 @@ break_level = 2 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack/blunt_mid_hit_down_back.tres b/config/attack/blunt_mid_hit_down_back.tres index ae1657e..b44d560 100644 --- a/config/attack/blunt_mid_hit_down_back.tres +++ b/config/attack/blunt_mid_hit_down_back.tres @@ -9,7 +9,6 @@ break_level = 2 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = -6.0 diff --git a/config/attack/blunt_mid_hit_down_forward.tres b/config/attack/blunt_mid_hit_down_forward.tres index c9ad0fc..7c32820 100644 --- a/config/attack/blunt_mid_hit_down_forward.tres +++ b/config/attack/blunt_mid_hit_down_forward.tres @@ -9,7 +9,6 @@ break_level = 2 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 7.0 diff --git a/config/attack/blunt_normal_hit.tres b/config/attack/blunt_normal_hit.tres index b22347d..c0ad685 100644 --- a/config/attack/blunt_normal_hit.tres +++ b/config/attack/blunt_normal_hit.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = false -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 2.0 diff --git a/config/attack/blunt_normal_hit_back.tres b/config/attack/blunt_normal_hit_back.tres index f2ede8a..6666b3d 100644 --- a/config/attack/blunt_normal_hit_back.tres +++ b/config/attack/blunt_normal_hit_back.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = false -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 3.0 diff --git a/config/attack/blunt_normal_hit_sweep.tres b/config/attack/blunt_normal_hit_sweep.tres index 24ba0c1..e991d56 100644 --- a/config/attack/blunt_normal_hit_sweep.tres +++ b/config/attack/blunt_normal_hit_sweep.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 2.0 diff --git a/config/attack/blunt_normal_hit_up.tres b/config/attack/blunt_normal_hit_up.tres index b7b06eb..9ed6f34 100644 --- a/config/attack/blunt_normal_hit_up.tres +++ b/config/attack/blunt_normal_hit_up.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack/blunt_normal_hit_up_back.tres b/config/attack/blunt_normal_hit_up_back.tres index 8b99410..96c2b95 100644 --- a/config/attack/blunt_normal_hit_up_back.tres +++ b/config/attack/blunt_normal_hit_up_back.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = -2.5 diff --git a/config/attack/blunt_normal_none.tres b/config/attack/blunt_normal_none.tres index abed1c9..e2772be 100644 --- a/config/attack/blunt_normal_none.tres +++ b/config/attack/blunt_normal_none.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = false -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack/blunt_starfall_1.tres b/config/attack/blunt_starfall_1.tres index d05b12e..7a44518 100644 --- a/config/attack/blunt_starfall_1.tres +++ b/config/attack/blunt_starfall_1.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://by6jd5xqjml2m"] -[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_gadv7"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_gadv7"] [resource] script = ExtResource("1_gadv7") @@ -9,8 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = false -is_rebound = false -is_stop_self = false is_throw_check = false is_throw_end = false hit_back_speed = 2.0 diff --git a/config/attack/blunt_starfall_2.tres b/config/attack/blunt_starfall_2.tres index e657caa..5d688d0 100644 --- a/config/attack/blunt_starfall_2.tres +++ b/config/attack/blunt_starfall_2.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 3.0 diff --git a/config/attack/blunt_tackle.tres b/config/attack/blunt_tackle.tres index c6d42e1..f693bd1 100644 --- a/config/attack/blunt_tackle.tres +++ b/config/attack/blunt_tackle.tres @@ -9,7 +9,7 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = false + is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack/blunt_throw_check_hit.tres b/config/attack/blunt_throw_check_hit.tres index 4a02608..badca84 100644 --- a/config/attack/blunt_throw_check_hit.tres +++ b/config/attack/blunt_throw_check_hit.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://fjjpp1wuesoq"] -[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_7y38s"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_7y38s"] [resource] script = ExtResource("1_7y38s") @@ -9,8 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = false -is_rebound = false -is_stop_self = true is_throw_check = true is_throw_end = false hit_back_speed = 2.0 diff --git a/config/attack/blunt_throw_end_hit_down.tres b/config/attack/blunt_throw_end_hit_down.tres index a98b476..a4c1d79 100644 --- a/config/attack/blunt_throw_end_hit_down.tres +++ b/config/attack/blunt_throw_end_hit_down.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = false -is_rebound = false is_throw_check = false is_throw_end = true hit_back_speed = 7.0 diff --git a/config/attack/rebound.tres b/config/attack/rebound.tres index 17641e2..ca36fe2 100644 --- a/config/attack/rebound.tres +++ b/config/attack/rebound.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://bwbr746sj06er"] -[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_2fwsa"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_2fwsa"] [resource] script = ExtResource("1_2fwsa") @@ -9,13 +9,9 @@ break_level = 1 stun_attack = 10.0 damage_type = 1 is_floating = true -is_rebound = true -is_stop_self = true is_throw_check = false is_throw_end = false hit_back_speed = 3.0 hit_up_speed = 4.0 hit_back_duration = 0.05 hit_up_duration = 0.05 -pause_time = 0.05 - diff --git a/config/attack/sharp_heavy_hit_back.tres b/config/attack/sharp_heavy_hit_back.tres index 1b2fc27..6b4de1b 100644 --- a/config/attack/sharp_heavy_hit_back.tres +++ b/config/attack/sharp_heavy_hit_back.tres @@ -9,7 +9,6 @@ break_level = 3 stun_attack = 10.0 damage_type = 0 is_floating = false -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 15.0 diff --git a/config/attack/sharp_heavy_hit_blow.tres b/config/attack/sharp_heavy_hit_blow.tres index 5aa5cbb..cbbcde0 100644 --- a/config/attack/sharp_heavy_hit_blow.tres +++ b/config/attack/sharp_heavy_hit_blow.tres @@ -9,7 +9,6 @@ break_level = 3 stun_attack = 10.0 damage_type = 0 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 15.0 diff --git a/config/attack/sharp_light_hit_up.tres b/config/attack/sharp_light_hit_up.tres index 768b06c..ff3b4b2 100644 --- a/config/attack/sharp_light_hit_up.tres +++ b/config/attack/sharp_light_hit_up.tres @@ -10,7 +10,7 @@ stun_attack = 10.0 damage_type = 0 is_floating = false is_hit_down = false -is_rebound = false + is_stop_self = true is_throw_check = false is_throw_end = false diff --git a/config/attack/sharp_mid_hit.tres b/config/attack/sharp_mid_hit.tres index ec91757..2fbe217 100644 --- a/config/attack/sharp_mid_hit.tres +++ b/config/attack/sharp_mid_hit.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://qmivx7ntfrki"] -[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_ijso0"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_ijso0"] [resource] script = ExtResource("1_ijso0") @@ -9,12 +9,9 @@ break_level = 2 stun_attack = 10.0 damage_type = 0 is_floating = false -is_rebound = false -is_stop_self = true is_throw_check = false is_throw_end = false hit_back_speed = 3.0 hit_up_speed = 1.0 hit_back_duration = 0.05 hit_up_duration = 0.05 - diff --git a/config/attack/sharp_mid_hit_blow.tres b/config/attack/sharp_mid_hit_blow.tres index b210dd8..fe569c7 100644 --- a/config/attack/sharp_mid_hit_blow.tres +++ b/config/attack/sharp_mid_hit_blow.tres @@ -9,7 +9,6 @@ break_level = 2 stun_attack = 10.0 damage_type = 0 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 3.5 diff --git a/config/attack/sharp_mid_hit_down.tres b/config/attack/sharp_mid_hit_down.tres index 54e04de..c8c5e0d 100644 --- a/config/attack/sharp_mid_hit_down.tres +++ b/config/attack/sharp_mid_hit_down.tres @@ -9,7 +9,7 @@ break_level = 2 stun_attack = 10.0 damage_type = 0 is_floating = true -is_rebound = false + is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack/sharp_mid_hit_up.tres b/config/attack/sharp_mid_hit_up.tres index e2c30c3..93cc01a 100644 --- a/config/attack/sharp_mid_hit_up.tres +++ b/config/attack/sharp_mid_hit_up.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://bvtpba01td04l"] -[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_rvnvx"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_rvnvx"] [resource] script = ExtResource("1_rvnvx") @@ -9,8 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 0 is_floating = true -is_rebound = false -is_stop_self = true is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack/sharp_normal_hit.tres b/config/attack/sharp_normal_hit.tres index a9d2273..feafaa7 100644 --- a/config/attack/sharp_normal_hit.tres +++ b/config/attack/sharp_normal_hit.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 0 is_floating = false -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 2.0 diff --git a/config/attack/sharp_normal_hit_back.tres b/config/attack/sharp_normal_hit_back.tres index 2ae8837..8d36fc2 100644 --- a/config/attack/sharp_normal_hit_back.tres +++ b/config/attack/sharp_normal_hit_back.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://btg40rn2f36c2"] -[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_4245c"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_4245c"] [resource] script = ExtResource("1_4245c") @@ -9,12 +9,9 @@ break_level = 2 stun_attack = 10.0 damage_type = 0 is_floating = false -is_rebound = false -is_stop_self = true is_throw_check = false is_throw_end = false hit_back_speed = 3.0 hit_up_speed = 1.5 hit_back_duration = 0.05 hit_up_duration = 0.05 - diff --git a/config/attack/sharp_normal_hit_back_hard.tres b/config/attack/sharp_normal_hit_back_hard.tres index 262f624..d610d79 100644 --- a/config/attack/sharp_normal_hit_back_hard.tres +++ b/config/attack/sharp_normal_hit_back_hard.tres @@ -9,7 +9,6 @@ break_level = 2 stun_attack = 10.0 damage_type = 0 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 4.5 diff --git a/config/attack/sharp_normal_hit_blow.tres b/config/attack/sharp_normal_hit_blow.tres index 7e65d24..0b56b51 100644 --- a/config/attack/sharp_normal_hit_blow.tres +++ b/config/attack/sharp_normal_hit_blow.tres @@ -10,7 +10,7 @@ stun_attack = 10.0 damage_type = 0 is_floating = true is_hit_down = false -is_rebound = false + is_stop_self = true is_throw_check = false is_throw_end = false diff --git a/config/attack/sharp_normal_hit_down.tres b/config/attack/sharp_normal_hit_down.tres index 83ffb3a..03f1291 100644 --- a/config/attack/sharp_normal_hit_down.tres +++ b/config/attack/sharp_normal_hit_down.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 0 is_floating = true -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack/sharp_normal_hit_up.tres b/config/attack/sharp_normal_hit_up.tres index 154a29a..8eff654 100644 --- a/config/attack/sharp_normal_hit_up.tres +++ b/config/attack/sharp_normal_hit_up.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AttackCfg" load_steps=2 format=3 uid="uid://ckbf40c75bfqf"] -[ext_resource type="Script" path="res://script/config/attack_cfg.gd" id="1_iuifx"] +[ext_resource type="Script" uid="uid://bm8fn2yciam1g" path="res://script/config/attack_cfg.gd" id="1_iuifx"] [resource] script = ExtResource("1_iuifx") @@ -9,8 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 0 is_floating = true -is_rebound = false -is_stop_self = true is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack/sharp_normal_none.tres b/config/attack/sharp_normal_none.tres index 0634f81..adfd20d 100644 --- a/config/attack/sharp_normal_none.tres +++ b/config/attack/sharp_normal_none.tres @@ -9,7 +9,6 @@ break_level = 1 stun_attack = 10.0 damage_type = 0 is_floating = false -is_rebound = false is_throw_check = false is_throw_end = false hit_back_speed = 0.0 diff --git a/config/attack_box/rebound.tres b/config/attack_box/rebound.tres index de2fc6a..86f4e02 100644 --- a/config/attack_box/rebound.tres +++ b/config/attack_box/rebound.tres @@ -1,15 +1,11 @@ -[gd_resource type="Resource" script_class="AttackBoxCfg" load_steps=3 format=3 uid="uid://df807k1y1vequ"] +[gd_resource type="Resource" script_class="AttackBoxCfg" load_steps=2 format=3 uid="uid://df807k1y1vequ"] [ext_resource type="Script" uid="uid://dekrsow0vntqs" path="res://script/config/attack_box_cfg.gd" id="1_fstin"] -[sub_resource type="CylinderShape3D" id="CylinderShape3D_pmh6g"] -height = 0.8 -radius = 0.25 - [resource] script = ExtResource("1_fstin") -shape = SubResource("CylinderShape3D_pmh6g") offset = Vector2(0, 0) is_throw = false is_direct = false is_hit_self = true +is_rebound = true diff --git a/script/_global/struct.gd b/script/_global/struct.gd index 2fe6651..bfedbd0 100644 --- a/script/_global/struct.gd +++ b/script/_global/struct.gd @@ -8,6 +8,7 @@ class AttackInfo: var with_stop: bool = false var ignore_push: bool = false + class AttackHitInfo: var attack_info: AttackInfo var hit_target: Character diff --git a/script/character/ai/ai.gd b/script/character/ai/ai.gd index 94fe8e7..7680183 100644 --- a/script/character/ai/ai.gd +++ b/script/character/ai/ai.gd @@ -20,8 +20,8 @@ func init() -> void: is_init = true var behavior_tree_res: BehaviorTree = status.cfg.get_ai() if not behavior_tree_res: - print("未配置AI", character.cfg().get_res_name()) - Global.character_mgr.destroy_character(character.id()) + print("未配置AI:", character.cfg().get_res_name()) + btPlayer.queue_free() return btPlayer.behavior_tree = behavior_tree_res on_init() @@ -53,7 +53,8 @@ func process(delta) -> void: status.ai_is_alert = true status.emit_status("ai_is_alert") on_process(delta) - btPlayer.update(delta) + if btPlayer: + btPlayer.update(delta) func on_init() -> void: pass diff --git a/script/character/battle.gd b/script/character/battle.gd index 4873162..ca827f4 100644 --- a/script/character/battle.gd +++ b/script/character/battle.gd @@ -54,8 +54,6 @@ func character_attack2() -> void: func add_attack(attack_info: Struct.AttackInfo) -> void: if not attack_info.attack or not attack_info.attack_box: return - if character.has_buff("hit_ground_cd") and attack_info.attack == ResourceManager.cfg_attack_rebound: - return var result: Character if attack_info.attack_box.is_throw: var target: Character = Global.character_mgr.get_character(status.throw_target) @@ -65,6 +63,10 @@ func add_attack(attack_info: Struct.AttackInfo) -> void: var target: Character = Global.character_mgr.get_character(status.target) if target: result = target + elif attack_info.attack_box.is_rebound: + var target: Character = Global.character_mgr.get_character(status.id) + if target: + result = target else: battle_attack_area.refresh_attack_area(attack_info) var offset_xz: Vector2 = attack_info.attack_dir * attack_info.attack_box.offset.x @@ -103,6 +105,7 @@ func settle(from: int, to: int, attack_info: Struct.AttackInfo) -> Struct.HitRes var attack_dir: Vector2 = attack_info.attack_dir var with_stop: bool = attack_info.with_stop var ignore_push: bool = attack_info.ignore_push + var is_rebound: bool = attack_info.attack_box.is_rebound var hit_result: Struct.HitResultInfo = Struct.HitResultInfo.new() var character_from: Character = Global.character_mgr.get_character(from) as Character @@ -123,7 +126,6 @@ func settle(from: int, to: int, attack_info: Struct.AttackInfo) -> Struct.HitRes var is_self_on_floor: bool = character_from.get_status("is_on_floor") var is_floating: bool = attack.is_floating or not is_on_floor - var is_rebound: bool = attack.is_rebound and (character_from == character_to) var is_bullet: bool = int(character_from.cfg().type) == Enum.ECharacterType.Bullet var is_break_shield: bool = false diff --git a/script/character/battle_attack_area.gd b/script/character/battle_attack_area.gd index 36edf00..74dad5a 100644 --- a/script/character/battle_attack_area.gd +++ b/script/character/battle_attack_area.gd @@ -63,9 +63,6 @@ func on_body_entereddeferred(body: Node3D): var character_to: Character = body as Character if attack_id_set.has(character_to.id): return - if attack_info.attack.is_rebound: - if character_to != character and character_to.get_status("is_floating"): - return var attack_hit_info: Struct.AttackHitInfo = Struct.AttackHitInfo.new() attack_hit_info.attack_info = attack_info attack_hit_info.hit_target = character_to diff --git a/script/character/buff.gd b/script/character/buff.gd index 62863e6..93a5b52 100644 --- a/script/character/buff.gd +++ b/script/character/buff.gd @@ -14,48 +14,52 @@ class BuffInfo: var ignore_pause: bool var buff_map: Dictionary = {} # buff信息 -var buff_tick_frame_max = 1 -var buff_tick_frame = 0 +var delta_cache_max = 0.05 var delta_cache: float = 0 -func _ready(): - buff_tick_frame_max = 1 - func _process(delta): + tick(delta) delta_cache += delta - buff_tick_frame += 1 - if buff_tick_frame < buff_tick_frame_max: + if delta_cache < delta_cache_max: return - tick(delta_cache) - buff_tick_frame = 0 + tick_update(delta_cache) delta_cache = 0 func tick(delta) -> void: + for buff_name in buff_map: + var buff_info = buff_map[buff_name] + if buff_info.duration_max == -1: + continue + if buff_info.duration == 0: + trigger_buff_effect(buff_info, "second") + buff_info.duration += delta + if buff_info.duration >= buff_info.duration_max: + buff_info.duration = buff_info.duration_max + trigger_buff_effect_update(buff_info, delta) + remove_buff(buff_name) + +func tick_update(delta) -> void: for buff_name in buff_map: var buff_info = buff_map[buff_name] if has_buff("pause") and buff_name != "pause" and !buff_info.ignore_pause: continue - if buff_info.duration_max == -1: - trigger_buff_effect(buff_info, "update") - else: - if buff_info.duration == 0: - trigger_buff_effect(buff_info, "second") - buff_info.duration += delta - if buff_info.duration >= buff_info.duration_max: - buff_info.duration = buff_info.duration_max - trigger_buff_effect(buff_info, "update") - remove_buff(buff_name) - else: - trigger_buff_effect(buff_info, "update") + trigger_buff_effect_update(buff_info, delta) func trigger_buff_effect(buff: BuffInfo, trigger_name: String): var buff_name: String = buff.name var function_name: String = "on_%s_%s" % [trigger_name, buff_name] if has_method(function_name): - var rate: float = buff.duration / buff.duration_max - call(function_name, rate) + call(function_name) +func trigger_buff_effect_update(buff: BuffInfo, delta: float): + var buff_name: String = buff.name + var function_name: String = "on_update_%s" % [buff_name] + if has_method(function_name): + var rate: float = 0 + if buff.duration_max > 0: + rate = buff.duration / buff.duration_max + call(function_name, delta, rate) func has_buff(buff_name: String) -> bool: return buff_name in buff_map @@ -84,95 +88,107 @@ func remove_buff(buff_name: String): #==具体实现== #位移 -func on_end_hit_back(_rate) -> void: status.set_status("hit_back_speed", 0) +func on_end_hit_back() -> void: + status.set_status("hit_back_speed", 0) -func on_end_hit_up(_rate) -> void: status.set_status("hit_up_speed", 0) +func on_end_hit_up() -> void: + status.set_status("hit_up_speed", 0) -func on_start_jumping(_rate) -> void: status.set_status("is_jumping", true) +func on_start_jumping() -> void: + status.set_status("is_jumping", true) -func on_end_jumping(_rate) -> void: status.set_status("is_jumping", false) +func on_end_jumping() -> void: + status.set_status("is_jumping", false) -func on_start_rising(_rate) -> void: status.set_status("is_rising", true) +func on_start_rising() -> void: + status.set_status("is_rising", true) -func on_end_rising(_rate) -> void: status.set_status("is_rising", false) +func on_end_rising() -> void: + status.set_status("is_rising", false) -func on_start_floating(_rate) -> void: +func on_start_floating() -> void: status.set_status("is_floating", true) add_buff("rising", 0.1) -func on_update_floating(_rate) -> void: +func on_update_floating(_delta, _rate) -> void: if not status.is_on_floor or status.is_rising: return remove_buff("floating") add_buff("stagger", 3) -func on_end_floating(_rate) -> void: status.set_status("is_floating", false) +func on_end_floating() -> void: + status.set_status("is_floating", false) #战斗状态 -func on_start_die(_rate) -> void: +func on_start_die() -> void: status.set_status("is_dead", true) SignalManager.character_die.emit(status.id) -func on_end_die(_rate) -> void: add_buff("die2", -1) +func on_end_die() -> void: + add_buff("die2", -1) -func on_update_die2(_rate) -> void: if status.is_on_floor and not status.is_rising: remove_buff("die2") +func on_update_die2(_delta, _rate) -> void: + if status.is_on_floor and not status.is_rising: remove_buff("die2") -func on_end_die2(_rate) -> void: +func on_end_die2() -> void: effect.cast_corpse() Global.character_mgr.destroy_character(status.id) -func on_start_stagger(_rate) -> void: +func on_start_stagger() -> void: status.set_status("is_stagger", true) status.set_skill_break_level_add(-1) -func on_end_stagger(_rate) -> void: +func on_end_stagger() -> void: status.set_status("is_stagger", false) status.set_skill_break_level_add(0) -func on_end_shield_recover_cd(_rate) -> void: add_buff("shield_recover", -1) +func on_end_shield_recover_cd() -> void: + add_buff("shield_recover", -1) -func on_update_shield_recover(_rate) -> void: - var shield_add: float = get_process_delta_time() * status.cfg.shield.recover_speed +func on_update_shield_recover(delta, _rate) -> void: + var shield_add: float = delta * status.cfg.shield.recover_speed shield_add = min(status.shield_max - status.shield, shield_add) if shield_add == status.shield_max - status.shield: remove_buff("shield_recover") character.set_shield(status.shield + shield_add) -func on_end_mp_recover_cd(_rate) -> void: add_buff("mp_recover", 0.1) +func on_end_mp_recover_cd() -> void: + add_buff("mp_recover", 0.1) -func on_update_mp_recover(_rate) -> void: - var mp_add: float = get_process_delta_time() * status.cfg.mp.recover_speed +func on_update_mp_recover(delta, _rate) -> void: + var mp_add: float = delta * status.cfg.mp.recover_speed 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 +func on_update_charging(delta, _rate) -> void: + var mp_add: float = delta * 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) +func on_end_stun_recover_break_cd() -> void: + add_buff("stun_recover_break", -1) -func on_update_stun_recover_break(_rate) -> void: - var stun_sub: float = get_process_delta_time() * status.cfg.stun.recover_break_speed +func on_update_stun_recover_break(delta, _rate) -> void: + var stun_sub: float = delta * status.cfg.stun.recover_break_speed stun_sub = min(status.stun, stun_sub) status.set_status("stun", status.stun - stun_sub) if status.stun == 0: @@ -180,21 +196,23 @@ func on_update_stun_recover_break(_rate) -> void: status.set_status("is_stun", false) -func on_end_stun_recover_cd(_rate) -> void: add_buff("stun_recover", -1) +func on_end_stun_recover_cd() -> void: + add_buff("stun_recover", -1) -func on_update_stun_recover(_rate) -> void: - var stun_sub: float = get_process_delta_time() * status.cfg.stun.recover_speed +func on_update_stun_recover(delta, _rate) -> void: + var stun_sub: float = delta * status.cfg.stun.recover_speed stun_sub = min(status.stun, stun_sub) status.set_status("stun", status.stun - stun_sub) if status.stun == 0: remove_buff("stun_recover") -func on_update_weapon_index_change(rate) -> void: status.set_status("weapon_index_change_rate", rate) +func on_update_weapon_index_change(_delta, rate) -> void: + status.set_status("weapon_index_change", rate) -func on_end_weapon_index_change(_rate) -> void: +func on_end_weapon_index_change() -> void: var weapon_index: int = status.weapon_index + status.weapon_index_change_dir var weapon_len: int = len(status.weapon_list) weapon_index = (weapon_index % weapon_len + weapon_len) % weapon_len @@ -203,43 +221,50 @@ func on_end_weapon_index_change(_rate) -> void: #表现 -func on_start_freeze(_rate) -> void: +func on_start_freeze() -> void: status.set_status("is_pause", true) -func on_end_freeze(_rate) -> void: +func on_end_freeze() -> void: status.set_status("is_pause", false) -func on_second_pause(_rate) -> void: +func on_second_pause() -> void: status.set_status("is_pause", true) -func on_end_pause(_rate) -> void: +func on_end_pause() -> void: status.set_status("is_pause", false) -func on_start_flash_white(_rate) -> void: status.set_status("flash_white_rate", 1) - +func on_start_flash_white() -> void: + status.set_status("flash_white", 1) -func on_update_flash_white(rate) -> void: status.set_status("flash_white_rate", 1 - rate) +func on_update_flash_white(_delta, rate) -> void: + status.set_status("flash_white", 1 - rate) -func on_end_flash_white(_rate) -> void: status.set_status("flash_white_rate", 0) +func on_end_flash_white() -> void: + status.set_status("flash_white", 0) + -func on_update_shake_x(rate) -> void: - var shake_rate: float = 0.5 * status.pause_time - status.set_status("shake_offset", Vector3((sin(rate * PI * 6) - 0.5) * shake_rate, 0, 0)) +func on_update_shake_x(_delta, rate) -> void: + var shake: float = 0.5 * status.pause_time + status.set_status("shake_offset", Vector3((sin(rate * PI * 6) - 0.5) * shake, 0, 0)) -func on_end_shake_x(_rate) -> void: status.set_status("shake_offset", Vector3.ZERO) +func on_end_shake_x() -> void: + status.set_status("shake_offset", Vector3.ZERO) -func on_start_deformation(_rate) -> void: status.set_status("deformation_rate", 1) +func on_start_deformation() -> void: + status.set_status("deformation", 1) -func on_update_deformation(rate) -> void: status.set_status("deformation_rate", 1 - rate) +func on_update_deformation(_delta, rate) -> void: + status.set_status("deformation", 1 - rate) -func on_end_deformation(_rate) -> void: status.set_status("deformation_rate", 0) +func on_end_deformation() -> void: + status.set_status("deformation", 0) diff --git a/script/config/attack_box_cfg.gd b/script/config/attack_box_cfg.gd index 9d8707d..745c477 100644 --- a/script/config/attack_box_cfg.gd +++ b/script/config/attack_box_cfg.gd @@ -6,3 +6,4 @@ class_name AttackBoxCfg @export var is_throw: bool #是否投技(只命中投技目标) @export var is_direct: bool #是否直接命中 @export var is_hit_self: bool #是否命中自己 +@export var is_rebound: bool #是否地面反弹技能 diff --git a/script/config/attack_cfg.gd b/script/config/attack_cfg.gd index 5349992..d56b835 100644 --- a/script/config/attack_cfg.gd +++ b/script/config/attack_cfg.gd @@ -8,7 +8,6 @@ class_name AttackCfg @export_group("类型标记") @export var damage_type: Enum.EDamageType = Enum.EDamageType.Sharp # 伤害类型 @export var is_floating: bool #是否浮空技 -@export var is_rebound: bool #是否地面反弹技能 @export var is_throw_check: bool #是否投技检测 @export var is_throw_end: bool #是否投技最后一段(释放投技目标) @export_group("强制位移")