mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(武器系统): 完善武器获取和提炼逻辑
- 在WeaponShow.gd中修改操作标签文本为"获得武器"和"提炼灵魂" - 在Feed.gd中添加武器获取逻辑,区分已有武器和新增武器情况 - 在EntityBase.gd中重构武器图标更新逻辑,提取为rebuildWeaponIcons方法
This commit is contained in:
@@ -85,7 +85,7 @@ var inventoryMax = {
|
||||
@onready var stageAnimator: AnimationPlayer = $"%stageAnimator"
|
||||
@onready var damageAnchor: Node2D = $"%damageAnchor"
|
||||
@onready var trailParticle: GPUParticles2D = $"%trailParticle"
|
||||
@onready var weaponStore = $"%weaponStore"
|
||||
@onready var weaponStore: Node2D = $"%weaponStore"
|
||||
var statebar: EntityStateBar
|
||||
|
||||
var health: float = 0
|
||||
@@ -127,10 +127,7 @@ func _ready():
|
||||
else:
|
||||
UIState.energyPercent.setCurrent(newEnergy)
|
||||
)
|
||||
for i in weapons:
|
||||
var icon: SkillIcon = ComponentManager.getUIComponent("SkillIcon").instantiate()
|
||||
icon.weapon = i
|
||||
UIState.skillIconContainer.add_child(icon)
|
||||
rebuildWeaponIcons()
|
||||
else:
|
||||
if !currentFocusedBoss:
|
||||
currentFocusedBoss = get_tree().get_nodes_in_group("players")[0]
|
||||
@@ -174,6 +171,14 @@ func _physics_process(_delta: float) -> void:
|
||||
trailParticle.emitting = trailing
|
||||
|
||||
# 通用方法
|
||||
func rebuildWeaponIcons():
|
||||
if isPlayer():
|
||||
for i in UIState.skillIconContainer.get_children():
|
||||
i.queue_free()
|
||||
for i in weapons:
|
||||
var icon: SkillIcon = ComponentManager.getUIComponent("SkillIcon").instantiate()
|
||||
icon.weapon = i
|
||||
UIState.skillIconContainer.add_child(icon)
|
||||
func timeLived():
|
||||
return WorldManager.getTime() - spawnTime
|
||||
func setStage(stage: int):
|
||||
|
||||
Reference in New Issue
Block a user