|
|
|
@ -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_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_rebound: bool = attack.is_rebound
|
|
|
|
|
|
|
|
|
|
|
|
var is_break_shield: bool = false
|
|
|
|
var is_break_shield: bool = false
|
|
|
|
var is_break_stun: bool = false
|
|
|
|
var is_break_stun: bool = false
|
|
|
|
var is_block: bool = false
|
|
|
|
var is_block: bool = false
|
|
|
|
var is_kill: bool = false
|
|
|
|
var is_kill: bool = false
|
|
|
|
var is_break_skill: bool = false
|
|
|
|
var is_break_skill: bool = false
|
|
|
|
var pause_time: float = attack.pause_time
|
|
|
|
var is_break_skill_real: bool = false
|
|
|
|
var is_remote: bool = character_from != character_from.get_character_owner()
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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")
|
|
|
|
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)
|
|
|
|
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:
|
|
|
|
if break_level_sub < 0:
|
|
|
|
damage = 0
|
|
|
|
damage = 0
|
|
|
|
elif break_level_sub == 0:
|
|
|
|
elif break_level_sub == 0:
|
|
|
|
damage *= 0.5
|
|
|
|
damage *= 0.5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
is_floating = is_break_skill and is_floating
|
|
|
|
|
|
|
|
is_hit_down = is_break_skill and is_hit_down
|
|
|
|
|
|
|
|
|
|
|
|
#造成伤害
|
|
|
|
#造成伤害
|
|
|
|
if has_shield:
|
|
|
|
if has_shield:
|
|
|
|
damage = min(shield, damage)
|
|
|
|
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)
|
|
|
|
hit_back_speed = max(hit_back_limit_curve.sample(dist), hit_back_speed)
|
|
|
|
if is_hit_down:
|
|
|
|
if is_hit_down:
|
|
|
|
character_to.add_buff("hit_down", -1)
|
|
|
|
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.set_hit_move(dir, hit_back_speed, hit_up_speed)
|
|
|
|
character_to.add_buff("hit_back", attack.hit_back_duration)
|
|
|
|
character_to.add_buff("hit_back", attack.hit_back_duration)
|
|
|
|
|