diff --git a/config/attack/blunt_normal_hit_back.tres b/config/attack/blunt_normal_hit_back.tres index 16a741e..0a446af 100644 --- a/config/attack/blunt_normal_hit_back.tres +++ b/config/attack/blunt_normal_hit_back.tres @@ -5,13 +5,15 @@ [resource] script = ExtResource("1_egjnk") damage_rate = 1.0 -break_level = 2 +break_level = 1 stun_attack = 10.0 damage_type = 1 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 = 3.0 hit_up_speed = 3.0 hit_back_duration = 0.05 diff --git a/config/attack/sharp_mid_hit_blow.tres b/config/attack/sharp_mid_hit_blow.tres index 48f143f..db46226 100644 --- a/config/attack/sharp_mid_hit_blow.tres +++ b/config/attack/sharp_mid_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 = 3.5 hit_up_speed = 3.0 hit_back_duration = 0.05 diff --git a/config/character/monster03.tres b/config/character/monster03.tres index 6e60e12..60f38bb 100644 --- a/config/character/monster03.tres +++ b/config/character/monster03.tres @@ -3,7 +3,7 @@ [ext_resource type="Resource" uid="uid://dx54fjf5t0uu8" path="res://config/character_move/normal.tres" id="1_ol2gy"] [ext_resource type="Resource" uid="uid://dpajmgrlaytah" path="res://config/character_mp/normal.tres" id="2_kkpsf"] [ext_resource type="Script" path="res://script/config/character_cfg.gd" id="3_0gem5"] -[ext_resource type="Resource" uid="uid://h1curvk64vm3" path="res://config/character_shield/none.tres" id="4_tuve4"] +[ext_resource type="Resource" uid="uid://dlaekoamystx3" path="res://config/character_shield/normal.tres" id="4_3daai"] [ext_resource type="SpriteFrames" uid="uid://bvcrc6bbufwqv" path="res://resource/animation/character/monster03_move.aseprite" id="5_4dnud"] [ext_resource type="Resource" uid="uid://cac6mk6g078vn" path="res://config/character_stun/normal.tres" id="6_ar00t"] @@ -15,7 +15,7 @@ sprite_frames = ExtResource("5_4dnud") sprite_harf_height = 26 sprite_width = 16 move = ExtResource("1_ol2gy") -shield = ExtResource("4_tuve4") +shield = ExtResource("4_3daai") stun = ExtResource("6_ar00t") mp = ExtResource("2_kkpsf") hp_max = 100.0 diff --git a/resource/animation/character/monster03_move.aseprite b/resource/animation/character/monster03_move.aseprite index ed2a2ef..24368cc 100644 Binary files a/resource/animation/character/monster03_move.aseprite and b/resource/animation/character/monster03_move.aseprite differ diff --git a/resource/ui/hud/break_level.png b/resource/ui/hud/break_level.png index d748b70..c4f6339 100644 Binary files a/resource/ui/hud/break_level.png and b/resource/ui/hud/break_level.png differ diff --git a/script/ai/action_with_target/action_cast_skill.gd b/script/ai/action_with_target/action_cast_skill.gd index 1aa8e32..bc689ea 100644 --- a/script/ai/action_with_target/action_cast_skill.gd +++ b/script/ai/action_with_target/action_cast_skill.gd @@ -6,8 +6,9 @@ func execute(character: Character, target: Character, blackboard: Blackboard) -> var status: Status = character.status var dir: Vector2 = target.pos2D() - character.pos2D() if status.is_skill_running: - character.move_to(dir) - return RUNNING + if int(status.break_level) < Enum.EBreakLevel.Break: + character.move_to(dir) + return RUNNING var dist: float = dir.length() for skill_cfg: SkillCfg in skill.skill_dict.values(): #检查姿态 diff --git a/script/character/battle.gd b/script/character/battle.gd index e5b9af0..33f206c 100644 --- a/script/character/battle.gd +++ b/script/character/battle.gd @@ -107,13 +107,14 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul var is_hit_down: bool = attack.is_hit_down and not character_to.get_status("is_on_floor") var is_rebound: bool = attack.is_rebound - var is_break_shield: bool = false - var is_break_stun: bool = false - var is_block: bool = false - var is_kill: bool = false - var is_break_skill: bool = false - var pause_time: float = attack.pause_time - var is_remote: bool = character_from != character_from.get_character_owner() + var is_break_shield: bool = false + var is_break_stun: bool = false + var is_block: bool = false + var is_kill: bool = false + var is_break_skill: bool = false + var is_break_skill_real: bool = false + var pause_time: float = attack.pause_time + var is_remote: bool = character_from != character_from.get_character_owner() #基本伤害 var damage: float = attack.damage_rate * cfg_from.attack @@ -122,12 +123,16 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul var break_level_def: int = cfg_to.shield.break_level_on if has_shield else cfg_to.shield.break_level_off break_level_def += character_to.get_status("skill_break_level_add") var break_level_sub: int = clampi(attack.break_level - break_level_def, 0, 3) - is_break_skill = break_level_sub > 0 + is_break_skill_real = break_level_sub > 0 + is_break_skill = is_break_skill_real or not character_to.get_status("is_on_floor") if break_level_sub < 0: damage = 0 elif break_level_sub == 0: damage *= 0.5 + is_floating = is_break_skill and is_floating + is_hit_down = is_break_skill and is_hit_down + #造成伤害 if has_shield: damage = min(shield, damage) @@ -215,6 +220,8 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul hit_back_speed = max(hit_back_limit_curve.sample(dist), hit_back_speed) if is_hit_down: character_to.add_buff("hit_down", -1) + elif not is_break_skill_real: + hit_up_speed *= 0.75 character_to.set_hit_move(dir, hit_back_speed, hit_up_speed) character_to.add_buff("hit_back", attack.hit_back_duration) diff --git a/script/character/character.gd b/script/character/character.gd index 71a6da9..7efd476 100644 --- a/script/character/character.gd +++ b/script/character/character.gd @@ -28,15 +28,12 @@ func init(id: int, cfg: CharacterCfg, team: Enum.ETeam, owner_id: int): func init_after(): var cfg: CharacterCfg = status.cfg as CharacterCfg set_status("hp_max", cfg.hp_max) - set_status("hp", cfg.hp_max) set_status("shield_max", cfg.shield.shield_max) - set_status("shield", cfg.shield.shield_max) set_status("stun_max", cfg.stun.stun_max) - set_status("stun", 0) set_status("mp_max", cfg.mp.mp_max) - set_status("mp", 0) set_status("mp_sub_max", cfg.mp.mp_sub_max) - set_status("mp_sub", 0) + set_status("hp", cfg.hp_max) + set_shield(cfg.shield.shield_max) add_mp_sub(0, true) diff --git a/script/character/player/player_action.gd b/script/character/player/player_action.gd index f0abdf6..4d900bc 100644 --- a/script/character/player/player_action.gd +++ b/script/character/player/player_action.gd @@ -7,17 +7,33 @@ class_name PlayerAction @onready var combo: Combo = (%Combo as Combo) var is_lock_pressed: bool +var lock_cd_dict: Dictionary = {} func _process(delta) -> void: var has_target: bool = status.target != 0 + for key in lock_cd_dict: + if lock_cd_dict[key] > 0: + lock_cd_dict[key] -= delta + else: + lock_cd_dict.erase(key) if is_lock_pressed == has_target: return if is_lock_pressed: var enemy_list: Array[Character] = Global.character_mgr.get_enemy_list(character.id()) + var pos_player: Vector2 = character.pos2D() + enemy_list.sort_custom( + func(a: Character, b: Character): + var a_lock_cd: bool = a.id() in lock_cd_dict + var b_lock_cd: bool = b.id() in lock_cd_dict + if a_lock_cd != b_lock_cd: + return b_lock_cd + return a.pos2D().distance_squared_to(pos_player) < b.pos2D().distance_squared_to(pos_player) + ) if enemy_list: character.set_target(enemy_list[0].id()) else: + lock_cd_dict[character.target()] = 1 #1秒内无法再次锁定 character.set_target(0)