1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-11 06:07:12 +08:00

refactor(Characters/Rooster): 调整子弹折射和分裂参数

移除子弹分裂参数,将子弹折射次数从2增加到3
更新武器从ChainGun到PurpleCrystal
优化子弹折射逻辑,避免重复目标
使用call_deferred安全添加子节点
This commit is contained in:
2026-01-17 13:22:10 +08:00
parent ef6e21de78
commit 6e7272d7d9
4 changed files with 19 additions and 8 deletions
+14 -3
View File
@@ -152,19 +152,30 @@ func trySplit():
var cloned = duplicate() as BulletBase
cloned.rotation = deg_to_rad(360.0 / total * i)
cloned.isChildSplit = true
get_parent().add_child(split(cloned, i, total, last))
cloned.launcher = launcher
cloned.parent = parent
get_parent().add_child.call_deferred(split(cloned, i, total, last))
func tryRefract():
if is_instance_valid(launcher) and !isChildRefract:
var value = launcher.fields.get(FieldStore.Entity.BULLET_REFRACTION)
var total = MathTool.shrimpRate(value)
var last = value - floor(value)
var aimed: Array[EntityBase] = []
for i in total:
var entity = EntityTool.findClosetEntity(position, get_tree(), !launcher.isPlayer(), launcher.isPlayer(), [launcher])
var entity = EntityTool.findClosetEntity(
position, get_tree(),
!launcher.isPlayer(),
launcher.isPlayer(),
[launcher] + aimed
)
if is_instance_valid(entity):
aimed.append(entity)
var cloned = duplicate() as BulletBase
cloned.look_at(entity.position)
cloned.isChildRefract = true
get_parent().add_child(refract(cloned, entity, i, total, last))
cloned.launcher = launcher
cloned.parent = parent
get_parent().add_child.call_deferred(refract(cloned, entity, i, total, last))
# 抽象方法
func firstFrame():