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/Pipe.gd
T
fallingshrimp 6ed8278158 fix(武器/子弹): 调整子弹速度和能量衰减
修改Pipe武器的子弹速度计算方式,使用平方根函数平滑速度增长
将Pipe子弹命中后的能量衰减系数从0.8改为0.6,加快能量消耗
2026-02-11 17:20:54 +08:00

21 lines
537 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 = sqrt(e)
return true