mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 16:31:54 +08:00
feat: 添加武器升华系统及相关UI组件
实现武器升华功能,包括: - 新增SublimateOption类处理升华选项 - 添加SublimateOptionHandler UI组件 - 在武器卡片中集成升华界面 - 重构武器描述生成逻辑 - 新增钻石资源消耗机制 - 优化UI布局和样式 - 修复多处类型引用错误
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
class_name SublimateOption
|
||||
|
||||
signal applied()
|
||||
|
||||
var displayName: String = "升华"
|
||||
var description: String = "描述"
|
||||
var executor: Callable = func(_weapon: Weapon, _entity: EntityBase): return
|
||||
var cost: int = 1
|
||||
var quality: CategoryStore.Quality = CategoryStore.Quality.COMMON
|
||||
|
||||
func _init(displayNames: String, descriptions: String, executors: Callable):
|
||||
func _init(displayNames: String, descriptions: String, executors: Callable, costs: int, qualities: CategoryStore.Quality):
|
||||
displayName = displayNames
|
||||
description = descriptions
|
||||
executor = executors
|
||||
cost = costs
|
||||
quality = qualities
|
||||
|
||||
func apply(entity: EntityBase, index: int):
|
||||
var weapon = entity.weapons[index]
|
||||
if weapon is Weapon:
|
||||
executor.call(weapon, entity)
|
||||
func apply(entity: EntityBase, weapon: Weapon):
|
||||
cost += 1
|
||||
executor.call(weapon, entity)
|
||||
applied.emit()
|
||||
|
||||
Reference in New Issue
Block a user