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

feat(物品系统): 新增沙滩球物品及相关功能

refactor(武器卡片): 调整武器类型和颜色映射
style(UI): 更新武器名称标签样式
fix(实体基础): 修正物品掉落逻辑
perf(音频): 优化音频处理模式
docs(物品存储): 更新物品枚举和映射
build(资源): 添加沙滩球SVG资源文件
chore(资源): 更新篮球和棒球SVG资源
This commit is contained in:
2025-09-06 11:05:56 +08:00
parent 86e14b3bfe
commit 2486eb6d8a
17 changed files with 84 additions and 78 deletions
+3
View File
@@ -50,11 +50,13 @@ var inventory = {
ItemStore.ItemType.BASEBALL: 500,
ItemStore.ItemType.BASKETBALL: 500,
ItemStore.ItemType.APPLE: 5,
ItemStore.ItemType.BEACHBALL: 0,
}
var inventoryMax = {
ItemStore.ItemType.BASEBALL: INF, # 无限
ItemStore.ItemType.BASKETBALL: INF,
ItemStore.ItemType.APPLE: 5,
ItemStore.ItemType.BEACHBALL: INF,
}
@export var defaultCooldownUnit: float = 100
@@ -237,6 +239,7 @@ func tryDie(by: BulletBase):
) or isBoss:
for i in randi_range(appleCount.x, appleCount.y):
ItemDropped.generate(ItemStore.ItemType.APPLE, 1, position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset))
ItemDropped.generate(ItemStore.ItemType.BEACHBALL, fields[FieldStore.Entity.MAX_HEALTH], position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset))
EffectController.create(preload("res://components/Effects/DeadBlood.tscn"), texture.global_position).shot()
await die()
if isPlayer() and UIState.player == self:
-3
View File
@@ -1,9 +1,6 @@
extends CanvasLayer
class_name UIState
@onready var baseball = $"%baseball"
@onready var basketball = $"%basketball"
@onready var apple = $"%apple"
@onready var items = $"%items"
@onready var energyLabel: Label = $"%energy"
@onready var energyMaxLabel: Label = $"%energyMax"
+3
View File
@@ -13,6 +13,7 @@ enum TypeTopic {
IMPACT,
ENERGY,
TEMPERATURE,
MAGIC,
}
@export var displayName: String = "未命名武器"
@@ -50,11 +51,13 @@ enum TypeTopic {
TypeTopic.IMPACT: "冲击",
TypeTopic.ENERGY: "能量",
TypeTopic.TEMPERATURE: "熔融",
TypeTopic.MAGIC: "魔法",
}
@export var typeTopicColorMap = {
TypeTopic.IMPACT: Color(),
TypeTopic.ENERGY: Color(),
TypeTopic.TEMPERATURE: Color(),
TypeTopic.MAGIC: Color(),
}
@onready var qualityLabel: Label = $"%quality"
+6 -3
View File
@@ -4,17 +4,20 @@ class_name ItemStore
enum ItemType {
BASEBALL,
BASKETBALL,
APPLE
APPLE,
BEACHBALL
}
static var nameMap = {
ItemType.BASEBALL: "棒球",
ItemType.BASKETBALL: "篮球",
ItemType.APPLE: "苹果"
ItemType.APPLE: "苹果",
ItemType.BEACHBALL: "沙滩球"
}
static var idMap = {
ItemType.BASEBALL: "baseball",
ItemType.BASKETBALL: "basketball",
ItemType.APPLE: "apple"
ItemType.APPLE: "apple",
ItemType.BEACHBALL: "beachball"
}
static func getTexture(type: ItemType) -> Texture2D:
return load("res://resources/items/%s.svg" % idMap[type])