1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/Bow.gd
T
fallingshrimp 31d344e50a feat(武器): 为弓武器添加生命汲取和升华选项
添加生命汲取效果,使箭矢命中时回复生命值
实现弓武器的升华系统,包含5种不同品质的强化选项
调整攻击逻辑以支持升华效果和生命值相关的伤害加成
2026-05-10 15:31:40 +08:00

28 lines
680 B
GDScript

extends BulletBase
class_name Bow
var count: int = 0
var atk: float = 0
var waitTime: float = 2000
var lifesteal: float = 0.2
func spawn():
var startAngle = rotation - deg_to_rad(count * 10.0 / 2)
for c in count:
for bullet in BulletBase.generate(
ComponentManager.getBullet("Arrow"),
launcher,
position,
startAngle
):
if bullet is Arrow:
bullet.atk = atk
bullet.waitTime = waitTime
bullet.offsetRotation = deg_to_rad(c * 10.0)
bullet.lifesteal = lifesteal
await TickTool.millseconds(waitTime)
tryDestroy()
func ai():
PresetBulletAI.lockLauncher(self , launcher, true)
rotation = position.angle_to_point(launcher.currentFocusedPosition)