跳过主要内容
返回全部实验台
🔥 热门 · 第28期↓ 直达同款 SKILL.md

为啥 Boss 半血一定要变身?3 条硬规则切出双高潮

拆解自《招式武林》4 位常规首领(42/84、45/90、58/116、56/112)与终局三段「藏锋老祖」(148 血三段,100 血吃 -70 爆发被代码阶段锁硬卡在 45 HP!)三条变身硬规则:按血量门槛单次触发 + 阶段锁防跳过、变身只送盾加伤绝不回血、换招升级(刀更多 4×3 / 拳更重 14→17 / 节奏更快),一键领取同款 SKILL.md。

实战任务 (0/3)
第 1 阶段HP 58/84无护盾踏步重拳14
少侠 50/50气力 3/3
可直接点击画布上的 蛮牛劲拳师,或点/拖下方武林手牌出招!压过半血线(42 HP)后记得打「铁布衫」接住变身反击!
01

规则① 按血量门槛单次触发(if hp <= 门槛 and not 已变身)+ 老祖三段硬锁血(100-70 强制停在 45)

02

规则② 变身只送临时护盾(+6/+8/+10/+12)与加伤,绝不给首领回血(保留玩家已削血量成就感)

03

规则③ 变身换招升级逼你换打法:山寨头领 4×2→4×3 刀更多、蛮牛 14→17 拳更重、掌法 4×3 节奏更快

04

实时对比战斗紧张度曲线,支持一键开启「跳过阶段 + 变身回血」反面教材切身感受挫败感

同款 AI 编程 Skill · 免费领取

1 句话发给 Cursor / Claude Code / Codex 直接套用

skill.md下载 SKILL.md
直接粘贴进 AI 对话框(自动拉取规范与验证清单)
阅读 https://gameskill.dev/labs/boss-phase-transition/skill.md 并按里面的规则直接接入到我的游戏中
进阶推荐 · 同款商业级 Pro 源码套件

配套现货「肉鸽战斗与首领套件 Roguelike Combat & Boss Kit」可直接跑通多引擎生产源码——加入 Pro 一次解锁全部 12 套 Godot 4 / Unity / Web 生产源码包 + 84 条商用 WAV 音效 + 8 套 2D VFX 着色器,年付 $99(折合 $8.25/月,立省 36%)或月付 $12.9(约 ¥89/月)。

完整 SKILL.md 工程规范与验收清单

Boss Half-HP Phase Transition & Hard Phase-Lock Contract

Half-HP boss transformations are not designed to torture players — they exist to kill second-half combat fatigue once the player's build comes online. Great boss design slices one long predictable fight into two (or three) shorter fights, each with its own climax.

1. The 3 Mandatory Rules (Extracted from Zhaoshi Wulin)

  1. Rule 01 — One-Shot Threshold Gate + Hard Phase-Boundary HP Clamp:

    • Trigger strictly once per phase using an explicit guard:
      if (hp <= threshold && !triggeredPhases.has(nextPhase)) {
        triggeredPhases.add(nextPhase);
        enterPhase(nextPhase);
      }
      
    • Regular bosses trigger at exact 50% HP (42/84, 45/90, 58/116, 56/112).
    • Multi-phase final bosses (e.g. 3-phase Grandmaster Cangfeng 148 HP with gates at 96 and 45) apply a hard HP floor clamp on single-hit overflow (if (prevHp > 45 && rawNextHp < 45) nextHp = 45) so a massive -70 burst from 100 HP stops cleanly at 45 HP instead of skipping Phase 2.
  2. Rule 02 — Grant Temporary Shield + Permanent Damage Buff, NEVER Heal the Boss:

    • On transition, grant an immediate temporary Shield (+6, +8, +10 P2, +12 P3) and escalate offensive pressure.
    • Hard Anti-Pattern: Never restore boss HP on phase shift. Healing erases the player's hard-won damage progress and triggers instant frustration; temporary Shield restores tactical urgency while respecting every HP point already shaved off.
  3. Rule 03 — Upgrade the Moveset to Force Tactical Adaptation:

    • A solution that solved Phase 1 must no longer autopilot Phase 2. Pick one clear escalation axis per boss:
      • Heavier Blows: Raging Bull Brawler upgrades Heavy Fist 14 -> 17 (+3 permanent).
      • More Hits: Bandit Chieftain upgrades Flurry 4×2 -> 4×3 (punishes flat per-hit weak points / single-hit blocks).
      • Faster Tempo: Palm Grandmaster upgrades Heavy Palm 15 -> 17 and accelerates Rapid Palm to 4×3.

2. Verification Checklist

  • Phase transition fires strictly once per threshold (!triggeredPhases.has(phase)) — never re-fires if HP fluctuates.
  • Multi-phase final boss clamps massive single-hit overflow cleanly at the phase floor (e.g. 100 - 70 -> 45 HP).
  • Boss HP never increases on phase transition (bossHeal === 0); tension comes strictly from temporary Shield + upgraded intent.
  • Phase 2+ visibly changes the enemy's telegraph/intent (more hits, heavier single blow, or faster cadence).

底层原理与实测基准 · ENGINEERING BREAKDOWN

为什么 AI 默认写法会翻车?实测数据对比

如果在扣血后再判断 `hp <= 50%`,玩家一发 70 点暴击就会直接把 100 血 Boss 打到死或直接跳过二阶段变身与音乐切换。必须在伤害结算管线内做阈值硬锁血(Hard HP-Lock)并消化溢出伤害。

确定性锁血验证:100 血 Boss 吃下 70 爆发精准卡在 45 血阈值 → 触发二阶段变身与预告反击,0 跳过演出。

多引擎生产代码 · COPY-PASTE READY

Godot 4 (GDScript)、Unity (C#) 与 TypeScript 参考实现

Godot 4 (GDScript)

boss_phase_controller.gd
class_name BossPhaseController
extends Node

signal phase_triggered(new_phase: int)

@export var max_hp: int = 100
@export var phase_thresholds: Array[int] = [45] # Hard lock HP values
var hp: int = 100
var current_phase: int = 1

func apply_damage(raw_damage: int) -> Dictionary:
	var next_hp := maxi(0, hp - raw_damage)
	var clamped := false
	if current_phase <= phase_thresholds.size():
		var gate := phase_thresholds[current_phase - 1]
		if hp > gate and next_hp <= gate:
			next_hp = gate
			clamped = true
			current_phase += 1
			phase_triggered.emit(current_phase)
	hp = next_hp
	return { "hp": hp, "clamped": clamped, "phase": current_phase }

Unity (C#)

BossPhaseHealth.cs
using System;
using UnityEngine;

public class BossPhaseHealth : MonoBehaviour
{
    public event Action<int> OnPhaseTransition;
    [SerializeField] private int[] phaseGates = { 45 };
    public int CurrentHp { get; private set; } = 100;
    public int Phase { get; private set; } = 1;

    public bool ApplyDamage(int damage)
    {
        int nextHp = Mathf.Max(0, CurrentHp - damage);
        bool clamped = false;
        if (Phase <= phaseGates.Length)
        {
            int gate = phaseGates[Phase - 1];
            if (CurrentHp > gate && nextHp <= gate)
            {
                nextHp = gate;
                clamped = true;
                Phase++;
                OnPhaseTransition?.Invoke(Phase);
            }
        }
        CurrentHp = nextHp;
        return clamped;
    }
}

TypeScript (Web / Phaser)

boss-phase-lock.ts
export function applyBossDamage(
  state: { hp: number; phase: number; gates: number[] },
  damage: number
): { hp: number; phaseTriggered: boolean } {
  const gate = state.gates[state.phase - 1];
  let nextHp = Math.max(0, state.hp - damage);
  let phaseTriggered = false;
  if (gate !== undefined && state.hp > gate && nextHp <= gate) {
    nextHp = gate;
    state.phase += 1;
    phaseTriggered = true;
  }
  state.hp = nextHp;
  return { hp: nextHp, phaseTriggered };
}

开发者高频实战问答 · FAQ

参数调优与工程落地常见问题

Boss 硬锁血会不会让高爆发流派玩家觉得“伤害被吞、很不爽”?

只要提前在血条上画出清晰的阶段刻度/封印线,并在触发锁血瞬间给足破盾演出或将溢出伤害转为易伤/破防,玩家反而会觉得节奏拉满。

Boss 进二阶段变身时应该清空所有负面状态吗?

必须解除眩晕/冰冻防打断演出,但对流血、中毒、印记等流派核心层数建议“减半保留”而非一刀清零,避免针对性毁掉持续伤害流派。

一个章节关底 Boss 设计几个阶段最合适?

一二幕 Boss 以 2 阶段(45–55% 血量切态)节奏最佳;3 阶段多锁血留给最终关底 Boss 制造终极压迫感。

这套 Boss 阶段状态机有完整的商业级工程源码吗?

有!`/pro/roguelike-combat-boss-kit` 与白标肉鸽起步工程都完整内置了这套可运行的多阶段锁血状态机。

延伸阅读 · 引擎中心与商业套件

同赛道精选实验台推荐

真实项目提取 · 国风武侠卡牌《招式武林》

每个实验台的数值与代码,都来自正在冲 Steam 的《招式武林》

三名武侠角色、39 种独立机制敌人、70 件宝物、19 招功夫与数百项自动回归测试——我们一边做游戏,一边把踩过的坑提炼成可直接交互的实验台和免费 Skill。