1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-30 16:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Weapons/BlueCrystal.gd
T
fallingshrimp 311bc79252 feat(武器系统): 新增蓝水晶武器及其子弹效果
实现蓝水晶武器系统,包含追踪子弹和环绕钻石效果
- 添加蓝水晶武器及配套子弹资源
- 实现子弹追踪逻辑和钻石环绕效果
- 扩展BulletBase类支持父子弹关联
- 更新角色预设包含新武器
2025-12-13 07:55:02 +08:00

18 lines
803 B
GDScript

@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