1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Weapons/ChainGun.gd
T
fallingshrimp 12b815a6f3 feat(ChainGun): 为链式机枪添加子弹数量属性并调整子弹生成逻辑
修改链式机枪的武器脚本、场景配置和子弹脚本,新增count属性控制子弹数量
子弹生成时根据count值调整位置分布,同时更新UI描述文本
2025-09-21 22:36:45 +08:00

12 lines
434 B
GDScript

@tool
extends Weapon
func update(to, origin, _entity):
origin["atk"] += 2 * to * soulLevel
origin["count"] += 0.25 * to * soulLevel
return origin
func attack(entity: EntityBase):
for i in BulletBase.generate(ComponentManager.getBullet("ChainGun"), entity, entity.texture.global_position, (get_global_mouse_position() - entity.texture.global_position).angle()):
i.damage = readStore("atk")
i.count = floor(readStore("count"))