1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00

feat(武器系统): 完善武器获取和提炼逻辑

- 在WeaponShow.gd中修改操作标签文本为"获得武器"和"提炼灵魂"
- 在Feed.gd中添加武器获取逻辑,区分已有武器和新增武器情况
- 在EntityBase.gd中重构武器图标更新逻辑,提取为rebuildWeaponIcons方法
This commit is contained in:
2025-09-21 17:00:11 +08:00
parent 4cb2b97586
commit e4b0f2e5f3
3 changed files with 24 additions and 7 deletions
+12
View File
@@ -51,6 +51,18 @@ func apply(entity: EntityBase):
if !applier or applier.call(entity, value):
entity.fields[field] += value
entity.fields[field] = clamp(entity.fields[field], 0, FieldStore.entityMaxValueMap.get(field, INF))
for i in weapons:
var instance = i.instantiate() as Weapon
if UIState.player.weaponBag.has(instance.displayName):
UIState.player.getItem({
ItemStore.ItemType.SOUL: instance.soulLevel
})
else:
instance.hide()
entity.weapons.append(instance)
entity.weaponBag.append(instance.displayName)
entity.weaponStore.add_child(instance)
entity.rebuildWeaponIcons()
hide()
selected.emit(allHave)
return allHave