mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-07 18:52:12 +08:00
fix: 限制能量值为非负,调整伤害造成的能量存储比例
This commit is contained in:
@@ -70,6 +70,7 @@ func _ready():
|
|||||||
currentFocusedBoss = get_tree().get_nodes_in_group("players")[0]
|
currentFocusedBoss = get_tree().get_nodes_in_group("players")[0]
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
health = clamp(health, 0, fields.get(FieldStore.Entity.MAX_HEALTH))
|
health = clamp(health, 0, fields.get(FieldStore.Entity.MAX_HEALTH))
|
||||||
|
energy = clamp(energy, 0, INF)
|
||||||
for i in inventory:
|
for i in inventory:
|
||||||
inventory[i] = clamp(inventory[i], 0, inventoryMax[i])
|
inventory[i] = clamp(inventory[i], 0, inventoryMax[i])
|
||||||
func _physics_process(_delta: float) -> void:
|
func _physics_process(_delta: float) -> void:
|
||||||
@@ -103,7 +104,7 @@ func takeDamage(bullet: BulletBase, crit: bool):
|
|||||||
damage = 0
|
damage = 0
|
||||||
else:
|
else:
|
||||||
playSound("hurt")
|
playSound("hurt")
|
||||||
bullet.launcher.storeEnergy(damage * 0.15)
|
bullet.launcher.storeEnergy(damage * 0.05)
|
||||||
storeEnergy(damage * -0.1)
|
storeEnergy(damage * -0.1)
|
||||||
health -= damage
|
health -= damage
|
||||||
DamageLabel.create(damage, crit, damageAnchor.global_position + MathTool.randv2_range(GameRule.damageLabelSpawnOffset))
|
DamageLabel.create(damage, crit, damageAnchor.global_position + MathTool.randv2_range(GameRule.damageLabelSpawnOffset))
|
||||||
|
|||||||
Reference in New Issue
Block a user