1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(武器系统): 为链式枪和紫水晶子弹添加能量循环机制

- 在紫水晶子弹类中添加能量循环相关变量和方法
- 修改链式枪子弹生成逻辑以传递能量循环属性
- 为链式枪武器添加5个新的升华选项,包括能量回收功能
- 更新攻击方法以处理新增的穿透和能量循环属性
This commit is contained in:
2026-05-10 15:47:31 +08:00
parent 31d344e50a
commit dd586e89c7
3 changed files with 76 additions and 13 deletions
+13 -7
View File
@@ -1,21 +1,27 @@
extends BulletBase
class_name ChainGunBullet
var count: int = 0
var splits: float = 0
var cycleRate: float = 0
var cycleCount: float = 0
@onready var anchor: Node2D = $"%anchor"
func spawn():
for j in count:
for i in BulletBase.generate(
for i in count:
for bullet in BulletBase.generate(
ComponentManager.getBullet("PurpleCrystalSmall"),
launcher,
anchor.global_position,
rotation + deg_to_rad(splits * randf_range(-1, 1))
):
if i is BulletBase:
var dir = Vector2.from_angle(i.rotation).rotated(deg_to_rad(-90))
i.baseDamage = baseDamage
i.position += dir * (count - j * 2) * 10 / 2
if bullet is PurpleCrystalBullet:
var dir = Vector2.from_angle(bullet.rotation).rotated(deg_to_rad(-90))
bullet.baseDamage = baseDamage
bullet.position += dir * (count - i * 2) * 10 / 2
bullet.penerate += penerate
bullet.cycleRate = cycleRate
bullet.cycleCount = cycleCount
func ai():
PresetBulletAI.lockLauncher(self, launcher, true)
PresetBulletAI.lockLauncher(self , launcher, true)
+10 -1
View File
@@ -1,8 +1,17 @@
extends BulletBase
class_name PurpleCrystalBullet
var cycleRate: float = 0
var cycleCount: float = 0
var cycled: bool = false
func ai():
PresetBulletAI.forward(self, rotation)
PresetBulletAI.forward(self , rotation)
func destroy(_beacuseMap: bool):
var eff = EffectController.create(ComponentManager.getEffect("PurpleCrystalExplosion"), global_position)
eff.rotation = rotation
eff.shot()
func succeedToHit(_dmg: float, entity: EntityBase):
if MathTool.rate(cycleRate):
entity.storeEnergy(cycleCount)
cycled = true