mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(武器系统): 添加灵魂等级机制并重构武器升级逻辑
- 在UI中添加灵魂资源显示和操作按钮 - 修改武器升级公式加入灵魂等级系数 - 实现灵魂的提取和镶嵌功能 - 为武器卡牌添加灵魂等级颜色映射 - 初始化玩家灵魂资源为10个
This commit is contained in:
@@ -57,7 +57,7 @@ var inventory = {
|
||||
ItemStore.ItemType.BASKETBALL: 500,
|
||||
ItemStore.ItemType.APPLE: 5,
|
||||
ItemStore.ItemType.BEACHBALL: 0,
|
||||
ItemStore.ItemType.SOUL: 0,
|
||||
ItemStore.ItemType.SOUL: 10,
|
||||
}
|
||||
var inventoryMax = {
|
||||
ItemStore.ItemType.BASEBALL: INF, # 无限
|
||||
@@ -349,6 +349,21 @@ func playSound(type: String):
|
||||
func tryKill():
|
||||
kill()
|
||||
await tryDie()
|
||||
func hasItem(items: Dictionary):
|
||||
for item in items:
|
||||
if inventory[item] < items[item]:
|
||||
return false
|
||||
return true
|
||||
func useItem(items: Dictionary):
|
||||
print(items)
|
||||
var state = hasItem(items)
|
||||
if state:
|
||||
for item in items:
|
||||
inventory[item] -= items[item]
|
||||
return state
|
||||
func getItem(items: Dictionary):
|
||||
for item in items:
|
||||
inventory[item] += items[item]
|
||||
|
||||
func getTrackingAnchor() -> Vector2:
|
||||
return hurtbox.get_node("hitbox").global_position
|
||||
|
||||
Reference in New Issue
Block a user