mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
7a0cf96d7d
实现武器升华功能,包括: - 新增SublimateOption类处理升华选项 - 添加SublimateOptionHandler UI组件 - 在武器卡片中集成升华界面 - 重构武器描述生成逻辑 - 新增钻石资源消耗机制 - 优化UI布局和样式 - 修复多处类型引用错误
55 lines
1.7 KiB
GDScript
55 lines
1.7 KiB
GDScript
@tool
|
|
extends Weapon
|
|
|
|
func sublimateOptions() -> Array[SublimateOption]:
|
|
return [
|
|
SublimateOption.new("引气入体", "乾坤剑伤害+6",
|
|
func(w: Weapon, _e): w.addStoreExtra("atk", 6),
|
|
1,
|
|
CategoryStore.Quality.COMMON
|
|
),
|
|
SublimateOption.new("健体·阳", "格挡次数+1",
|
|
func(w: Weapon, _e): w.addStoreExtra("count", 1),
|
|
1,
|
|
CategoryStore.Quality.LEGENDARY
|
|
),
|
|
SublimateOption.new("健体·阴", "气力上限+1",
|
|
func(w: Weapon, _e): w.addStoreExtra("max", 1),
|
|
1,
|
|
CategoryStore.Quality.EPIC
|
|
),
|
|
SublimateOption.new("献祭", "乾坤剑伤害-8,但弹反概率+4%",
|
|
func(w: Weapon, _e):
|
|
w.addStoreExtra("atk", -10)
|
|
w.addStoreExtra("rate", 0.05),
|
|
1,
|
|
CategoryStore.Quality.RARE
|
|
),
|
|
SublimateOption.new("亏心", "扣除你的所有幸运,每点幸运增加1%弹反概率",
|
|
func(w: Weapon, e: EntityBase):
|
|
w.addStoreExtra("rate", e.fields[FieldStore.Entity.LUCK_VALUE]),
|
|
1,
|
|
CategoryStore.Quality.WASTE
|
|
),
|
|
]
|
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
|
origin["atk"] += 2 * 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(
|
|
ComponentManager.getBullet("Parrier"),
|
|
entity,
|
|
entity.texture.global_position,
|
|
entity.texture.global_position.angle_to_point(get_global_mouse_position()),
|
|
):
|
|
if bullet is ParrierBullet:
|
|
bullet.atk = readStore("atk")
|
|
bullet.maxParryTimes = readStore("count")
|
|
bullet.maxBallCount = readStore("max")
|
|
bullet.reflectRate = readStore("rate")
|
|
bullet.baseDamage = readStore("atk") * readStore("rate")
|
|
return true
|