extends Node

signal on_create_block_text(unit: Node2D)
signal on_create_damage_text(unit: Node2D, hitbox: HitboxComponent)
signal on_create_heal_text(unit: Node2D, heal: float)

signal on_upgrade_selected

const FLASH_MATERIAL = preload("uid://cwtrdmkrsmw23")
const FLOATING_TEXT_SCENE = preload("uid://qkwyrg22h3gi")

enum UpgradeTier {
	COMMON,
	RARE,
	EPIC,
	LEGENDARY
}

var player: Player
var game_paused := false
# 尝试阻止敌人攻击，获取闪避， 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
