1
1
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:
2025-09-20 07:01:17 +08:00
parent ac7183e78b
commit 06fdfd1586
10 changed files with 91 additions and 25 deletions
+16 -1
View File
@@ -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
+6 -6
View File
@@ -16,17 +16,17 @@ enum TypeTopic {
MAGIC,
}
enum SoulLevel {
NORMALIZE,
ADD,
MULTIPLY,
EXPONENT,
INFINITY,
NORMALIZE = 1,
ADD = 2,
MULTIPLY = 3,
EXPONENT = 4,
INFINITY = 5,
}
@export var displayName: String = "未命名武器"
@export var quality: Quality = Quality.COMMON
@export var typeTopic: TypeTopic = TypeTopic.IMPACT
@export var soulLevel: SoulLevel = SoulLevel.NORMALIZE
@export var soulLevel: int = SoulLevel.NORMALIZE
@export var level: int = 0
@export var qualityColorMap = {
Quality.WASTE: Color(),