From 88a0a18d7e068ec2a4197cb1bc32e4226c55212e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Wed, 25 Mar 2026 22:15:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AD=A6=E5=99=A8):=20=E4=B8=BA=E4=B9=BE?= =?UTF-8?q?=E5=9D=A4=E5=89=91=E6=B7=BB=E5=8A=A0=E5=BC=B9=E5=8F=8D=E6=9C=BA?= =?UTF-8?q?=E5=88=B6=E5=92=8C=E4=BC=A4=E5=AE=B3=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加子弹弹反概率和伤害比例属性 修改武器描述以反映新机制 更新子弹碰撞逻辑实现弹反或格挡 --- components/Weapons/Tree.tscn | 22 ++++++++++++---------- scripts/Contents/Bullets/Parrier.gd | 14 ++++++++++---- scripts/Contents/Wave.gd | 2 +- scripts/Contents/Weapons/Tree.gd | 2 ++ 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/components/Weapons/Tree.tscn b/components/Weapons/Tree.tscn index 3598bb2..8f69a14 100644 --- a/components/Weapons/Tree.tscn +++ b/components/Weapons/Tree.tscn @@ -15,22 +15,24 @@ oneShoot = true store = { "atk": 20, "count": 1.0, -"max": 3.0 +"max": 3.0, +"rate": 0.25 } storeType = { "atk": 1, "count": 1, -"max": 1 +"max": 1, +"rate": 2 } descriptionTemplate = "进行[b]格挡[/b],化解飞来的子弹。 每成功格挡一次,获得一点[b]气力[/b]。 -每拥有一点气力,增加[color=yellow]1[/color]点冲刺初速度,闪避穿过敌人时对其贴上一层[b]符咒[/b],一段时间后符咒自动引爆, -召唤[b]乾坤剑[/b]穿透敌人。 +每拥有一点气力,增加[color=yellow]1[/color]点冲刺初速度,闪避穿过敌人时对其贴上一层[b]符咒[/b],符咒会自动引爆,召唤[b]乾坤剑[/b]穿透敌人。 +每次格挡有$rate的概率弹反,子弹弹反后造成乾坤剑的$rate伤害。 +每次格挡最多化解$count个子弹, +体内最多储存$max点气力。 每化解[color=yellow]1[/color]点伤害, 乾坤剑造成的伤害+$atk点。 -每次格挡最多化解$count个子弹, -体内最多储存$max点气力, 格挡时机越精确,成功率越高。" cooldown = 250.0 debugRebuild = true @@ -49,11 +51,11 @@ typeTopic = 3 [node name="description" parent="container" index="2"] text = "[center]进行[b]格挡[/b],化解飞来的子弹。 每成功格挡一次,获得一点[b]气力[/b]。 -每拥有一点气力,增加[color=yellow]1[/color]点冲刺初速度,闪避穿过敌人时对其贴上一层[b]符咒[/b],一段时间后符咒自动引爆, -召唤[b]乾坤剑[/b]穿透敌人。 +每拥有一点气力,增加[color=yellow]1[/color]点冲刺初速度,闪避穿过敌人时对其贴上一层[b]符咒[/b],符咒会自动引爆,召唤[b]乾坤剑[/b]穿透敌人。 +每次格挡有[color=cyan]25.0%[/color]的概率弹反,子弹弹反后造成乾坤剑的[color=cyan]25.0%[/color]伤害。 +每次格挡最多化解[color=cyan]1[/color]个子弹, +体内最多储存[color=cyan]3[/color]点气力。 每化解[color=yellow]1[/color]点伤害, 乾坤剑造成的伤害+[color=cyan]20[/color]点。 -每次格挡最多化解[color=cyan]1[/color]个子弹, -体内最多储存[color=cyan]3[/color]点气力, 格挡时机越精确,成功率越高。[/center]" diff --git a/scripts/Contents/Bullets/Parrier.gd b/scripts/Contents/Bullets/Parrier.gd index 775f1ba..8c1e908 100644 --- a/scripts/Contents/Bullets/Parrier.gd +++ b/scripts/Contents/Bullets/Parrier.gd @@ -7,6 +7,7 @@ var parryiedTimes: int = 0 var maxParryTimes: int = 1 var maxBallCount: int = 3 var atk: float = 0 +var reflectRate: float = 0.25 func spawn(): var varians = randi_range(0, 2) @@ -30,10 +31,15 @@ func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞 eff.shot() CameraManager.shake(250, 300) launcher.impluse((position - bullet.position).normalized() * (bullet.speed * bullet.getDamage()) ** (1.0 / 3) * 250) - # 弹反 - bullet.look_at(bullet.launcher.position) - bullet.launcher = launcher - bullet.baseDamage *= atk + # 弹反 还是 格挡? + if MathTool.rate(reflectRate): + bullet.look_at(bullet.launcher.position) + bullet.launcher = launcher + bullet.baseDamage *= atk + bullet.baseDamage *= reflectRate + bullet.lifeTime *= 2 + else: + bullet.tryDestroy() var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100) if len(cycler.bullets) < maxBallCount: # 玩家最多只能拥有多少气 for b in BulletBase.generate( diff --git a/scripts/Contents/Wave.gd b/scripts/Contents/Wave.gd index 049645e..b3b5ef9 100644 --- a/scripts/Contents/Wave.gd +++ b/scripts/Contents/Wave.gd @@ -50,7 +50,7 @@ static var WAVE_JUSTJOKE = [ Wave.create("Kernyr", 0, 0, true, 0, INF, 1), ] static var WAVE_EMPTY = [] -static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_JUSTJOKE +static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_TESTBOSS_KUKE static func create( entity_: String, diff --git a/scripts/Contents/Weapons/Tree.gd b/scripts/Contents/Weapons/Tree.gd index 36fb0a6..a9b1dbb 100644 --- a/scripts/Contents/Weapons/Tree.gd +++ b/scripts/Contents/Weapons/Tree.gd @@ -5,6 +5,7 @@ func update(to: int, origin: Dictionary, _entity: EntityBase): origin["atk"] += 5 * to * soulLevel origin["count"] += 1 * (soulLevel - 1) origin["max"] += 2 * (soulLevel - 1) + origin["rate"] += 0.15 * (soulLevel - 1) return origin func attack(entity: EntityBase): for bullet in BulletBase.generate( @@ -17,4 +18,5 @@ func attack(entity: EntityBase): bullet.atk = readStore("atk") bullet.maxParryTimes = readStore("count") bullet.maxBallCount = readStore("max") + bullet.reflectRate = readStore("rate") return true