1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(武器系统): 为BigLaser武器添加执行伤害和升华选项

- 在ObstacleBase和EntityBase中添加getHealthPercent方法用于获取生命值百分比
- 修改bulletHit方法支持伤害覆盖参数
- 为BigLaser武器添加5个升华选项,包括临界斩杀效果
- 实现damageOverride方法根据目标生命值动态调整伤害
- 修复store数值可能为负数的问题
This commit is contained in:
2026-05-10 14:58:05 +08:00
parent a0372f0867
commit 6b7801e1ce
6 changed files with 66 additions and 7 deletions
+8
View File
@@ -2,6 +2,7 @@ extends BulletBase
class_name BigLaser
var dotTime: float = 100
var executeAtk: float = 0.25
func spawn():
CameraManager.shake(5000, 100) # 激光会运行5秒(5000毫秒),期间震屏超高强度
@@ -17,3 +18,10 @@ func applyDot():
await TickTool.millseconds(dotTime / launcher.fields[FieldStore.Entity.ATTACK_SPEED])
await TickTool.frame() # 等至少一帧,防止跳帧导致没检测到伤害
return true
func damageOverride(origin: float, something: Variant):
if something is EntityBase:
return origin * (1 + (executeAtk if something.getHealthPercent() < 0.3 else 0.0))
elif something is ObstacleBase:
return origin * (1 + (executeAtk if something.getHealthPercent() < 0.3 else 0.0))
else:
return origin
+48
View File
@@ -2,6 +2,51 @@
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
@@ -12,4 +57,7 @@ func attack(entity: EntityBase):
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