Support target-scoped trauma mechanics

This commit is contained in:
JB
2026-07-27 22:20:52 -04:00
parent 7e78d75f85
commit 0b3be3587b
20 changed files with 1032 additions and 93 deletions
+21 -8
View File
@@ -2005,20 +2005,33 @@ branches, ordered outcomes, and the generated read-only script. Use connected
panels and restrained borders to preserve the hierarchy; do not present the
typed graph as an undifferentiated form.
Talent editors place that surface inside the shared `modeling-disclosure`
pattern. New `CAPTURED ONLY` Talents start with an empty program and a collapsed
`COMBAT MODELING` summary so authors can record identity, image, and source
description first. Existing modeled Talents open the disclosure when edited.
Mechanic validation errors open it and keep the relevant error text visible.
The summary reports `CAPTURE ONLY · MODEL LATER` or the configured branch count
in text. Its native disclosure semantics preserve keyboard and assistive
technology support; mobile targets remain at least 44 pixels tall.
The direct-event picker reads the 19 normalized events from the code-defined
event registry. Use searchable single-assignment because the vocabulary exceeds
the compact segmented-choice limit. Each branch presents its event, match
policy and parameters, optional cooldown, state mutations, and outcomes.
Recipe-generated predicates and weights remain visible in the generated
script. State rows expose label, agent or target scope, initial value, bounds,
best-case value, and optional expiry. Outcome rows expose kind, target scope,
Attribute or resource when applicable, value basis, state scaling, phase, and
every source-specific value column. The Value Model control supports static
values, live Attribute percentages, event fields, reducer output, source-defined
scenario controls, and OS Protocol upgrade scaling where the source permits it.
Selecting a live Attribute uses the shared searchable single-assignment pattern
and displays the Attribute's unit. Label the percentage-normalized model
`ATTRIBUTE ÷ 100` so authors can see the transform applied to the stored value.
best-case value, and optional expiry. A state change that writes a target pool
uses a `STATE OWNER` segmented control with `EVENT TARGET` and `EVENT ACTOR`;
the selected owner remains visible in the generated script. Outcome rows expose
kind, target scope, Attribute or resource when applicable, value basis, state
scaling, phase, and every source-specific value column. The Value Model control
supports static values, live Attribute totals, percentage-normalized Attribute
values, event fields, reducer output, source-defined scenario controls, and OS
Protocol upgrade scaling where the source permits it. Selecting either
Attribute model uses the shared searchable single-assignment pattern and
displays the Attribute's unit. Label the direct model `LIVE ATTRIBUTE`. Label
the percentage-normalized model `ATTRIBUTE ÷ 100` so authors can see the
transform applied to the stored value.
Restoration outcomes also expose an
`INSTANT` or `CONTINUOUS` segmented choice. Continuous delivery reveals one
required duration field and describes the configured value as the total
+21 -3
View File
@@ -398,7 +398,10 @@ normalized events are `shot_fired`, `weapon_hit`, `skill_deployed`,
`movement_snapshot`, `proximity_snapshot`, `firing_started`, `firing_stopped`,
`reload_started`, `reload_completed`, `weapon_swapped`, and `tick`. Event
details such as target, distance, critical state, source, movement, and nearby
counts travel as typed event values.
counts travel as typed event values. The event registry publishes authoritative
field metadata where branches need a bounded contract. For example,
`weapon_hit.values.headshot` is a boolean that distinguishes headshots from
body shots.
The optional Action Family catalog provides authoring recipes for common
mechanics. Applying a recipe copies its typed scenario inputs, state pools, and
@@ -408,6 +411,12 @@ dependency. Adding another recipe appends branches. Replacing a program with a
recipe requires confirmation because replacement discards the current branch
graph.
A Talent may save an empty `captured_only` program while an author records its
name, category, image, and source description. The registry marks that Talent
`CONFIG REQUIRED`, and calculations exclude it. Changing readiness to `ready`
or `requires_assumptions` restores strict branch, numbered-outcome, and
description-placeholder validation.
The program graph uses three child tables:
- `conditional_effect_state_pools` defines agent- or target-scoped flags,
@@ -418,14 +427,16 @@ The program graph uses three child tables:
state mutations, and optional recipe provenance. Reducers convert event
streams into counts, distinct or consecutive matches, sliding windows,
durations, intervals, or derived values. Mutations can set, add, consume,
clear, derive, or transfer state.
clear, derive, or transfer state. A mutation may bind a target-scoped pool to
the current event target, event actor, or another typed entity selector. Each
target owns an independent value and expiry timer.
- `conditional_effect_outcomes` applies Attribute modifiers, direct damage,
restoration, resource costs, or markers. Each outcome names its target scope,
value basis, optional resource or Attribute, combat timing, optional state
band, and phase: `on_event`, `after_event`, `on_enter`, `on_exit`, or
`while_active`. One typed value or expression exists for every variant
required by the owning source. The common value models are static values,
live Attribute percentages, event-field values, reducer output,
live Attribute values, percentage-normalized Attribute values, event-field values, reducer output,
source-defined scenario values, and OS Protocol upgrade scaling. Restoration
outcomes may deliver their total immediately or continuously over an explicit
duration.
@@ -436,6 +447,13 @@ convert event streams into activations or derived values. The runtime applies
state mutations, enforces pool bounds and expiry, emits outcomes in phase order,
and records telemetry for each activation.
Each write to an expiring pool refreshes its timer. When a pool expires,
`on_exit` outcomes evaluate stack thresholds and per-stack expressions against
the final value before reset. The runtime records the bound target on emitted
outcomes. A one-second target debuff with a one-second damage cadence can
therefore resolve once at its refreshed shared expiry without inventing
intermediate ticks.
Live Attribute references use a stable Attribute ID and read the authoritative
loadout total that the builder captures for the evaluation pass. Percentage
Attributes retain their displayed units, so an expression that applies a