Poison window
poison-window · an adoption of Timed window, version 1
Use in your game
Opens the authoring tool with these answers and settings already filled in. You still add your game's own rules and tuning.
What is in the ZIP
The ZIP holds the adoption and its acceptance tests. In the authoring tool, choose Add contract and pick this ZIP. If you keep your design as files, put them in contracts/.
The contract behind it
Covers named time windows such as invulnerability, cooldowns, status effects, and restart locks. It says what happens when a window opens again, pauses, ends early, or expires. What opens each window, and how long it lasts, stays with your game.
Questions
The supplied answer is marked on each question. Pick other answers to see what changes. Nothing is saved here: the ZIP and the authoring tool use the supplied answers.
Numbersno numbers
This contract has no numbers to set.
Rulesno rules
A rule is a check between the numbers. Validation reports a rule that fails.
This contract has no rules between its numbers.
Lists1 list
Each list holds the rows this adoption supplies. A list can be empty.
Windows
windows
| Id | Opens at | Duration | Duration unit | Clock | While suspended | On retrigger | Retrigger cap | Ends early | Early end |
|---|---|---|---|---|---|---|---|---|---|
poison | 02-mechanics.md#poison | combat.poison_duration_turns | turns | 02-mechanics.md#turn-clock | — | extend-to-cap | combat.poison_duration_cap_turns | declared-ending | 02-mechanics.md#poison-removal |
Test inputsscope and seeds
Some tests need a scope or seeds from the adoption before they can run.
declared-window-set
Declared window set
- Scope
- the poison window named in Ash Circuit's Fixed combat rules
Acceptance tests4 tests apply
The contract comes with 7 tests. A test that runs once per row is counted once for each row. Tests that do not apply to these answers are still listed, with the reason.
declared-window-set
the declared window list matches the game
Applies to poison-window.
The window list in poison-window is complete for the poison window named in Ash Circuit's Fixed combat rules: every window in scope has one row, no window has two rows, and no row names something outside the scope.
Test steps and diagnostics
- Scope
the poison window named in Ash Circuit's Fixed combat rules- Holds
every timed window in scope has exactly one row in
poison-window, and every row inpoison-windownames a timed window in scope
opens-and-expires · poison
poison opens and expires on its declared clock
Applies to the poison row.
poison opens on the occurrence defined at 02-mechanics.md#poison, reads its turns duration from combat.poison_duration_turns, and closes after that much progress on the clock defined at 02-mechanics.md#turn-clock.
Test steps and diagnostics
- Given
the
poisonwindow closed, with its opening defined at02-mechanics.md#poison, its duration atcombat.poison_duration_turnsinturns, and its clock at02-mechanics.md#turn-clock- When
- the opening defined at
02-mechanics.md#poisonoccurs once, with no repeat trigger and no declared early ending
- the opening defined at
- Then
poisonbecomes open when that occurrence happens- a change to the value or calculation at
combat.poison_duration_turnsafter that moment does not move this copy's endpoint; the copy still closes after the duration read at opening - it is still open when the clock at
02-mechanics.md#turn-clockhas advanced by exactly that duration - it is closed at the first observable step after the clock has advanced beyond that duration
- Diagnostics
poison-window-poison-open-close-tracepoison-window-poison-clock-trace
retrigger-behavior
Row.id handles a repeat trigger in the declared way
Does not apply to poison-window: no row in windows matches on-retrigger ignore or new duration or keep longer or stack.
retrigger-extends-to-cap · poison
poison extends on a repeat trigger without passing its cap
Applies to the poison row.
Repeat triggers extend poison without passing the cap at combat.poison_duration_cap_turns. The worked cases leave twelve units when four remain and ten are added under a cap of twelve, and nine when four remain and five are added, fixing both the addition and the cap.
Test steps and diagnostics
- Scope
repeat triggers of
poisonwhile one copy is open- Holds
a repeat trigger adds the newly granted duration to the remaining time without passing the cap at
combat.poison_duration_cap_turns; the arithmetic gives twelve units when four remain, ten are added, and the cap is twelve, and gives nine units when four remain, five are added, and the cap is twelve- Diagnostics
poison-window-poison-trigger-tracepoison-window-poison-remaining-time-trace
expiry-is-the-only-ending
Row.id cannot end early
Does not apply to poison-window: no row in windows matches ends-early expiry only.
declared-ending-closes · poison
poison closes at its declared early ending
Applies to the poison row.
Every open poison copy on the entity the ending happens to closes when the event or condition defined at 02-mechanics.md#poison-removal occurs, unless the cited prose names more. Remaining duration does not delay an affected copy's ending.
Test steps and diagnostics
- Given
one or more
poisoncopies open with time remaining, with their early ending defined at02-mechanics.md#poison-removal- When
- one early-ending event or condition defined at
02-mechanics.md#poison-removaloccurs
- one early-ending event or condition defined at
- Then
- every open
poisoncopy on the entity the ending happens to closes at that occurrence, unless the prose at02-mechanics.md#poison-removalnames more - no remaining duration keeps any affected copy open
- every open
- Diagnostics
poison-window-poison-early-ending-trace
suspension-behavior
Row.id treats suspended play in the declared way
Does not apply to poison-window: no row in windows matches duration-unit seconds or frames or ticks.
JSONthe adoption as one file
The adoption file as supplied. Answers you try on this page are not written into it; to change an adoption, open it in the authoring tool.
{
"contract": "timed-window",
"version": 1,
"origin": "https://opengdd.org/contracts/timed-window-1",
"summary": "Covers named time windows such as invulnerability, cooldowns, status effects, and restart locks. It says what happens when a window opens again, pauses, ends early, or expires. What opens each window, and how long it lasts, stays with your game.",
"mechanism": [
"Each row declares one timed window. The row cites the game's own Fixed material for what opens it, its duration, and the clock that advances it; the contract owns none of those game-specific rules or numbers. An opening is an event of the entity the window is given to. Each entity that the game's rules give the window gets its own instance, opened, advanced, and closed by that entity's own events, unless the adoption's Fixed prose explicitly names the window as shared. This per-entity reading is binding for every sentence and generated check that speaks of open copies. The validator cannot check this; a reviewer does.",
"When the cited opening occurs, the duration is read once and the window opens for that duration; later changes to the cited number or calculation do not move an open copy's endpoint. A fixed duration cites its tuning number; a duration computed from game state cites the Fixed prose that defines the calculation. A window includes its named last moment: it is still open exactly when the cited clock has advanced by that duration, and closed at any point after that, unless its row says it can end early.",
"A row's on-retrigger answer applies when its opening occurs again while that window is open. ignore leaves the open copy unchanged. new-duration replaces its remaining time with the newly granted duration. keep-longer keeps whichever is longer: the remaining time or the newly granted duration. extend-to-cap adds the newly granted duration to the time remaining, but never leaves more than the row's cited cap. The same open copy continues under ignore, new-duration, keep-longer, and extend-to-cap, and its history shows one opening; only stack creates a new copy. stack opens another independent copy and leaves every open copy unchanged. A game whose extension has a largest permitted duration names that duration as its cap; a game that permits no largest duration states the exception in its own prose and adopts this contract as promised rather than checked. A game whose stacking has a largest number of open copies states that limit in its own prose and adopts this row as promised rather than checked; this contract does not count copies.",
"Under expiry-only, nothing closes any open copy before its duration ends; a retrigger's own rewrite of an open copy's remaining time is not an early closure. Under declared-ending, the event or condition cited by the row closes every open copy on the entity the ending happens to, unless the cited prose names more; this covers copies being used, cancelled, dispelled, or otherwise ended by the game.",
"stops means the row's clock does not advance while ordinary play is suspended. keeps-running means it does. The cited clock definition decides what ordinary play being suspended means; this contract does not define pause or catch-up behavior.",
"The answers belong to each window row, not to the game as a whole. If one apparent window follows different repeat-trigger rules for different opening causes, this version does not model those causes separately; the game must name them as separate windows or state the exception in its own prose."
],
"questions": {},
"declares": {
"rows": {
"windows": {
"description": "List every named window. An empty list is a claim its author must defend. A cap uses the window's unit and cannot be shorter than its normal duration. The duration unit must match the clock. A real-time window cannot use turns to avoid the suspension choice. The validator cannot check this; a reviewer does.",
"record": {
"id": {
"type": "string",
"required": true,
"pattern": "kebab-case",
"unique": true,
"description": "The window's stable name as your game writes it. A poison effect might be named poison."
},
"opens-at": {
"type": "citation",
"required": true,
"description": "Where your fixed game prose says what opens the window. A poison window might open when a poisoned attack lands."
},
"duration": {
"type": "citation",
"required": true,
"description": "Where your game states how long the window lasts. Cite a number for a fixed duration, or fixed prose for a duration calculated from game state. The value is read when the window opens. For example, poison may read its turn count when the hit lands."
},
"duration-unit": {
"type": "string",
"required": true,
"options": [
"seconds",
"frames",
"ticks",
"turns"
],
"description": "The unit used by the duration and its clock. Seconds measure real time. Frames count updates. Ticks count clock steps. Turns count game turns. A poison effect might use turns."
},
"clock": {
"type": "citation",
"required": true,
"description": "Where your fixed game prose names the clock that closes this window. A poison effect may use the turn clock."
},
"while-suspended": {
"type": "string",
"when": {
"row": {
"duration-unit": [
"seconds",
"frames",
"ticks"
]
}
},
"options": [
"stops",
"keeps-running"
],
"description": "For a window whose clock runs with play — seconds, frames, or ticks — whether that clock pauses with ordinary play. If it stops, an invulnerability window keeps all its remaining time during a pause. If it keeps running, the window can expire before play resumes."
},
"on-retrigger": {
"type": "string",
"required": true,
"options": [
"ignore",
"new-duration",
"keep-longer",
"extend-to-cap",
"stack"
],
"description": "What a new opening does while this window is already open. Ignore leaves the poison window unchanged. New duration replaces its remaining time with the duration from the new poison hit. Keep longer uses whichever time is longer. Extend to cap adds time without passing its cap. Stack opens another independent poison copy. Only stacking creates a new copy. Every other choice continues the current copy and keeps one opening in its history."
},
"retrigger-cap": {
"type": "citation",
"when": {
"row": {
"on-retrigger": [
"extend-to-cap"
]
}
},
"description": "Where your game states the largest amount of time that can remain after an extension. A poison effect may cap all extensions at its maximum duration. Add this only when repeat openings extend up to a cap. Use the same unit as the duration."
},
"ends-early": {
"type": "string",
"required": true,
"options": [
"expiry-only",
"declared-ending"
],
"description": "Whether the window can close before its duration ends. Expiry only keeps a poison effect open until time runs out. A declared ending lets a cure close every open poison copy on the entity it cures, unless the cited prose names more."
},
"early-end": {
"type": "citation",
"when": {
"row": {
"ends-early": [
"declared-ending"
]
}
},
"description": "Where your fixed game prose names every event or condition that ends this window early. This includes using or cancelling it. For poison, this may be an antidote or cleansing the target. Add this only when the window can end early."
}
}
}
}
},
"pack": "sha256:0b00f8a7b2f1f165dbffc65ea394d7fad1cb9fdf6dc123b74bf78c675ad138ed",
"answers": {},
"values": {},
"rows": {
"windows": [
{
"id": "poison",
"opens-at": "02-mechanics.md#poison",
"duration": "combat.poison_duration_turns",
"duration-unit": "turns",
"clock": "02-mechanics.md#turn-clock",
"on-retrigger": "extend-to-cap",
"retrigger-cap": "combat.poison_duration_cap_turns",
"ends-early": "declared-ending",
"early-end": "02-mechanics.md#poison-removal"
}
]
},
"verification": {
"declared-window-set": {
"scope": "the poison window named in Ash Circuit's Fixed combat rules"
}
}
}