mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
1071e87da6
实现武器升华选项系统,允许为武器添加可选的强化效果。主要修改包括: 1. 新增 SublimateOption 类用于定义升华选项 2. 在 Weapon 类中添加 storeExtra 字典和相关方法用于存储额外属性 3. 为 Tree 武器实现具体的升华选项 4. 添加调试标记 debugRebuild
39 lines
1.5 KiB
GDScript
39 lines
1.5 KiB
GDScript
@tool
|
|
extends Weapon
|
|
|
|
func sublimateOptions() -> Array[SublimateOption]:
|
|
return [
|
|
SublimateOption.new("健体·阳", "格挡次数+1", func(w: Weapon, _e): w.addStoreExtra("count", 1)),
|
|
SublimateOption.new("健体·阴", "气力上限+1", func(w: Weapon, _e): w.addStoreExtra("max", 1)),
|
|
SublimateOption.new("引气入体", "乾坤剑伤害+6", func(w: Weapon, _e): w.addStoreExtra("atk", 6)),
|
|
SublimateOption.new("献祭", "乾坤剑伤害-8,但弹反概率+4%",
|
|
func(w: Weapon, _e):
|
|
w.addStoreExtra("atk", -10)
|
|
w.addStoreExtra("rate", 0.05),
|
|
),
|
|
SublimateOption.new("亏心", "扣除你的所有幸运,每点幸运增加1%弹反概率",
|
|
func(w: Weapon, e: EntityBase):
|
|
w.addStoreExtra("rate", e.fields[FieldStore.Entity.LUCK_VALUE]),
|
|
),
|
|
]
|
|
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
|