1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-30 16:01:53 +08:00

feat(ChainGun): 为链式机枪添加子弹数量属性并调整子弹生成逻辑

修改链式机枪的武器脚本、场景配置和子弹脚本,新增count属性控制子弹数量
子弹生成时根据count值调整位置分布,同时更新UI描述文本
This commit is contained in:
2025-09-21 22:36:45 +08:00
parent 502ef15198
commit 12b815a6f3
3 changed files with 18 additions and 5 deletions
+8 -3
View File
@@ -1,9 +1,14 @@
extends BulletBase
var count: int = 1
@onready var anchor: Node2D = $"%anchor"
func spawn():
for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), launcher, anchor.global_position, rotation):
i.damage = damage
for j in count:
for i in BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), launcher, anchor.global_position, rotation):
i.damage = damage
var dir = Vector2.from_angle(i.rotation).rotated(deg_to_rad(-90))
i.global_position += dir * (count - j * 2) * 20 / 2
func ai():
PresetBulletAI.lockLauncher(self, launcher, true)
PresetBulletAI.lockLauncher(self, launcher, true)