diff --git a/components/Weapons/NuclearBomb.tscn b/components/Weapons/NuclearBomb.tscn index 3238c2e..da0c105 100644 --- a/components/Weapons/NuclearBomb.tscn +++ b/components/Weapons/NuclearBomb.tscn @@ -12,7 +12,7 @@ quality = 4 typeTopic = 2 costBeachball = 100 store = { -"atk": 200, +"atk": 10, "radius": 400.0 } storeType = { @@ -22,7 +22,6 @@ storeType = { descriptionTemplate = "倒计时10秒后对半径$radius范围的实体造成$atk点[b]无差别伤害[/b]。" needEnergy = 200.0 cooldown = 1000.0 -debugRebuild = true [node name="avatar" parent="container/info" index="0"] texture = ExtResource("2_5nh8i") @@ -45,4 +44,4 @@ typeTopicColorMap = { } [node name="description" parent="container" index="2"] -text = "[center]倒计时10秒后对半径[color=cyan]400[/color]→[color=yellow]1020[/color]范围的实体造成[color=cyan]200[/color]→[color=yellow]45[/color]点[b]无差别伤害[/b]。[/center]" +text = "[center]倒计时10秒后对半径[color=cyan]400[/color]→[color=yellow]420[/color]范围的实体造成[color=cyan]200[/color]→[color=yellow]225[/color]点[b]无差别伤害[/b]。[/center]" diff --git a/scripts/Contents/Bullets/NuclearBomb.gd b/scripts/Contents/Bullets/NuclearBomb.gd index 7b0e3de..196df0a 100644 --- a/scripts/Contents/Bullets/NuclearBomb.gd +++ b/scripts/Contents/Bullets/NuclearBomb.gd @@ -20,4 +20,5 @@ func ai(): func destroy(_b): EffectController.create(preload("res://components/Effects/NuclearExplosion.tscn"), global_position).shot() hitbox.disabled = false + CameraManager.shake(5000, 250, func(_c, t, r): return t * r) # 震屏强度随进度递减 await TickTool.frame(5) diff --git a/scripts/Tools/CameraManager.gd b/scripts/Tools/CameraManager.gd index ecbfff8..07c65e1 100644 --- a/scripts/Tools/CameraManager.gd +++ b/scripts/Tools/CameraManager.gd @@ -15,9 +15,14 @@ func _physics_process(_delta): position = UIState.player.position position += MathTool.randv2_range(shakeIntensity) -static func shake(millseconds: int, intensity: float = 10): - instance.shakeIntensity += intensity - await TickTool.millseconds(millseconds) - instance.shakeIntensity -= intensity +static func shake(millseconds: float, intensity: float = 10, steper: Callable = func(currentValue, _totalValue, _restPercent): return currentValue): + var startTime = WorldManager.getTime() + instance.shakeIntensity = intensity + await TickTool.until( + func(): + instance.shakeIntensity = steper.call(instance.shakeIntensity, intensity, 1 - (WorldManager.getTime() - startTime) / millseconds) + return WorldManager.getTime() - startTime >= millseconds + ) + instance.shakeIntensity = 0 static func playAnimation(animation: String): instance.animator.play(animation)