mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat: 添加水晶和钻石物品系统
- 在EntityBase中新增水晶和钻石物品类型 - 敌人在死亡时概率掉落水晶,BOSS额外掉落钻石 - 游戏结束时将水晶和钻石存入OutGameStorage - 调整Starter面板中钻石升级成本为0 - 在UI场景中添加水晶和钻石显示节点
This commit is contained in:
@@ -25,6 +25,8 @@ func beforeOpen(args: Array = []):
|
||||
audio.play()
|
||||
var reasonTemplate = MathTool.randomChoiceFrom(GameRule.deadReasons)
|
||||
deadreason.text = ("[color=gray]" + reasonTemplate + "凶手是[b]%s[/b]的[b]%s[/b]。[/color]") % args
|
||||
OutGameStorage.inventory[ItemStore.ItemType.CRYSTAL] += UIState.player.inventory[ItemStore.ItemType.CRYSTAL]
|
||||
OutGameStorage.inventory[ItemStore.ItemType.DIAMOND] += UIState.player.inventory[ItemStore.ItemType.DIAMOND]
|
||||
func afterOpen(_args: Array = []):
|
||||
returnBtn.disabled = false
|
||||
exitBtn.disabled = false
|
||||
|
||||
@@ -49,6 +49,8 @@ func beforeOpen(_args: Array = []):
|
||||
startBtn.pressed.emit()
|
||||
)
|
||||
feedCounted += 1
|
||||
func afterOpen(_args: Array = []):
|
||||
startBtn.disabled = false
|
||||
|
||||
func clearFeeds():
|
||||
for feed in initialFeedSelection.get_children():
|
||||
|
||||
@@ -172,7 +172,7 @@ func beforeOpen(_args: Array = []):
|
||||
for field in OutGameStorage.upgradableFieldsAdvance:
|
||||
var fieldShow = ComponentManager.getUIComponent("FieldShow").instantiate() as FieldShow
|
||||
fieldShow.cost(ItemStore.ItemType.CRYSTAL, 50)
|
||||
fieldShow.cost(ItemStore.ItemType.DIAMOND, 1)
|
||||
fieldShow.cost(ItemStore.ItemType.DIAMOND, 0)
|
||||
fieldShow.upgradable = true
|
||||
fieldShow.upgradeValue = OutGameStorage.upgradableFieldsAdvance[field]
|
||||
fieldShow.field = field
|
||||
@@ -182,8 +182,12 @@ func beforeOpen(_args: Array = []):
|
||||
func(newValue: float):
|
||||
OutGameStorage.upgradableFieldsValue[fieldShow.field] = newValue
|
||||
for index in len(fieldShow.costCounts):
|
||||
fieldShow.costCounts[index] *= GameRule.outGameUpgradeMultipiler
|
||||
if fieldShow.costCounts[index] == 0:
|
||||
fieldShow.costCounts[index] += 1
|
||||
else:
|
||||
fieldShow.costCounts[index] *= GameRule.outGameUpgradeMultipiler
|
||||
)
|
||||
upgradeFieldsBox.add_child(fieldShow)
|
||||
|
||||
startSingleplayerBtn.disabled = false
|
||||
Wave.current = 0
|
||||
|
||||
Reference in New Issue
Block a user