1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-04 10:47:13 +08:00

feat(武器系统): 新增蓝水晶武器及其子弹效果

实现蓝水晶武器系统,包含追踪子弹和环绕钻石效果
- 添加蓝水晶武器及配套子弹资源
- 实现子弹追踪逻辑和钻石环绕效果
- 扩展BulletBase类支持父子弹关联
- 更新角色预设包含新武器
This commit is contained in:
2025-12-13 07:55:02 +08:00
parent d8fcc8eb38
commit 311bc79252
11 changed files with 212 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
extends BulletBase
class_name BlueCrystalBullet
var tracer: EntityBase = null
@onready var trail: GPUParticles2D = $%trail
func ai():
if is_instance_valid(tracer):
var tracker = tracer.getTrackingAnchor()
var targetAngle = position.angle_to_point(tracker)
trail.rotation = - Vector2.from_angle(rotation).angle_to(Vector2.from_angle(targetAngle)) * 0.75 / (speed / initialSpeed)
PresetBulletAI.trace(self, tracker, 0.05)
else:
trail.rotation = 0
speed += 0.1
PresetBulletAI.forward(self, rotation)
@@ -0,0 +1 @@
uid://d1031p38h24tw
+6
View File
@@ -0,0 +1,6 @@
extends BulletBase
class_name Diamond2Bullet
func ai():
if is_instance_valid(parent):
position = parent.position
+1
View File
@@ -0,0 +1 @@
uid://c1ywds8xwerm3
+17
View File
@@ -0,0 +1,17 @@
@tool
extends Weapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 1 * to * soulLevel
origin["count"] = 1 * soulLevel
return origin
func attack(entity: EntityBase):
for i in BulletBase.generate(ComponentManager.getBullet("BlueCrystal"), entity, entity.findWeaponAnchor("normal"), deg_to_rad(randf_range(0, 360))):
if i is BlueCrystalBullet:
i.tracer = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer())
i.baseDamage = readStore("atk")
for index in readStore("count"):
for j in BulletBase.generate(ComponentManager.getBullet("Diamond2"), entity, i.position, deg_to_rad(360.0 / readStore("count") * index)):
if j is Diamond2Bullet:
j.baseDamage = readStore("atk")
j.parent = i
@@ -0,0 +1 @@
uid://8xlc5upq36n7