1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Tools/BulletTool.gd
T
fallingshrimp c5d58a14f7 feat(武器): 添加白色灵魂武器及相关资源
添加新的白色灵魂武器,包括脚本、场景和资源文件
修改公鸡角色配置以使用新武器
优化子弹工具类和白色灵魂子弹的行为
添加获取窗口大小的工具方法
2025-09-29 22:33:56 +08:00

14 lines
491 B
GDScript

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