mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 08:21:54 +08:00
feat(武器系统): 重构LGBT武器和彩虹旗召唤物
调整LGBT武器属性计算公式,增加角度和数量参数 为彩虹旗召唤物添加多子弹发射和延迟发射功能 修改子弹追踪逻辑和穿透属性 更新武器描述和能量消耗
This commit is contained in:
@@ -8,7 +8,7 @@ static func fromHurtbox(node: Node) -> EntityBase:
|
||||
if entity is EntityBase:
|
||||
return entity as EntityBase
|
||||
return null
|
||||
static func findClosetEntity(to: Vector2, fromTree: SceneTree, player: bool = false, mob: bool = false, excludes: Array[EntityBase] = []) -> EntityBase:
|
||||
static func findClosetEntity(to: Vector2, fromTree: SceneTree, player: bool = false, mob: bool = false, excludes: Array[EntityBase] = [], allowSummon: bool = false) -> EntityBase:
|
||||
var result = null
|
||||
var lastDistance = INF
|
||||
var nodes = []
|
||||
@@ -18,12 +18,15 @@ static func findClosetEntity(to: Vector2, fromTree: SceneTree, player: bool = fa
|
||||
nodes += fromTree.get_nodes_in_group("mobs")
|
||||
for entity in nodes:
|
||||
if entity is EntityBase and entity not in excludes:
|
||||
if !allowSummon:
|
||||
if entity.isSummon():
|
||||
continue
|
||||
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)
|
||||
static func findClosetPlayer(to: Vector2, fromTree: SceneTree, excludes: Array[EntityBase] = [], allowSummon: bool = false) -> EntityBase:
|
||||
return findClosetEntity(to, fromTree, true, false, excludes, allowSummon)
|
||||
static func findEntityByClass(cls: String, fromTree: SceneTree) -> Array[EntityBase]:
|
||||
var results: Array[EntityBase] = []
|
||||
var nodes = fromTree.get_nodes_in_group("mobs") + fromTree.get_nodes_in_group("players")
|
||||
|
||||
Reference in New Issue
Block a user