1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Weapons/MagicMissle.gd
T
fallingshrimp 24051ce9e2 fix(武器): 修正魔法导弹法杖的生成数量问题
将魔法导弹法杖的生成数量从随机1~3枚固定为1枚,并更新相关描述文本。同时调整了测试用的波次配置,将调试模式下的波次改为测试BOSS波次。
2026-04-18 08:35:48 +08:00

36 lines
1.2 KiB
GDScript

@tool
extends Weapon
var roundBullets: Array[MagicMissleBullet] = []
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 1 * to * soulLevel
origin["cursor-m"] += 0.2 * to * soulLevel
origin["missle-m"] += 0.02 * to * soulLevel
origin["track"] += 1 * to * soulLevel
origin["G"] *= 1.25 ** (soulLevel - 1)
origin["count"] += 1 * (soulLevel - 1)
return origin
func loopStart(entity: EntityBase):
for bullet in BulletBase.generate(
ComponentManager.getBullet("MagicMissle"),
entity,
get_global_mouse_position() + Vector2.from_angle(randf_range(0, 2 * PI)) * readStore("track"),
0
):
if bullet is MagicMissleBullet:
bullet.look_at(get_global_mouse_position())
bullet.rotation += PI / 2
bullet.speedV2 += Vector2.from_angle(bullet.rotation) * sqrt((readStore("G") * readStore("cursor-m") / readStore("track") ** 2) * readStore("track")) / 120
bullet.roundBullets = roundBullets
bullet.baseDamage = readStore("atk")
bullet.powerScale = readStore("count")
roundBullets.append(bullet)
return true
func loopExit(_entity: EntityBase):
for bullet in roundBullets:
if is_instance_valid(bullet):
bullet.accelerating = false
roundBullets.clear()