1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

refactor(Feed): 重构Feed信息重建逻辑并调整游戏数值

将Feed的信息重建逻辑提取为rebuildInfo方法以便复用
调整Puffs.tscn中fieldValues的数值从0.075改为7.5
降低敌人每波生命值增长比例从0.1改为0.075
修改World.tscn中动画轨道的中间点数值
This commit is contained in:
2025-08-28 14:59:36 +08:00
parent 32f5adfce4
commit 8a16a4056f
5 changed files with 34 additions and 30 deletions
+27 -25
View File
@@ -23,31 +23,7 @@ func _ready():
func():
apply(UIState.player)
)
avatarRect.texture = avatarTexture
nameLabel.displayName = displayName
nameLabel.quality = quality
for i in fieldsBox.get_children():
i.queue_free()
var noField = true
for i in range(min(fields.size(), fieldValues.size())):
noField = false
var field = fields[i]
var value = fieldValues[i]
var fieldShow: FieldShow = preload("res://components/UI/FieldShow.tscn").instantiate()
fieldShow.field = field
fieldShow.value = value
fieldsBox.add_child(fieldShow)
if noField:
fieldsBox.add_child(QuickUI.smallText("无词条"))
for i in costsBox.get_children():
i.queue_free()
for i in range(min(costs.size(), costCounts.size())):
var cost = costs[i]
var count = costCounts[i]
var costShow: ItemShow = preload("res://components/UI/ItemShow.tscn").instantiate()
costShow.type = cost
costShow.count = int(count * multipiler())
costsBox.add_child(costShow)
rebuildInfo()
func allHad(entity: EntityBase) -> bool:
var allHave = true
@@ -80,3 +56,29 @@ func multipiler() -> float:
return 1 - UIState.player.fields.get(FieldStore.Entity.PRICE_REDUCTION)
else:
return 1
func rebuildInfo():
avatarRect.texture = avatarTexture
nameLabel.displayName = displayName
nameLabel.quality = quality
for i in fieldsBox.get_children():
i.queue_free()
var noField = true
for i in range(min(fields.size(), fieldValues.size())):
noField = false
var field = fields[i]
var value = fieldValues[i]
var fieldShow: FieldShow = preload("res://components/UI/FieldShow.tscn").instantiate()
fieldShow.field = field
fieldShow.value = value
fieldsBox.add_child(fieldShow)
if noField:
fieldsBox.add_child(QuickUI.smallText("无词条"))
for i in costsBox.get_children():
i.queue_free()
for i in range(min(costs.size(), costCounts.size())):
var cost = costs[i]
var count = costCounts[i]
var costShow: ItemShow = preload("res://components/UI/ItemShow.tscn").instantiate()
costShow.type = cost
costShow.count = int(count * multipiler())
costsBox.add_child(costShow)