1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Weapons/VectorStarWeapon.gd
T
fallingshrimp 007f323482 refactor(武器系统): 重构武器能量消耗机制
移除全局武器升级能量消耗倍数,改为各武器独立设置升级能量消耗
调整矢量核心武器的属性计算和初始能量值
为所有武器类型添加升级时的能量消耗增量
2025-09-20 17:30:05 +08:00

21 lines
886 B
GDScript

@tool
extends Weapon
class_name VectorStarWeapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 5 * to * soulLevel
origin["forwardtime"] /= 1 + 0.05 * to * soulLevel
origin["mincount"] += 0.5 * to * soulLevel
origin["maxcount"] += 1.5 * to * soulLevel
needEnergy += 2
return origin
func attack(entity: EntityBase):
var weaponPos = entity.findWeaponAnchor("normal")
for i in range(int(randi_range(readStore("mincount"), readStore("maxcount")))):
for j in BulletBase.generate(preload("res://components/Bullets/VectorStar.tscn"), entity, weaponPos, deg_to_rad(randf_range(0, 360))):
var bullet: VectorStar = j
bullet.damage = readStore("atk")
bullet.tracer = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer())
bullet.forwardTime = readStore("forwardtime") * 1000
return true