feat(mana): 魔力虹吸多来源(Core base + 卡组 meta.mana_leech 求和,换杖重算)
This commit is contained in:
@@ -37,6 +37,7 @@ func _core_from_dict(cid: String, d: Dictionary) -> CoreDefinition:
|
|||||||
c.edges = d.get("edges", [])
|
c.edges = d.get("edges", [])
|
||||||
c.base_mana_max = float(d.get("mana_max", 100.0))
|
c.base_mana_max = float(d.get("mana_max", 100.0))
|
||||||
c.base_mana_regen = float(d.get("mana_regen", 5.0))
|
c.base_mana_regen = float(d.get("mana_regen", 5.0))
|
||||||
|
c.base_mana_leech = float(d.get("mana_leech", 0.0))
|
||||||
return c
|
return c
|
||||||
|
|
||||||
## 默认装备(combat_test 等用):wand_basic + 第一个 ACTION 法术
|
## 默认装备(combat_test 等用):wand_basic + 第一个 ACTION 法术
|
||||||
|
|||||||
@@ -256,6 +256,11 @@ func _rebuild_wand() -> void:
|
|||||||
continue
|
continue
|
||||||
nodes.append(SpellRegistry.get_spell(sid)) # 纯数据驱动;未知 id → null(下游按位置跳过)
|
nodes.append(SpellRegistry.get_spell(sid)) # 纯数据驱动;未知 id → null(下游按位置跳过)
|
||||||
_equipped_compiled = SpellEvaluator.compile_wand(_equipped_core, nodes)
|
_equipped_compiled = SpellEvaluator.compile_wand(_equipped_core, nodes)
|
||||||
|
var leech: float = _equipped_core.base_mana_leech if _equipped_core else 0.0
|
||||||
|
for n in nodes:
|
||||||
|
if n != null:
|
||||||
|
leech += float(n.meta.get("mana_leech", 0.0))
|
||||||
|
PlayerStats.mana_leech = leech
|
||||||
|
|
||||||
# ── 法杖存档(ProfileManager A/B 槽,ADR-A2)─────────────────
|
# ── 法杖存档(ProfileManager A/B 槽,ADR-A2)─────────────────
|
||||||
func get_wand_save_data() -> Dictionary:
|
func get_wand_save_data() -> Dictionary:
|
||||||
|
|||||||
@@ -30,3 +30,4 @@ var topology: int = Topology.LINEAR
|
|||||||
## 魔力池(MVP)——由 WandPreset 从 cores.json 读入
|
## 魔力池(MVP)——由 WandPreset 从 cores.json 读入
|
||||||
@export var base_mana_max: float = 100.0
|
@export var base_mana_max: float = 100.0
|
||||||
@export var base_mana_regen: float = 5.0 # 每秒回复
|
@export var base_mana_regen: float = 5.0 # 每秒回复
|
||||||
|
@export var base_mana_leech: float = 0.0 # 击杀回蓝基础值(可叠加卡组内 meta.mana_leech)
|
||||||
|
|||||||
Reference in New Issue
Block a user