mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(武器系统): 添加武器升华功能并优化相关代码
- 在Weapon.gd中添加sublimateToggled信号 - 为武器添加默认的升华选项"强化攻击" - 优化WeaponPanel.gd中的变量类型声明 - 修改Tree.gd中的描述文本使其更准确
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user