1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-03 09:51:53 +08:00

feat(角色): 添加猫头鹰角色MTY及其冲刺攻击能力

添加新角色MTY(猫头鹰)及其专属子弹MTYSprint
- 实现MTY角色的基本属性和AI行为
- 添加MTYSprint子弹类型及碰撞检测
- 在Wave.gd中添加MTY的生成配置
- 扩展BulletTool工具类添加查找最近子弹功能
This commit is contained in:
2025-12-07 17:04:47 +08:00
parent 4fc1daae0d
commit 3dd5f06bbe
8 changed files with 67 additions and 1 deletions
+17
View File
@@ -12,3 +12,20 @@ static func canDamage(bullet: BulletBase, target: EntityBase) -> bool:
if !GameRule.allowFriendlyFire:
if target.isPlayer() == bullet.launcher.isPlayer() and bullet.launcher.currentFocusedBoss != target: return false
return true
static func findClosetBullet(to: Vector2, fromTree: SceneTree) -> BulletBase:
var result: BulletBase = null
var lastDistance = INF
for bullet in fromTree.get_nodes_in_group("bullets"):
if to.distance_to(bullet.position) < lastDistance:
lastDistance = to.distance_to(bullet.position)
result = bullet
return result
static func findClosetBulletCanDamage(to: Vector2, fromTree: SceneTree, target: EntityBase) -> BulletBase:
var result: BulletBase = null
var lastDistance = INF
for bullet in fromTree.get_nodes_in_group("bullets"):
if canDamage(bullet, target):
if to.distance_to(bullet.position) < lastDistance:
lastDistance = to.distance_to(bullet.position)
result = bullet
return result