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/BigLaser.gd
T
fallingshrimp af5d4437df fix(Weapons/BigLaser): 修复executeAtk从硬编码值改为读取配置
将BigLaser武器的executeAtk属性从硬编码值1改为从readStoreExtra读取配置,使其能够根据实际配置调整攻击执行参数
2026-05-10 15:04:17 +08:00

64 lines
1.7 KiB
GDScript

@tool
extends Weapon
class_name BigLaserWeapon
func sublimateOptions() -> Array[SublimateOption]:
return [
SublimateOption.new(
"湮灭强化",
"伤害+15",
func(w: Weapon, _e):
w.addStoreExtra("atk", 15),
1,
CategoryStore.Quality.COMMON
),
SublimateOption.new(
"高频激荡",
"间隔-0.01秒",
func(w: Weapon, _e):
w.addStoreExtra("time", -0.01),
1,
CategoryStore.Quality.RARE
),
SublimateOption.new(
"临界斩杀",
"对生命值低于30%的敌人,伤害+25%",
func(w: Weapon, _e):
w.addStoreExtra("executeAtk", 0.25),
1,
CategoryStore.Quality.EPIC
),
SublimateOption.new(
"蓄能聚焦",
"射线伤害+30,但伤害间隔+0.03秒",
func(w: Weapon, _e):
w.addStoreExtra("atk", 30)
w.addStoreExtra("time", 0.03),
1,
CategoryStore.Quality.LEGENDARY
),
SublimateOption.new(
"空间撕裂",
"射线持续时间+0.3秒",
func(w: Weapon, _e):
w.addStoreExtra("duration", 0.3),
2,
CategoryStore.Quality.COMMON
),
]
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 5 * to * soulLevel
origin["time"] /= 1 + 0.05 * to * soulLevel
return origin
func attack(entity: EntityBase):
var weaponPos = entity.findWeaponAnchor("normal")
for bullet in BulletBase.generate(ComponentManager.getBullet("BigLaser"), entity, weaponPos, (get_global_mouse_position() - weaponPos).angle()):
var bigLaser: BigLaser = bullet
bigLaser.dotTime = readStore("time") * 1000
bigLaser.baseDamage = readStore("atk")
bigLaser.executeAtk = readStoreExtra("executeAtk")
await TickTool.frame()
bigLaser.animator.speed_scale = 5 / (5 + readStoreExtra("duration"))
return true