simulate: locate the damage
The harness measured a game in which every blow went to a general pool. That was
tolerable while every creature was a baseline human and merely wrong once the bestiary
had a Cadence in it: a creature whose entire mechanical identity is being whittled down
body by body was being measured as a person with an odd portrait, and the number it
printed was about nobody.
locationFor and resolveLocationHit move from ringbrp.mjs to rules.mjs, and the
category mapping inside woundPenaltyFor becomes woundPenaltyFrom beside them, for the
reason applyDifficulty and resolveBands moved before them: node cannot load the engine,
and the harness may not own a second copy of a rule. All three arrive with the
spot-checks they never had - 103 rules now, 346 formulas verified.
What the loop does now: 1d20 against the DEFENDER's own species table, melee finding
limbs and shooting finding centre of mass; damage to that location and to the general
pool, so the two agree; disabled at the location maximum and destroyed at twice it,
cumulatively. Then the consequences actually apply - a destroyed head is unconscious
immediately (conditionFor has always accepted that flag and was never passed it, so a
headshot used to leave the target swinging), a ruined arm costs -30 to every attack
including shooting, a ruined leg costs -30 to dodge, and each Cadence body lost costs
the whole creature -10 to everything.
Verified as mechanics rather than as numbers that moved: no species can return a
location it does not have across all 40 rolls; vesh and cadence have no head at any
roll and cadence has no vital either; a vesh ridge is hit 3/20 where a human head is
1/20, which is the "long target rather than a small one" the tables were designed for.
A built Cadence has five bodies at 4 points each and no vital; a built Vesh has six
locations with the ridge the largest.
Measured consequences, seed 11, 400 runs, four duty-roster agents:
keepers x6 31.0% -> 36.5% wiped
the_choir x11 0.3% -> 0.0% wiped, and now degrading as bodies go rather than
being a person who cannot be shot in the head
long_walker 42.0% wiped, which nothing had ever measured
Still no bleeding, panic, Coherence, cover, range bands or fire modes. Still a floor.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f88c31649c
commit
94479641b3
+78
-12
@@ -26,16 +26,30 @@
|
||||
* WHAT IT MODELS, AND WHAT IT DOES NOT. It runs Reaction order re-rolled every round,
|
||||
* attack banding with the 1% floor and the 96-99 rule, one defence per incoming blow at
|
||||
* the stacking defence penalty, graded defences, damage by band with armour ignored on a
|
||||
* critical and halved on a special, major wounds, and the dying clock. It does NOT model
|
||||
* hit locations, bleeding, panic, Coherence, cover, range bands, fire modes or burst.
|
||||
* Those all exist in rules.mjs and all matter; they are not here yet, and every one of
|
||||
* them makes a fight WORSE for whoever is losing. Read the output as a floor on how bad
|
||||
* a creature is, never as a ceiling.
|
||||
* critical and halved on a special, major wounds, and the dying clock.
|
||||
*
|
||||
* It also, now, models HIT LOCATIONS — 1d20 against the defender's own species table,
|
||||
* melee finding limbs and shooting finding centre of mass, each location carrying its
|
||||
* own share of the pool, disabled at its maximum and destroyed at twice it. The
|
||||
* consequences apply: a destroyed head is unconscious immediately, a ruined arm costs
|
||||
* you every attack, a ruined leg costs you every dodge, and a Cadence losing a body
|
||||
* costs the whole creature 10% of everything it does.
|
||||
*
|
||||
* That last one is why this was worth doing. A Cadence has no vital and no head, so it
|
||||
* cannot be dropped by a lucky shot and instead degrades toward useless; measured
|
||||
* without locations it was simply a person with an odd portrait, and the number the
|
||||
* harness printed was about a creature nobody was playing.
|
||||
*
|
||||
* It still does NOT model bleeding, panic, Coherence, cover, range bands, fire modes or
|
||||
* burst. Those all exist in rules.mjs, they all matter, and every one of them makes a
|
||||
* fight WORSE for whoever is losing. Read the output as a floor, never as a ceiling.
|
||||
*/
|
||||
import {
|
||||
hitPointsFor, majorWoundFor, damageModifierFor, reactionBaseFrom,
|
||||
resolveBands, gradeRoll, defenceOutcomeFor, defencePenaltyFor,
|
||||
conditionFor, dyingLimitFor, REACTION
|
||||
conditionFor, dyingLimitFor, REACTION,
|
||||
locationFor, resolveLocationHit, locationsFor, locationMaxHp,
|
||||
locationEffectsFor, woundPenaltyFrom
|
||||
} from "../rules.mjs";
|
||||
import { WEAPONS, ARMOURS, NPCS, PREGENS } from "./content.mjs";
|
||||
import { ROSTER } from "./roster.mjs";
|
||||
@@ -145,8 +159,19 @@ export function buildCombatant(rawSpec, { side = "?" } = {}) {
|
||||
|
||||
const worn = (spec.armour ?? []).reduce((t, k) => t + (ARMOUR.get(k)?.points ?? 0), 0);
|
||||
|
||||
/* Every location this species has, each with its own share of the hit points. The
|
||||
share comes from the creature's OWN table, so a cadence gets five bodies at 0.28
|
||||
apiece and no vital at all, and a vesh gets a ridge instead of a head. */
|
||||
const species = spec.species ?? "baseline";
|
||||
const locations = locationsFor(species).map(l => ({
|
||||
id: l.id, kind: l.kind,
|
||||
max: locationMaxHp(hp, l.frac),
|
||||
taken: 0, disabled: false, destroyed: false
|
||||
}));
|
||||
|
||||
return {
|
||||
side, key: spec.key, name: spec.name,
|
||||
species,
|
||||
hpMax: hp, hp,
|
||||
majorWound: majorWoundFor(hp),
|
||||
majorWounds: 0,
|
||||
@@ -155,14 +180,20 @@ export function buildCombatant(rawSpec, { side = "?" } = {}) {
|
||||
armour: worn + (Number(spec.naturalArmour) || 0),
|
||||
dodge: skills.get("dodge:") ?? 0,
|
||||
arms,
|
||||
locations,
|
||||
wounded: locationEffectsFor(locations),
|
||||
defencesThisRound: 0,
|
||||
dyingRounds: 0,
|
||||
startedUp: true
|
||||
};
|
||||
}
|
||||
|
||||
/* A destroyed head is "unconscious immediately", which conditionFor has always known how
|
||||
to read and this harness never told it — so a headshot used to leave the target
|
||||
standing and swinging. */
|
||||
const conditionOf = c => conditionFor({
|
||||
hp: c.hp, dyingRounds: c.dyingRounds, majorWound: c.majorWounds
|
||||
hp: c.hp, dyingRounds: c.dyingRounds, majorWound: c.majorWounds,
|
||||
unconscious: !!c.wounded?.unconscious
|
||||
});
|
||||
const isFighting = c => conditionOf(c) === "up";
|
||||
|
||||
@@ -172,15 +203,24 @@ function attack(rng, attacker, defender) {
|
||||
const arm = attacker.arms[0];
|
||||
if (!arm) return;
|
||||
|
||||
const level = gradeRoll(d100(rng), resolveBands(arm.rating));
|
||||
// Where a blow lands depends on how it was thrown: melee finds limbs, because they are
|
||||
// between you and the target, and shooting finds centre of mass.
|
||||
const mode = arm.w.cls === "melee" ? "melee" : "ranged";
|
||||
|
||||
// A wounded attacker is a worse attacker. Melee and ranged both take the MANIPULATION
|
||||
// penalty — losing an arm is what stops you fighting, whatever is in your hand — and
|
||||
// the mapping comes from rules.mjs rather than being restated here.
|
||||
const atkPen = woundPenaltyFrom(attacker.wounded, mode);
|
||||
const level = gradeRoll(d100(rng), resolveBands(arm.rating, { situational: atkPen }));
|
||||
if (level === "fumble" || level === "failure") return;
|
||||
|
||||
// One defence per incoming blow, at the stacking penalty for each already spent this
|
||||
// round. A defender with nothing left still gets the roll — at a rating the penalty
|
||||
// has usually driven to the 1% floor, which resolveBands enforces rather than us.
|
||||
// round, PLUS whatever a ruined pair of legs costs — dodge is a `phys` skill, so a
|
||||
// disabled leg is exactly what stops you getting out of the way.
|
||||
let landing = level;
|
||||
if (defender.dodge > 0) {
|
||||
const penalty = defencePenaltyFor(defender.defencesThisRound);
|
||||
const penalty = defencePenaltyFor(defender.defencesThisRound)
|
||||
+ woundPenaltyFrom(defender.wounded, "phys");
|
||||
const dLevel = gradeRoll(d100(rng), resolveBands(defender.dodge, { situational: penalty }));
|
||||
defender.defencesThisRound++;
|
||||
const outcome = defenceOutcomeFor(level, dLevel);
|
||||
@@ -201,8 +241,34 @@ function attack(rng, attacker, defender) {
|
||||
|
||||
const taken = Math.max(0, dmg - armour);
|
||||
if (taken <= 0) return;
|
||||
if (taken >= defender.majorWound) defender.majorWounds++;
|
||||
|
||||
/* Locate it. 1d20 against the defender's own species table, then the damage goes to
|
||||
that location AND to general hit points — the two systems agree rather than
|
||||
competing, which is what resolveLocationHit is for.
|
||||
|
||||
This is where a Cadence stops being a person with a funny picture. Its five bodies
|
||||
each carry 0.28 of the pool, it has no vital and no head, so it cannot be dropped by
|
||||
one good shot; instead every body that goes costs the whole creature -10% to
|
||||
everything, and it degrades toward useless rather than dying. A Vesh, conversely,
|
||||
has a ridge for a vital that is a LONG target rather than a small one. None of that
|
||||
could be measured before, because damage was never located. */
|
||||
const loc = locationFor(d(rng, 20), defender.species, mode);
|
||||
const slot = defender.locations.find(l => l.id === loc.id) ?? defender.locations[0];
|
||||
const res = resolveLocationHit({
|
||||
damage: taken,
|
||||
locationMax: slot.max,
|
||||
locationTaken: slot.taken,
|
||||
majorWoundThreshold: defender.majorWound
|
||||
});
|
||||
slot.taken = res.locationTaken;
|
||||
slot.disabled = res.disabled;
|
||||
slot.destroyed = res.destroyed;
|
||||
if (res.majorWound) defender.majorWounds++;
|
||||
|
||||
defender.hp -= taken;
|
||||
// Recomputed from the whole body, not accumulated, because the effects fold together
|
||||
// rather than stacking per hit — two disabled legs are one condition, not two.
|
||||
defender.wounded = locationEffectsFor(defender.locations);
|
||||
}
|
||||
|
||||
/** One fight to a conclusion. Returns which side stood, and how long it took. */
|
||||
|
||||
Reference in New Issue
Block a user