mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-03 18:27:13 +08:00
feat: 添加新武器彩虹旗和紫水晶簇,调整饲料属性和数值
refactor: 重构子弹生成逻辑,支持分裂和折射效果 fix: 修复掉落物拾取范围和碰撞检测问题 style: 优化UI显示,添加武器品质和类型标签 docs: 更新字段描述,调整部分饲料名称和分类 perf: 优化数学工具函数,添加随机数处理工具 test: 调整波次生成逻辑,添加新敌人类型 build: 添加新资源文件和相关导入配置
This commit is contained in:
@@ -7,4 +7,20 @@ static func fromHurtbox(node: Node) -> EntityBase:
|
||||
var entity = texture.get_parent()
|
||||
if entity is EntityBase:
|
||||
return entity as EntityBase
|
||||
return null
|
||||
return null
|
||||
static func findClosetEntity(to: Vector2, fromTree: SceneTree, player: bool = false, mob: bool = false, excludes: Array[EntityBase] = []) -> EntityBase:
|
||||
var result = null
|
||||
var lastDistance = INF
|
||||
var nodes = []
|
||||
if player:
|
||||
nodes += fromTree.get_nodes_in_group("players")
|
||||
if mob:
|
||||
nodes += fromTree.get_nodes_in_group("mobs")
|
||||
for entity in nodes:
|
||||
if entity is EntityBase and entity not in excludes:
|
||||
if to.distance_to(entity.position) < lastDistance:
|
||||
lastDistance = to.distance_to(entity.position)
|
||||
result = entity
|
||||
return result
|
||||
static func findClosetPlayer(to: Vector2, fromTree: SceneTree, excludes: Array[EntityBase] = []) -> EntityBase:
|
||||
return findClosetEntity(to, fromTree, true, false, excludes)
|
||||
|
||||
Reference in New Issue
Block a user