0.2.5-dev: an optional 「官方伤害数字」 setting (default off) shows only the numbers the official game shows per the PRTS red-number rule (#412, the owner's decision of 2026-10-12); a small link to the project's GitHub repository on the title page (#543); golden: unchanged

This commit is contained in:
sganggs committed 2026-10-12 14:59:20 +08:00
1 parent 7fd0478dc0
commit a3e8460bb0
26 files changed
+555 -43

No files matched your search

+52
View File
@@ -271,3 +271,55 @@ the preceding digest exactly; the changed partner/side also changes preparation
All five already differed from 0.2.4, so the final release-relative total remains 45 scenarios (§30.9 plus these
additional pairing effects). There are no new corpus cases or removals. The other follow-up fixes do not move this
corpus; their dedicated regressions cover the reported and newly found cases.
### 30.17 Official damage numbers and the title-page repository link
Issues #412 and #543. #412's font swap, element-colour pass and bold crit type are not part of this change.
The new setting 「官方伤害数字」 (`officialDamageNumbers`) defaults off. While it is off, every rounded hit and
heal still pops the existing typed number (merge, colours, 90-number ceiling, sparks and slashes unchanged).
Turning 「显示伤害数字」 off still hides every digit, including official ones. The value is sanitised with the
other settings (a missing or non-boolean saved value stays off) and copied into the live field view.
The official rule is PRTS [作战机制](https://prts.wiki/w/作战机制) 「伤害红字(暴击)」 (fetched 2026-10-12): show a
red integer of the final damage when 最终伤害 ≥ 期望伤害 × 1.5, or when a skill forces red. Expected damage follows
the normal formula except that DEF/RES penetration, post-mitigation bonuses (temporary attack-scale increases,
damage-scale increases such as 脆弱, amount rewrites, barrier absorption), final-damage resets and special HP
mechanisms are not counted. Invulnerable targets multiply expected damage by 0, and 0 ≥ 0 × 1.5 still shows red 0.
A dodge of a hit that would have been red shows yellow MISS (`#ff9000`) instead. After 卫戍协议:盟约 the official
client no longer caps red numbers at 10; this client does not restore that cap. The existing 90-number ceiling
stays as a renderer limit [ASSUMED: 「无限制」 means the old cap of 10 is not brought back].
In this sim the comparison runs inside `dealDamage` and does not change HP, shields, hooks or RNG:
- Expected damage is mitigation of `dmg.amount` with penetration forced to 0, times `dmg.mul` only.
- The compared total is the pre-shield amount after source and target multipliers. The integer on the existing
`dmg` tuple — what both modes display — is what remains after shields and an `hpDamage` rewrite.
- A qualifying tuple that already fires (`amount >= 0.5`, not silent) gains a fifth element `'r'`. Other tuples
stay four elements. Element gauge fills are not marked. Heals are not marked, so official mode hides them.
- A dodge that already fires sets `num: 'm'` on its fx payload only when the same test says the landed hit would
be red. That test does not roll RNG again and does not refresh a dirty attacker's stats (a dirty `source.s`
read rescales HP).
[ASSUMED] gaps, left unmarked rather than guessed:
- `dmg.amount` already includes the attack's stated ATK × 攻击倍率 (`atkScaleMul` is baked in by callers). It is
not divided back out. `dmg.mul` stays on both sides of the comparison.
- Cached-ATK expected damage (raw ATK, ignoring the attack scale and the target's DEF/RES), forced red, blue
numbers and yellow BLOCK are not represented on DamageInfo. The three wiki examples are not hard-coded.
- An invulnerable or sleeping hit, and a qualifying total below 0.5, still emit no `dmg` event, so official mode
cannot show that red 0. Emitting one would increment `events.dmg` and could play an impact. The renderer can
draw a red 0 when a tuple `['dmg', id, 0, type, 'r']` is supplied. Liftoff and a cancelled or hit-capped attack
are not red 0.
- PRTS does not say that ordinary hits are silent. That is the requested setting: official mode shows only the
marked red integer and the yellow MISS. The sentence in the issue comment is not a PRTS sentence.
- The random position is about ±0.35 tiles across and 0.15–0.55 tiles above the head. The simplified board keeps
its fixed slot and only changes the colour / the MISS label.
- Sparks and the melee slash stay in both modes.
#543: the title footer carries a text link labelled 「项目仓库」 to
`https://github.com/sganggs/Stronghold-Protocol`, `target="_blank"` and `rel="noopener noreferrer"`. It does not
replace 设置 → 问题反馈.
Tests: `test/sim/official-damage-numbers.test.js`, `test/ui/official-damage-numbers.test.js`,
`test/render/official-numbers.test.js`. Golden digests do not move: no new event kind is emitted, and the extra
tuple field is not part of the digest. Player notes: PLAYING; client notes: design/client.md.