mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(SevenSoul): 增强七魂武器功能并修复子弹伤害逻辑
为七魂武器添加攻击力属性并调整伤害和治疗机制 修复子弹工具中空引用检查缺失的问题 移除子弹基类中冗余的空检查逻辑 更新武器描述以反映新功能 调整子弹粒子效果和伤害计算方式
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
extends BulletBase
|
||||
class_name SevenSoulBullet
|
||||
|
||||
var colors = [
|
||||
"#2BEAFF",
|
||||
@@ -11,27 +12,19 @@ var colors = [
|
||||
var index = 0
|
||||
var generationDuration: float = 15000
|
||||
var pingAfterGeneration: float = 5000
|
||||
var energyCollect: float = 0
|
||||
var healAmount: float = 0
|
||||
|
||||
@onready var heart = $"%heart"
|
||||
@onready var effect: GPUParticles2D = $"%effect"
|
||||
|
||||
func register():
|
||||
area_entered.connect(
|
||||
func(area):
|
||||
var bullet = BulletTool.fromArea(area)
|
||||
if bullet and BulletTool.canDamage(bullet, launcher):
|
||||
launcher.storeEnergy(baseDamage * 2)
|
||||
)
|
||||
func spawn():
|
||||
modulate = Color(colors[index % colors.size()])
|
||||
effect.emitting = true
|
||||
|
||||
func ai():
|
||||
rotation_degrees = 360.0 / colors.size() * index + timeLived() / generationDuration * 360 - index / 6.0 * 360.0
|
||||
heart.global_rotation_degrees = 0
|
||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||
func applyDot():
|
||||
if timeLived() > generationDuration * ((6.0 - index) / 6.0) + pingAfterGeneration:
|
||||
BulletBase.generate(ComponentManager.getBullet("SoulBall"), launcher, heart.global_position, heart.global_position.angle_to_point(get_global_mouse_position()))
|
||||
await TickTool.millseconds(100)
|
||||
return true
|
||||
func succeedToHit(_dmg: float, _entity: EntityBase):
|
||||
launcher.storeEnergy(getDamage() * energyCollect)
|
||||
launcher.tryHeal(healAmount)
|
||||
|
||||
@@ -4,9 +4,15 @@ extends Weapon
|
||||
func attack(entity: EntityBase):
|
||||
playSound("attack")
|
||||
for i in 6:
|
||||
for j in BulletBase.generate(ComponentManager.getBullet("SevenSoul"), entity, entity.texture.global_position, 0):
|
||||
j.index = i
|
||||
for bullet in BulletBase.generate(ComponentManager.getBullet("SevenSoul"), entity, entity.texture.global_position, 0):
|
||||
if bullet is SevenSoulBullet:
|
||||
bullet.index = i
|
||||
bullet.baseDamage = readStore("atk")
|
||||
bullet.energyCollect = readStore("dmg")
|
||||
bullet.healAmount = readStore("heal")
|
||||
await TickTool.millseconds(15000 / 6.0)
|
||||
func update(to, origin, _entity):
|
||||
origin["atk"] += 1 * to * soulLevel
|
||||
origin["dmg"] += 0.02 * to * soulLevel
|
||||
origin["heal"] += 0.1 * to * soulLevel
|
||||
return origin
|
||||
|
||||
Reference in New Issue
Block a user