From aec1db508821dbae285dfbc574c670821ae94bfa 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: Sun, 10 May 2026 12:14:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=AD=A6=E5=99=A8=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AD=A6=E5=99=A8=E5=8D=87=E5=8D=8E=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在Weapon.gd中添加sublimateToggled信号 - 为武器添加默认的升华选项"强化攻击" - 优化WeaponPanel.gd中的变量类型声明 - 修改Tree.gd中的描述文本使其更准确 --- scripts/Contents/Panels/WeaponPanel.gd | 2 +- scripts/Contents/Weapons/Tree.gd | 2 +- scripts/Structs/Weapon.gd | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/Contents/Panels/WeaponPanel.gd b/scripts/Contents/Panels/WeaponPanel.gd index 4512994..1877340 100644 --- a/scripts/Contents/Panels/WeaponPanel.gd +++ b/scripts/Contents/Panels/WeaponPanel.gd @@ -1,7 +1,7 @@ @tool extends FullscreenPanelBase -@onready var box = $"%box" +@onready var box: Control = $%box func beforeOpen(_args: Array = []): for weapon in UIState.player.weapons: diff --git a/scripts/Contents/Weapons/Tree.gd b/scripts/Contents/Weapons/Tree.gd index b130bac..3535786 100644 --- a/scripts/Contents/Weapons/Tree.gd +++ b/scripts/Contents/Weapons/Tree.gd @@ -25,7 +25,7 @@ func sublimateOptions() -> Array[SublimateOption]: 1, CategoryStore.Quality.RARE ), - SublimateOption.new("亏心", "扣除你的所有幸运,每点幸运增加1%弹反概率", + SublimateOption.new("亏心", "消耗所有幸运,每点幸运增加1%弹反概率", func(w: Weapon, e: EntityBase): w.addStoreExtra("rate", e.fields[FieldStore.Entity.LUCK_VALUE]), 1, diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index 01a292e..a38a7de 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -9,6 +9,8 @@ enum EmitType { HOLD_LOOP } +signal sublimateToggled(on: bool) + @export var avatarTexture: Texture2D = null @export var displayName: String = "未命名武器" @export var quality: WeaponName.Quality = WeaponName.Quality.COMMON @@ -71,6 +73,7 @@ func _ready(): animator.play("openSub") else: animator.play("closeSub") + sublimateToggled.emit(on) ) autoUpdateBtn.toggled.connect( func(on: bool): @@ -299,7 +302,13 @@ func disruptSublimateOptions(): # 抽象 func sublimateOptions() -> Array[SublimateOption]: - return [] as Array[SublimateOption] + return [ + SublimateOption.new("强化攻击", "伤害+1", + func(w: Weapon, _e): w.addStoreExtra("atk", 1), + 1, + CategoryStore.Quality.COMMON + ), + ] func update(_to: int, origin: Dictionary, _entity: EntityBase): return origin func loopStart(_entity: EntityBase):