Tu Chân Giới · docs

Combat

Combat and skill checks use one rule: roll a d20 (a 20-sided die), add modifiers, and compare the total with a target number. The engine rolls every die and owns every number; the narrator (the LLM) only describes. A revised combat spec, C1–C9, is meant to fix the prototype's balance and fairness problems. It is proposed and needs operator approval.

The d20 core, step by step

  1. Roll one d20. With ưu thế (advantage), roll two and keep the higher. With bất lợi (disadvantage), keep the lower.
  2. Add the ability modifier: mod = ⌊(score − 10) / 2⌋.
  3. Add the realm bonus R (cảnh giới bonus). It grows with cấp and sub-stage.
  4. Subtract 2 if you are bị thương (injured).
  5. Compare the total with the target. A check uses a DC (difficulty class). An attack uses the foe's hộ thể (body shield: the defence number).
  6. A total equal to or above the target succeeds.
  7. For checks and saves, a margin of 10 or more moves the result one degree: đại thành công (critical success) or đại bại (critical failure). A natural 20 is always the best result. A natural 1 is always the worst.

A fighter has five abilities:

AbilityPlain nameUsed for
Thể pháchbodyattack, damage, HP
Thân phápagilityinitiative, hộ thể, escape, dodge saves
Thần thứcspirit sensebí pháp DC and damage, mind saves
Ngộ tínhinsightevent checks
Khí vậnluckevent checks

HP means hit points. Linh lực (spirit energy) pays for bí pháp (secret arts).

Rules: prototype vs proposed spec

In the formulas, cấp is the realm number and stage is the sub-stage number (1–10).

TopicRule in poc/combat.ts
Realm bonus R2 + ⌊(stage − 1)/3⌋ + 4 × (cấp − 1); on attacks, saves and checks
HP(10 + 2 × stage + 3 × Thể) × 1.3cấp − 1, rounded
Linh lực2 + 2 × (cấp − 1) + ⌊stage/3⌋ + công pháp (0/2/4)
Hộ thể10 + Thân + thể chất (+2 … +5) + (cấp − 1)
Attackd20 + Thể + R vs hộ thể; 1d8 + Thể. A natural 20 doubles the dice and inflicts bị thương.
Bí pháp3 linh lực; bí pháp 2d6 or thần thông 3d6, + Thần thức; save vs 8 + R + Thần thức for half
Áp chế (realm suppression)Target 1 realm up: you attack with bất lợi and it saves with ưu thế. 2+ up: it also takes half damage.
Phòng ngự (guard)+4 hộ thể and ưu thế on saves until your next turn
PillHồi Xuân Đan heals cấp × (2d4 + 2) and cures poison
Defeat1 HP, injury 6/12/24 h by cấp, and lose ⌈n/2⌉ of every carried stack (pills kept)
RecoveryNo clock: HP and injury never recover between encounters
Narrator textEvery log entry; a line with a digit falls back to a template
BuildsPresets weak / mid / strong; strong has Thể 16 (+3)

Known bugs, still in the code:

Try it: d20 check roller

This roller uses the check rules above. The browser rolls with crypto.getRandomValues. The dice line follows the prototype's format. When you pick an ability, the modifier box gets Lục Trần's modifier from the seed-1 fight. You can change it.

Ability
Roll mode

Try it: stat calculator (proposed spec C1–C2)

Set a fighter. The table shows the stats now and after the next step up. The last rows compare the prototype formulas, so you can see the breakthrough bug.

Your fighter
Công pháp
Foe

Thể chất grade: 0 = none, 1 = Tiên cốt, 2 = Tiên thân, 3 = Đạo thể. Out-of-range values are put back in range in the box. The fixed array 14/13/12/11/10 gives mods +2, +1, +1, 0, 0. The spec does not yet say how to round HP with thể chất; the calculator rounds to the nearest whole number. Cấp 3–5 are not playable in v0.1.

Balance sweep (prototype rules)

The sweep runs 1000 bot fights per cell (seed 1): Luyện Thể · Đoán Gân against a mid-build foe at the same stage, 0, 1 or 2 major realms up. These are the current rules. The proposed spec needs a new sweep.

Realm gapWeak build: win · avg roundsStrong build: win · avg rounds
025.5% · 6.895.5% · 4.6
10.4% · 6.228.7% · 7.8
20.0% · 5.70.0% · 7.1

Problem: at gap 0 the spread is 25.5% to 95.5%, far outside the C4 targets (35–45% and 60–75%).