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/Volcano.gd
T
fallingshrimp 53d1be6749 refactor(Volcano bullet): 优化火山弹相关逻辑
1. 新增spawn方法并设置可切割属性
2. 调整命中时的冲量大小从500改为400
3. 为动画添加hitbox显隐切换轨道
2026-05-11 22:11:31 +08:00

38 lines
964 B
GDScript

extends BulletBase
class_name Volcano
@onready var textureSword: Sprite2D = $%textureSword
@onready var anchor: Node2D = $%anchor
var rotates: float = 0
var count: int = 0
var dmg5: float = 0
var splitAngle: float = 10
func spawn():
setupCuttable(0.2)
func ai():
PresetBulletAI.lockLauncher(self , launcher, true)
rotation = lerp_angle(
rotation,
position.angle_to_point(launcher.currentFocusedPosition),
rotates
)
func succeedToHit(_dmg: float, entity: EntityBase):
entity.impluse((entity.getTrackingAnchor() - position).normalized() * 400)
ParryEntityEffect.createEffectEntity(entity, self )
func generateShadow():
var startAngle = rotation - deg_to_rad(count * splitAngle / 2)
for i in count:
for bullet in BulletBase.generate(
ComponentManager.getBullet("VolcanoShadow"),
launcher,
position,
startAngle + i * deg_to_rad(splitAngle),
true,
true
):
if bullet is VolcanoShadow:
bullet.baseDamage = baseDamage * dmg5