feat: 躲避敌人攻击功能

fix: 敌人初始化血条
This commit is contained in:
luke358
2026-05-18 16:10:19 +08:00
parent b6bf8ef5ba
commit 66452f1072
7 changed files with 45 additions and 10 deletions
+10 -8
View File
@@ -1,13 +1,15 @@
extends Node
const FLASH_MATERIAL = preload("uid://cwtrdmkrsmw23")
var player: Player
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
# 尝试阻止敌人攻击,获取闪避, unit_stats block_chance 越大
# 成功率越高
func get_chance_success(chance: float) -> bool:
var random := randf_range(0, 1.0)
if random < chance:
return true
return false