1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-24 20:42:30 +08:00

feat(武器): 增强酸风武器功能并优化代码

- 为磷酸子弹添加追踪功能
- 移除碳酸子弹的散射效果
- 增加硫酸子弹的最大溅射数量
- 优化变量类型声明
- 更新武器描述文本以反映新功能
This commit is contained in:
2026-01-24 07:53:06 +08:00
parent e21f918380
commit 5aba62cdbc
4 changed files with 21 additions and 13 deletions
+6 -6
View File
@@ -18,7 +18,7 @@ store = {
"cl-speed": 0.001, "cl-speed": 0.001,
"n-atk": 1.0, "n-atk": 1.0,
"p-offset": 0.1, "p-offset": 0.1,
"s-count-max": 3.0, "s-count-max": 4.0,
"weakatk": 0.25 "weakatk": 0.25
} }
storeType = { storeType = {
@@ -35,8 +35,8 @@ descriptionTemplate = "高速随机喷射以下五种[b]酸[/b]之一,强酸
[color=green][b]硫酸[/b][/color]:命中时溅射1~$s-count-max滴[b]硫酸[/b]。 [color=green][b]硫酸[/b][/color]:命中时溅射1~$s-count-max滴[b]硫酸[/b]。
[color=lightblue][b]硝酸[/b][/color]:额外造成$n-atk点伤害。 [color=lightblue][b]硝酸[/b][/color]:额外造成$n-atk点伤害。
[color=lightyellow][b]盐酸[/b][/color]:使敌人 [i]移动速度[/i] 降低$cl-speed[i]攻击速度[/i] 降低$cl-atkspeed。 [color=lightyellow][b]盐酸[/b][/color]:使敌人 [i]移动速度[/i] 降低$cl-speed[i]攻击速度[/i] 降低$cl-atkspeed。
[color=pink][b]碳酸[/b][/color]:可无限穿透,碰撞体积会越来越大,但飞行速度稍慢且有额外散射 [color=pink][b]碳酸[/b][/color]不会发生散射,可无限穿透,碰撞体积会越来越大,但飞行速度稍慢。
[color=orange][b]磷酸[/b][/color]:使敌人 [i]散射角[/i] 增加$p-offset。" [color=orange][b]磷酸[/b][/color]:使敌人 [i]散射角[/i] 增加$p-offset,可无限追踪。"
cooldown = 0.0 cooldown = 0.0
debugRebuild = true debugRebuild = true
@@ -53,8 +53,8 @@ typeTopic = 3
[node name="description" parent="container" index="2"] [node name="description" parent="container" index="2"]
text = "[center]高速随机喷射以下五种[b]酸[/b]之一,强酸可造成[color=cyan]0.50[/color]点伤害,弱酸造成[color=cyan]0.25[/color]点伤害。 text = "[center]高速随机喷射以下五种[b]酸[/b]之一,强酸可造成[color=cyan]0.50[/color]点伤害,弱酸造成[color=cyan]0.25[/color]点伤害。
[color=green][b]硫酸[/b][/color]:命中时溅射1~[color=cyan]3[/color]滴[b]硫酸[/b]。 [color=green][b]硫酸[/b][/color]:命中时溅射1~[color=cyan]4[/color]滴[b]硫酸[/b]。
[color=lightblue][b]硝酸[/b][/color]:额外造成[color=cyan]1[/color]点伤害。 [color=lightblue][b]硝酸[/b][/color]:额外造成[color=cyan]1[/color]点伤害。
[color=lightyellow][b]盐酸[/b][/color]:使敌人 [i]移动速度[/i] 降低[color=cyan]0.1%[/color][i]攻击速度[/i] 降低[color=cyan]0.1%[/color]。 [color=lightyellow][b]盐酸[/b][/color]:使敌人 [i]移动速度[/i] 降低[color=cyan]0.1%[/color][i]攻击速度[/i] 降低[color=cyan]0.1%[/color]。
[color=pink][b]碳酸[/b][/color]:可无限穿透,碰撞体积会越来越大,但飞行速度稍慢且有额外散射 [color=pink][b]碳酸[/b][/color]不会发生散射,可无限穿透,碰撞体积会越来越大,但飞行速度稍慢。
[color=orange][b]磷酸[/b][/color]:使敌人 [i]散射角[/i] 增加[color=cyan]0.1°[/color]。[/center]" [color=orange][b]磷酸[/b][/color]:使敌人 [i]散射角[/i] 增加[color=cyan]0.1°[/color],可无限追踪。[/center]"
+3 -3
View File
@@ -7,9 +7,9 @@ enum AcidType {
} }
@export var acidType: AcidType = AcidType.STRONG @export var acidType: AcidType = AcidType.STRONG
var arg1: float = 0 var arg1 = 0
var arg2: float = 0 var arg2 = 0
var arg3: float = 0 var arg3 = 0
func register(): func register():
scale.y *= MathTool.randomChoiceFrom([-1, 1]) scale.y *= MathTool.randomChoiceFrom([-1, 1])
+5 -1
View File
@@ -2,4 +2,8 @@ extends AcidBulletBase
class_name AcidP class_name AcidP
func succeedToHit(_dmg: float, entity: EntityBase): func succeedToHit(_dmg: float, entity: EntityBase):
entity.fields[FieldStore.Entity.OFFSET_SHOOT] = clamp(entity.fields[FieldStore.Entity.OFFSET_SHOOT] + arg1, 0, INF) entity.fields[FieldStore.Entity.OFFSET_SHOOT] = clamp(entity.fields[FieldStore.Entity.OFFSET_SHOOT] + arg1, 0, INF)
func ai():
super.ai()
if is_instance_valid(arg2):
PresetBulletAI.trace(self, arg2.position, 0.01)
+7 -3
View File
@@ -14,11 +14,14 @@ func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["weakatk"] = 0.05 * soulLevel origin["weakatk"] = 0.05 * soulLevel
return origin return origin
func attack(entity: EntityBase): func attack(entity: EntityBase):
var acid = MathTool.randomChoiceFrom(acids)
for bullet in BulletBase.generate( for bullet in BulletBase.generate(
ComponentManager.getBullet(MathTool.randomChoiceFrom(acids)), ComponentManager.getBullet(acid),
entity, entity,
entity.findWeaponAnchor("normal"), entity.findWeaponAnchor("normal"),
(get_global_mouse_position() - entity.findWeaponAnchor("normal")).angle() (get_global_mouse_position() - entity.findWeaponAnchor("normal")).angle(),
true,
acid == "AcidC"
): ):
if bullet is AcidBulletBase: if bullet is AcidBulletBase:
if bullet.acidType == AcidBulletBase.AcidType.STRONG: if bullet.acidType == AcidBulletBase.AcidType.STRONG:
@@ -34,5 +37,6 @@ func attack(entity: EntityBase):
bullet.arg2 = readStore("cl-atkspeed") bullet.arg2 = readStore("cl-atkspeed")
if bullet is AcidP: if bullet is AcidP:
bullet.arg1 = readStore("p-offset") bullet.arg1 = readStore("p-offset")
bullet.arg2 = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer())
if bullet is AcidC: if bullet is AcidC:
bullet.rotation += deg_to_rad(randf_range(-1, 1) * 15) pass