1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Tools/BulletTool.gd
T

14 lines
491 B
GDScript
Raw Normal View History

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 !GameRule.allowFriendlyFire:
if target.isPlayer() == bullet.launcher.isPlayer() and bullet.launcher.currentFocusedBoss != target: return false
return true