mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-31 00:11:54 +08:00
feat: 添加水晶和钻石物品系统
- 在EntityBase中新增水晶和钻石物品类型 - 敌人在死亡时概率掉落水晶,BOSS额外掉落钻石 - 游戏结束时将水晶和钻石存入OutGameStorage - 调整Starter面板中钻石升级成本为0 - 在UI场景中添加水晶和钻石显示节点
This commit is contained in:
@@ -67,6 +67,8 @@ var inventory = {
|
||||
ItemStore.ItemType.APPLE: 5,
|
||||
ItemStore.ItemType.BEACHBALL: 0,
|
||||
ItemStore.ItemType.SOUL: 0,
|
||||
ItemStore.ItemType.CRYSTAL: 0,
|
||||
ItemStore.ItemType.DIAMOND: 0
|
||||
}
|
||||
var inventoryMax = {
|
||||
ItemStore.ItemType.BASEBALL: INF, # 无限
|
||||
@@ -74,6 +76,8 @@ var inventoryMax = {
|
||||
ItemStore.ItemType.APPLE: 5,
|
||||
ItemStore.ItemType.BEACHBALL: INF,
|
||||
ItemStore.ItemType.SOUL: INF,
|
||||
ItemStore.ItemType.CRYSTAL: INF,
|
||||
ItemStore.ItemType.DIAMOND: INF,
|
||||
}
|
||||
|
||||
@export var defaultCooldownUnit: float = 100
|
||||
@@ -415,6 +419,18 @@ func tryDie(by: BulletBase = null):
|
||||
fields[FieldStore.Entity.MAX_HEALTH] * randf_range(1 - GameRule.beachballOffset, 1 + GameRule.beachballOffset),
|
||||
position + MathTool.sampleInCircle(GameRule.itemDroppedSpawnOffset)
|
||||
)
|
||||
for i in randi_range(0, 20 if isBoss else 3):
|
||||
ItemDropped.generate(
|
||||
ItemStore.ItemType.CRYSTAL,
|
||||
5 if isBoss else 1,
|
||||
position + MathTool.sampleInCircle(GameRule.itemDroppedSpawnOffset)
|
||||
)
|
||||
if isBoss:
|
||||
ItemDropped.generate(
|
||||
ItemStore.ItemType.DIAMOND,
|
||||
1,
|
||||
position + MathTool.sampleInCircle(GameRule.itemDroppedSpawnOffset)
|
||||
)
|
||||
if isBoss:
|
||||
ItemDropped.generate(
|
||||
ItemStore.ItemType.SOUL,
|
||||
@@ -544,6 +560,8 @@ static func generatePlayer(playerName: String) -> EntityBase:
|
||||
var player = generate(ComponentManager.getCharacter("Rooster"), Vector2.ZERO, false)
|
||||
player.displayName = playerName
|
||||
player.name = "Player_%s" % playerName
|
||||
for field in OutGameStorage.upgradableFieldsValue:
|
||||
player.fields[field] += OutGameStorage.upgradableFieldsValue[field]
|
||||
return player
|
||||
static func generate(
|
||||
entity: PackedScene,
|
||||
|
||||
Reference in New Issue
Block a user