---
name: non-railroaded-tutorial
description: Replace frustrating grey-screen forced-click tutorials with a 3-layer free-trial onboarding architecture (tutorial.gd): full input freedom over a real deck (lock only the 4-card opening hand, keep allowed() open and provision() empty so later turns draw from a real 8-card deck), causal effect verification (advances on demonstrated effects like enemy_hit.blocked > other_shield rather than raw button clicks), and a 1 HP sparring safety floor (training_sparring = true) paired with a live single-step deficit scanner (target(t)). Use in roguelike deckbuilders, strategy, or action games where players hate forced tutorial rails.
---

# Non-Railroaded Free-Trial Tutorial Contract (`tutorial.gd`)

90% of game tutorials dim the entire screen, disable every button except one, and force players through a script like a tape recorder. Veterans hate being caged, and newcomers finish clicking blindly without understanding why the mechanic works.

Good tutorials never strap players to rails — **they put a safety net underneath and let players break through on their own**.

## 1. The 3 Mandatory Layers

1. **Layer 01 — Full Input Freedom + Real Deck (`allowed()` Open + `provision(): pass`)**:
   - Delete every grey-screen modal blocker and forced-click spotlight lock.
   - Fix **only the Turn-1 opening 4-card hand** so the first impression is stable; leave `provision()` empty (`pass`) so Turn 2+ draws from the real 8-card shuffled deck.
   - Keep `allowed()` open for all legal plays and early End Turn: veterans clear in 2 turns, newcomers can misplay freely without ever soft-locking.
2. **Layer 02 — Causal Effect Verification (`bell_credit`, Schema 2 Law)**:
   - **Rule**: *Advances on demonstrated effects, never raw button clicks or turn counts.*
   - Example (Golden Bell / `金钟罩`): if ordinary shield (`other_shield`) already absorbed 100% of the enemy attack, clicking Golden Bell does **not** advance mastery.
   - Require explicit causal attribution:
     `bell_credit = enemy_hit.blocked > other_shield && bell_shield > 0`
   - When the player over-shields and fails attribution, explain the exact gap calmly instead of faking a green checkmark.
3. **Layer 03 — 1 HP Sparring Safety Floor + Dynamic Single-Step Hint (`training_sparring` + `target(t)`)**:
   - Set `s.training_sparring = true` during tutorial sparring: clamp surviving HP for both sides to `>= 1 HP` on lethal hits so misplays **never** trigger Game Over or forced full restarts.
   - Run a stateless deficit scanner `target(t)` on every state change (e.g., missing Guard Stance -> highlight Qi Guard; Stance ready -> highlight Golden Bell; Bell armed -> highlight End Turn) that illuminates **only ONE next action**, never a full-page manual modal.

## 2. Verification Checklist
- [ ] Turn 1 deals the fixed 4-card opening hand; Turn 2+ shuffles and draws from the real 8-card deck without injecting fake cards.
- [ ] Over-shielding (`other_shield >= incomingDamage`) before clicking the target defense card evaluates `bell_credit === false` (catches fake mastery).
- [ ] Blocking incoming damage beyond ordinary shield (`enemy_hit.blocked > other_shield`) evaluates `bell_credit === true`.
- [ ] Taking lethal damage while `training_sparring === true` clamps HP cleanly at `1 HP` instead of triggering Game Over.
- [ ] `target(t)` emits strictly one contextual hint at any state with zero blocking full-screen modals.
