Gang missions and outcome tables
The built-in gang missions are moving from fixed code into validated data. Sabotage is the first mission that runs on the full outcome-table path: it scouts for a target, resolves any defenders, applies an ordered list of consequences, and then settles the resulting gold.
For the player-facing description of the same mission (what the mission preview shows, how the take is reduced on the way home), see Gang Missions.
Sabotage target selection
Section titled “Sabotage target selection”Each gang runs Sabotage independently during the weekly gang update:
- It computes its own scouting chance. Leader Intelligence counts twice and gang-average Intelligence counts once; the result is clamped to 40-90%.
- On a successful scouting roll, it selects uniformly from rivals that still have a gang, a business, a brothel, a bar, a gambling hall, or gold.
- It resolves its own fight and commits its own outcome table before the next gang acts.
There is no shared target reservation or combined-party attack. Several gangs can randomly select the same rival, but later gangs read the rival’s updated state. A rival stripped of every eligible asset is no longer a candidate.
Sabotage gold formula
Section titled “Sabotage gold formula”The funding row runs after combat, so gang.num is the surviving headcount:
requested = rival.gold / 10 + 75 * gang.numfunded = min(requested, rival.gold)All arithmetic is integer arithmetic; division truncates toward zero. The
funding effect removes the applied amount from the rival and writes that exact
amount into the transient haul variable.
The concealed cache
Section titled “The concealed cache”After the base grab, the table can move extra gold and one or two named valuables out of the rival. Each find is a one-off stash: nothing about it is saved, and the same rival can lose another cache in a later raid.
The discovery chance is tiered on gang.scouting (the planning-time scouting
score the mission preview shows): 5% below 40, 10% from 40, 20% from 60, and
30% from 80. The cache row only fires when the rival had gold before the raid
and still has gold after the base grab, and it spends exactly one percent draw
at the selected chance.
On success the row removes
clamp(rival.gold / 20 + gang.scouting + gang.scouting_magic / 2, 100, 2500)from the rival, where rival.gold is the value after the base grab. That
amount joins haul before any complication row runs, so the trip home can
still eat into it.
The report’s “warded cache” wording appears at gang.scouting_magic 60 or
higher. The threshold picks text only; Magic’s contribution to the gold is the
continuous gang.scouting_magic / 2 term above.
The valuables come from a weighted pick-one table (weights 4:1 for one item
versus two). Picks are drawn without replacement from the sabotage_valuables
pool, so two valuables are always two different items.
Ordered consequence chain
Section titled “Ordered consequence chain”The built-in table evaluates these rows in document order:
| Row | Gate | Effect | Random draws |
|---|---|---|---|
| Cache chance tiers | always | Set cache_chance from gang.scouting |
None (first-match) |
| Concealed cache | rival had gold, and still has gold after the base grab | Remove the clamped cache gold from the rival, add it to haul |
One percent draw at cache_chance |
| Cache report | cache found | Prose only (warded or plain by gang.scouting_magic) |
None (first-match) |
| Cache valuables | cache found | Grant one or two items from sabotage_valuables |
One weighted 4:1 count draw, then one or two pick draws |
| Bond burn | haul >= 4000 |
Remove haul / 10 |
None |
| Spilled sack | haul >= 4 |
50% chance to remove haul / 4 |
One percent draw; on success, one weighted 3:1 prose draw |
| Police bribe | haul >= 2000 after earlier losses |
Remove a random 15-30% of the current haul | One random(16) draw |
| Settlement | haul > 0 |
Credit the remaining haul as plunder | None |
The bribe is the last complication. When the spill does not happen, the
spilled-sack row emits no placeholder line and consumes no prose draw. The
haul >= 4 gate guarantees that a successful spill removes at least one gold.
The accounting line
Section titled “The accounting line”haul is a reconciled variable: one funding step, zero or more reductions,
one settlement. The report’s final line is built from what was actually
applied, never recomputed by the prose:
| Binding | Meaning |
|---|---|
funded |
Gold actually removed from the rival (base grab plus the cache bonus) |
lost |
Sum of the reductions after funding |
net |
Gold actually credited by settlement |
complication_count |
Number of rows that removed gold |
The line is emitted once, and only when at least one complication removed gold. If the rival’s live gold changed between evaluation and commit, the funding, the dependent losses, the settlement and the report are all re-derived from the amount that could actually be removed, without re-rolling any draw.
Item grants
Section titled “Item grants”When the cache row grants valuables, the picked items are offered to your stores in pick order. The first item that does not fit ends the grant, and every later item stays behind even if it would individually have fit, so what you receive is always a prefix of what was picked. The report names what was carried off and what had to stay; it never claims an item arrived when it did not.
Planning-time symbols
Section titled “Planning-time symbols”gang.scouting and gang.scouting_magic are snapshots taken when the
Sabotage plan is assessed, before the target draw and the fight, and carried
into the outcome stage unchanged. They are the same numbers the mission
preview shows. The post-combat gang.magic symbol reflects the surviving crew;
the cache rows deliberately read the planning-time values instead. Missions
without a planning phase leave both symbols at zero.
Outcome-table vocabulary
Section titled “Outcome-table vocabulary”The engine understands ordered rows and pick-one tables. A row may contain:
<If>conditions, which do not consume a draw;<Draw>declarations for explicit random values;<Bind>integer expressions;- registered typed
<Effect>entries; <SetVar>assignments for ordinary chain state;<Prose>references with named bindings.
The gang binding exposes snapshot symbols for gang Intelligence, Charisma,
Combat, Magic, Service, headcount, and the planning-time gang.scouting /
gang.scouting_magic pair. Rival gold, businesses, and brothels are mutable
projected values with matching initial snapshots. Its registered effects can
remove rival gold or assets, credit player plunder, reduce a declared transient
variable, and grant items from a declared pool.
This vocabulary does not become a pack contract until the multi-file loader and the pack overlay rules ship. This page will become an authoring reference when those surfaces are supported; until then, treat it as a description of shipped behaviour.