feat(iframe): 无敌期间玩家节点 8Hz 方波闪烁反馈
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,13 @@ func _process(delta: float) -> void:
|
||||
_dps_poll_timer = 0.5
|
||||
if _lbl_dps:
|
||||
_lbl_dps.text = tr("UI_DPS") % DpsTracker.get_dps()
|
||||
# 无敌帧闪烁反馈:8Hz 方波(相位来自系统时钟,避免累加状态)
|
||||
if _player_node:
|
||||
if PlayerStats.is_invulnerable():
|
||||
var on: bool = (Time.get_ticks_msec() / 62) % 2 == 0 # ≈8Hz(62ms 半周期)
|
||||
_player_node.modulate.a = 1.0 if on else 0.35
|
||||
elif _player_node.modulate.a != 1.0:
|
||||
_player_node.modulate.a = 1.0 # 窗口结束确保恢复不透明
|
||||
|
||||
# ── 初始化 ─────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user