mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-12 22:57:13 +08:00
refactor(子弹系统): 重构子弹伤害检测逻辑
将子弹伤害检测逻辑提取到BulletTool工具类中 新增SevenSoul子弹的初始属性和碰撞处理 调整hitbox位置并启用碰撞检测
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class_name BulletTool
|
||||
|
||||
static func fromArea(area: Area2D) -> BulletBase:
|
||||
if area is BulletBase:
|
||||
return area as BulletBase
|
||||
else:
|
||||
return null
|
||||
static func canDamage(bullet: BulletBase, target: EntityBase) -> bool:
|
||||
if target.currentInvinsible: return false
|
||||
if !bullet.canDamageSelf && target == bullet.launcher: return false
|
||||
if !bullet.is_node_ready() && !GameRule.allowFriendlyFire:
|
||||
if target.isPlayer() == bullet.launcher.isPlayer() and bullet.launcher.currentFocusedBoss != target: return false
|
||||
return true
|
||||
Reference in New Issue
Block a user