1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
fallingshrimp a2b3cd407f fix(武器/管道): 限制子弹速度最大值
防止子弹速度因攻击力过高而变得不合理,将速度限制在0到30之间
2026-02-11 17:22:50 +08:00

21 lines
545 B
GDScript

@tool
extends Weapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 1 * to * soulLevel
return origin
func attack(entity: EntityBase):
var weaponPos = entity.findWeaponAnchor("normal")
for bullet in BulletBase.generate(
ComponentManager.getBullet("Pipe"),
entity,
weaponPos,
weaponPos.angle_to_point(get_global_mouse_position())
):
if bullet is PipeBullet:
var e = charged(readStore("atk"), 0.1)
bullet.baseDamage = e
bullet.energy = e
bullet.speed = clamp(e, 0, 30)
return true