diff --git a/config/skill_player_weapon/hero01_fist_air_skill01.tres b/config/skill_player_weapon/hero01_fist_air_skill01.tres index 57b70ba..8c62547 100644 --- a/config/skill_player_weapon/hero01_fist_air_skill01.tres +++ b/config/skill_player_weapon/hero01_fist_air_skill01.tres @@ -1,12 +1,7 @@ -[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=9 format=3 uid="uid://dkxgra6y2u30l"] +[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=4 format=3 uid="uid://dkxgra6y2u30l"] -[ext_resource type="Resource" uid="uid://by6jd5xqjml2m" path="res://config/attack/blunt_starfall_1.tres" id="1_p1fp6"] [ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="2_mje6b"] -[ext_resource type="Resource" uid="uid://57sukcw6ewqo" path="res://config/attack_box/circle_normal.tres" id="2_nvq3h"] -[ext_resource type="Resource" uid="uid://d26ok8as50xe5" path="res://config/attack/blunt_starfall_2.tres" id="3_ffp0l"] [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_13pbo"] -[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] @@ -18,13 +13,8 @@ skill_animation = ExtResource("3_q461t") range = 0.0 free_lock = false ignore_push = true -attack1 = ExtResource("1_p1fp6") -attack1_box = ExtResource("2_nvq3h") -attack2 = ExtResource("3_ffp0l") -attack2_box = ExtResource("4_13pbo") -stance_from = 10 +stance_from = 100 stance_to = 0 break_level = 3 refresh_animation = false -sprite_frames = ExtResource("4_seudu") -animation_name = "fist_air_skill01" +animation_name = "" diff --git a/config/skill_player_weapon/hero01_fist_attack04.tres b/config/skill_player_weapon/hero01_fist_attack04.tres index c27a818..f31a647 100644 --- a/config/skill_player_weapon/hero01_fist_attack04.tres +++ b/config/skill_player_weapon/hero01_fist_attack04.tres @@ -1,10 +1,8 @@ -[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=7 format=3 uid="uid://b4aysymwqtvtd"] +[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=5 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="Resource" uid="uid://diedb7vw7eyxp" path="res://config/attack_box/box_mid.tres" id="2_0lps6"] [ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="2_mhuew"] [ext_resource type="Animation" uid="uid://6u3dhxly760l" path="res://resource/skill_animation/hero01_fist_attack04.tres" id="3_bst70"] -[ext_resource type="SpriteFrames" uid="uid://bhsotj76tuovy" path="res://resource/animation/character/hero01_fist_attack.aseprite" id="4_hyek5"] [ext_resource type="Resource" uid="uid://c6alg8pmqfdxm" path="res://config/weapon/fist.tres" id="5_gn3tt"] [resource] @@ -17,10 +15,8 @@ range = 0.0 free_lock = false ignore_push = false attack1 = ExtResource("1_s12sc") -attack1_box = ExtResource("2_0lps6") -stance_from = 3 -stance_to = 4 +stance_from = 100 +stance_to = 0 break_level = 3 refresh_animation = false -sprite_frames = ExtResource("4_hyek5") -animation_name = "fist_attack04" +animation_name = "" diff --git a/config/skill_player_weapon/hero01_long_air_attack03.tres b/config/skill_player_weapon/hero01_long_air_attack03.tres index aecc40e..aee8c40 100644 --- a/config/skill_player_weapon/hero01_long_air_attack03.tres +++ b/config/skill_player_weapon/hero01_long_air_attack03.tres @@ -1,10 +1,8 @@ -[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=7 format=3 uid="uid://b705py5rht5i3"] +[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=5 format=3 uid="uid://b705py5rht5i3"] [ext_resource type="Resource" uid="uid://bv4uoey1liqoq" path="res://config/attack/sharp_heavy_hit_blow.tres" id="1_5rgpl"] [ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="2_0x7hh"] -[ext_resource type="Resource" uid="uid://diedb7vw7eyxp" path="res://config/attack_box/box_mid.tres" id="2_2wu8a"] [ext_resource type="Animation" uid="uid://bh5s2t3cbobpp" path="res://resource/skill_animation/hero01_long_air_attack03.tres" id="3_1erk8"] -[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="4_wrd60"] [ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="5_u3vas"] [resource] @@ -17,10 +15,8 @@ range = 0.0 free_lock = false ignore_push = false attack1 = ExtResource("1_5rgpl") -attack1_box = ExtResource("2_2wu8a") -stance_from = 12 -stance_to = 13 +stance_from = 100 +stance_to = 0 break_level = 3 refresh_animation = false -sprite_frames = ExtResource("4_wrd60") -animation_name = "long_air_attack03" +animation_name = "" diff --git a/render/shader/effect_skew1.gdshader b/render/shader/effect_skew1.gdshader index c164c3e..9ee4327 100644 --- a/render/shader/effect_skew1.gdshader +++ b/render/shader/effect_skew1.gdshader @@ -8,15 +8,15 @@ uniform float distortionView : hint_range(0.0, 0.3, 0.005) = 0.03; uniform float speedView : hint_range(0.0, 1.0, 0.005) = 0.5; uniform sampler2D screenTexture : hint_screen_texture; -void fragment() +void fragment() { vec4 col_mask = texture(tex_mask, UV); - + float noiseValueX = (texture(noise, UV + (TIME * speedView)).r * 2.0) - 1.0; // Range: -1.0 to 1.0 float noiseValueY = (texture(noise, UV + (TIME * speedView)).r * 2.0) - 1.0; // Range: -1.0 to 1.0 vec2 noiseDistort = vec2(noiseValueX, noiseValueY) * distortionView * col_mask.r;; vec3 distortedScreenTexture = vec3(texture(screenTexture, SCREEN_UV + noiseDistort).rgb); - + ALBEDO = distortedScreenTexture; ALPHA = col_mask.r; } \ No newline at end of file diff --git a/render/shader/effect_slash.gdshader b/render/shader/effect_slash.gdshader index cc44e42..54187a0 100644 --- a/render/shader/effect_slash.gdshader +++ b/render/shader/effect_slash.gdshader @@ -14,7 +14,7 @@ void fragment() { vec4 col_mask = texture(tex_mask, UV); vec4 col = (col_noise + col_main) * col_mask; col = texture(tex_gradient, vec2(clamp(col.r,0.0,1.0),0.5)); - + //vec4 col_mask2 = texture(tex_mask2, UV); //float noiseValueX = col_noise.r; //float noiseValueY = col_noise.r; diff --git a/resource/animation/character/_design_monster.aseprite b/resource/animation/character/_design_monster.aseprite index 834b5c6..2f6f082 100644 Binary files a/resource/animation/character/_design_monster.aseprite and b/resource/animation/character/_design_monster.aseprite differ diff --git a/resource/animation/character/_design_monster.png b/resource/animation/character/_design_monster.png index bb702c4..7cbc324 100644 Binary files a/resource/animation/character/_design_monster.png and b/resource/animation/character/_design_monster.png differ diff --git a/scene/ai/bullet01.tscn b/scene/ai/bullet01.tscn index 44d03cf..a72c310 100644 --- a/scene/ai/bullet01.tscn +++ b/scene/ai/bullet01.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=3 uid="uid://bgku27xawscbt"] +[gd_scene load_steps=12 format=3 uid="uid://bgku27xawscbt"] [ext_resource type="Script" path="res://addons/beehave/nodes/beehave_tree.gd" id="1_r673b"] [ext_resource type="Script" path="res://addons/beehave/nodes/composites/selector.gd" id="2_5ltau"] @@ -8,11 +8,13 @@ [ext_resource type="Script" path="res://script/ai/action/action_wait.gd" id="6_omj7f"] [ext_resource type="Script" path="res://script/ai/action_blackboard/action_blackboard_set.gd" id="7_gpffp"] [ext_resource type="Script" path="res://script/ai/action/action_attack1.gd" id="7_wcjhl"] +[ext_resource type="Script" path="res://script/ai/action/action_stop_move.gd" id="8_ntwgo"] [ext_resource type="Script" path="res://script/ai/action_blackboard/action_blackboard_add.gd" id="8_rm753"] +[ext_resource type="Script" path="res://addons/beehave/nodes/decorators/succeeder.gd" id="9_lh2cr"] [node name="BeehaveTree" type="Node" node_paths=PackedStringArray("blackboard")] script = ExtResource("1_r673b") -blackboard = NodePath("@Node@19110") +blackboard = NodePath("@Node@19131") [node name="SelectorComposite" type="Node" parent="."] script = ExtResource("2_5ltau") @@ -26,11 +28,14 @@ key = "step" [node name="ActionWait" type="Node" parent="SelectorComposite/SequenceComposite"] script = ExtResource("6_omj7f") -wait_time = 0.1 +wait_time = 0.05 [node name="ActionAttack1" type="Node" parent="SelectorComposite/SequenceComposite"] script = ExtResource("7_wcjhl") +[node name="ActionStopMove" type="Node" parent="SelectorComposite/SequenceComposite"] +script = ExtResource("8_ntwgo") + [node name="SetStep1" type="Node" parent="SelectorComposite/SequenceComposite"] script = ExtResource("7_gpffp") key = "step" @@ -46,9 +51,12 @@ value = 1 [node name="ActionWait" type="Node" parent="SelectorComposite/SequenceComposite2"] script = ExtResource("6_omj7f") -wait_time = 0.1 +wait_time = 0.3 + +[node name="AlwaysSucceedDecorator" type="Node" parent="SelectorComposite/SequenceComposite2"] +script = ExtResource("9_lh2cr") -[node name="ActionAttack1" type="Node" parent="SelectorComposite/SequenceComposite2"] +[node name="ActionAttack1" type="Node" parent="SelectorComposite/SequenceComposite2/AlwaysSucceedDecorator"] script = ExtResource("7_wcjhl") [node name="AddHit" type="Node" parent="SelectorComposite/SequenceComposite2"] @@ -56,10 +64,10 @@ script = ExtResource("8_rm753") key = "hit" value = 1 -[node name="CheckHit5" type="Node" parent="SelectorComposite/SequenceComposite2"] +[node name="CheckHit9" type="Node" parent="SelectorComposite/SequenceComposite2"] script = ExtResource("4_vnt1w") key = "hit" -value = 5 +value = 9 [node name="SetStep2" type="Node" parent="SelectorComposite/SequenceComposite2"] script = ExtResource("7_gpffp") diff --git a/scene/character/character.tscn b/scene/character/character.tscn index c4855a5..6ae0033 100644 --- a/scene/character/character.tscn +++ b/scene/character/character.tscn @@ -9,7 +9,7 @@ [ext_resource type="Script" path="res://script/character/view.gd" id="4_vijjv"] [ext_resource type="Script" path="res://script/character/skill.gd" id="6_h4xqy"] [ext_resource type="AnimationLibrary" uid="uid://croik07a1qko5" path="res://resource/skill_animation_library/animation_library.tres" id="6_pakq5"] -[ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="6_vb8qm"] +[ext_resource type="SpriteFrames" uid="uid://jpxh0jr8wp8g" path="res://resource/animation/character/hero01_basic.aseprite" id="6_whjpk"] [ext_resource type="Script" path="res://script/character/battle.gd" id="8_w84sf"] [ext_resource type="Script" path="res://script/character/buff.gd" id="9_jlnhy"] [ext_resource type="Script" path="res://script/character/effect.gd" id="12_eyfcd"] @@ -105,8 +105,9 @@ pixel_size = 0.02 double_sided = false alpha_cut = 2 texture_filter = 0 -sprite_frames = ExtResource("6_vb8qm") -animation = &"long_attack01" +sprite_frames = ExtResource("6_whjpk") +animation = &"basic_air_flash" +frame = 7 script = ExtResource("4_vijjv") [node name="Move" type="Node3D" parent="."] diff --git a/script/ai/action/action_find_target.gd b/script/ai/action/action_find_target.gd index 2464c5e..e6bbf34 100644 --- a/script/ai/action/action_find_target.gd +++ b/script/ai/action/action_find_target.gd @@ -2,5 +2,6 @@ extends Action class_name ActionFindTarget func run(character: Character, blackboard: Blackboard) -> int: - character.move_stop() + var player_id: int = Global.character_mgr.get_player_id() + character.set_target(player_id) return SUCCESS diff --git a/script/ai/action/action_stop_move.gd b/script/ai/action/action_stop_move.gd index 40d0669..a45a0f4 100644 --- a/script/ai/action/action_stop_move.gd +++ b/script/ai/action/action_stop_move.gd @@ -2,6 +2,5 @@ extends Action class_name ActionStopMove func run(character: Character, blackboard: Blackboard) -> int: - var player_id: int = Global.character_mgr.get_player_id() - character.set_target(player_id) + character.move_stop() return SUCCESS diff --git a/script/ai/action_blackboard.gd b/script/ai/action_blackboard.gd index 7e4d23a..b7637b1 100644 --- a/script/ai/action_blackboard.gd +++ b/script/ai/action_blackboard.gd @@ -3,8 +3,8 @@ class_name ActionBlackboard extends Action func run(character: Character, blackboard: Blackboard) -> int: - return execute(character, blackboard) + return execute(character, blackboard) func execute(character: Character, blackboard: Blackboard) -> int: - return FAILURE + return FAILURE diff --git a/script/ai/action_blackboard/action_blackboard_add.gd b/script/ai/action_blackboard/action_blackboard_add.gd index de65577..b63edf3 100644 --- a/script/ai/action_blackboard/action_blackboard_add.gd +++ b/script/ai/action_blackboard/action_blackboard_add.gd @@ -6,6 +6,6 @@ class_name ActionBlackboardAdd func execute(character: Character, blackboard: Blackboard) -> int: - var left: int = blackboard.get_value(key, 0) - blackboard.set(key, left+value) - return SUCCESS + var left: int = blackboard.get_value(key, 0) + blackboard.set_value(key, left+value) + return SUCCESS diff --git a/script/ai/action_blackboard/action_blackboard_check.gd b/script/ai/action_blackboard/action_blackboard_check.gd index e078e0c..d9a4b17 100644 --- a/script/ai/action_blackboard/action_blackboard_check.gd +++ b/script/ai/action_blackboard/action_blackboard_check.gd @@ -2,12 +2,12 @@ extends ActionBlackboard class_name ActionBlackboardCheck enum Operators { - EQUAL, - NOT_EQUAL, - GREATER, - LESS, - GREATER_EQUAL, - LESS_EQUAL, + EQUAL, + NOT_EQUAL, + GREATER, + LESS, + GREATER_EQUAL, + LESS_EQUAL, } @export var key: String @@ -16,15 +16,13 @@ enum Operators { func execute(character: Character, blackboard: Blackboard) -> int: - var left: Variant = blackboard.get_value(key, 0) - var result: bool = false - - match operator: - Operators.EQUAL: result = left == value - Operators.NOT_EQUAL: result = left != value - Operators.GREATER: result = left > value - Operators.LESS: result = left < value - Operators.GREATER_EQUAL: result = left >= value - Operators.LESS_EQUAL: result = left <= value - - return SUCCESS if result else FAILURE \ No newline at end of file + var left: Variant = blackboard.get_value(key, 0) + var result: bool = false + match operator: + Operators.EQUAL: result = left == value + Operators.NOT_EQUAL: result = left != value + Operators.GREATER: result = left > value + Operators.LESS: result = left < value + Operators.GREATER_EQUAL: result = left >= value + Operators.LESS_EQUAL: result = left <= value + return SUCCESS if result else FAILURE diff --git a/script/ai/action_blackboard/action_blackboard_set.gd b/script/ai/action_blackboard/action_blackboard_set.gd index 871cff4..e267dc5 100644 --- a/script/ai/action_blackboard/action_blackboard_set.gd +++ b/script/ai/action_blackboard/action_blackboard_set.gd @@ -6,5 +6,5 @@ class_name ActionBlackboardSet func execute(character: Character, blackboard: Blackboard) -> int: - blackboard.set(key, value) + blackboard.set_value(key, value) return SUCCESS diff --git a/script/character/ai/monster_ai.gd b/script/character/ai/monster_ai.gd index d5953df..608cea2 100644 --- a/script/character/ai/monster_ai.gd +++ b/script/character/ai/monster_ai.gd @@ -1,5 +1,5 @@ extends AI class_name MonsterAI -func on_process(): +func on_process(delta): pass diff --git a/script/character/battle.gd b/script/character/battle.gd index 0bf65a8..b5cd735 100644 --- a/script/character/battle.gd +++ b/script/character/battle.gd @@ -231,7 +231,8 @@ func settle(hit_info: HitInfo) -> bool: character_to.set_pause_time(pause_time) #全局特效 - Global.camera_mgr.effect(pause_time) + if not is_remote: + Global.camera_mgr.effect(pause_time) #伤害跳字 character_to.show_hit_damage(damage) diff --git a/script/character/character.gd b/script/character/character.gd index 2a28c9f..033f121 100644 --- a/script/character/character.gd +++ b/script/character/character.gd @@ -9,6 +9,7 @@ class_name Character @onready var skill: Skill = (%Skill as Skill) @onready var battle: Battle = (%Battle as Battle) @onready var effect: Effect = (%Effect as Effect) +@onready var move: Move = (%Move as Move) func init(id: int, cfg: CharacterCfg, team: Enum.ETeam, owner_id: int): @@ -123,7 +124,9 @@ func set_pos(pos: Vector3): func move_to(dir: Vector2): set_status("move_dir", dir) -func move_stop(): set_status("move_dir", Vector2.ZERO) +func move_stop(): + set_status("move_dir", Vector2.ZERO) + move.stop() func add_buff(buff_name: String, duration: float, ignore_pause: bool = false): buff.add_buff(buff_name, duration, ignore_pause) @@ -182,9 +185,11 @@ func get_character_owner() -> Character: var owner: Character = Global.character_mgr.get_character(status.owner_id) as Character if owner: return owner return self - + + func attack1() -> bool: return battle.character_attack1() - + + func attack2() -> bool: return battle.character_attack2() diff --git a/script/character/skill.gd b/script/character/skill.gd index a07316f..58a8023 100644 --- a/script/character/skill.gd +++ b/script/character/skill.gd @@ -47,17 +47,12 @@ func cast_skill(cfg: SkillCfg, cast_dir: Vector2): var animation_name: String = "animation_library/%s" % Util.get_resource_name(cfg) if has_animation(animation_name): status.speed_up_rate = -1 - status.skill_move_speed = 0 - status.skill_float_speed = 0 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.speed_down_push_rate = 0 - status.skill_move_stop = false - status.is_speed_y_freeze = false if cast_dir.x != 0: status.is_right = cast_dir.x > 0 play(animation_name, -1, Setting.animation_speed_scale) else: