Skip to content

feat(system-builder): conditions on tokens, server side (4e2a1) - #217

Merged
over2take merged 1 commit into
feature/system-builderfrom
sb/4e2a-token-conditions
Oct 9, 2026
Merged

over2take merged 1 commit into
feature/system-builderfrom
sb/4e2a-token-conditions

Conversation

@over2take

Copy link
Copy Markdown
Owner

A token's conditions live in a new locations.conditions column, JSON [{ id, left? }], and in token_vitals, so each game system keeps its own and a switch swaps them with the token's health (tokens/vitals.js FIELDS).

PUT /api/locations/:id/conditions sets the whole list, as the injuries route does: for whoever may change the token's health (tokenAccess.mayChangeHealth), a player's list following them onto every token of theirs. Each entry must be a condition the running system offers (runtime.conditionsIn: a published custom system's own, or the standard set with no modifiers under a built-in game). One that ends after rounds starts at its own rounds unless left is given; unknown ids, duplicates, rounds outside 1 to 99 and more than 60 are refused by name.

The public token list shows which conditions a token has to everyone and the rounds left only to the GM and granted editors. GET /api/systems/conditions/:system lists a system's conditions publicly, with modifiers only for the GM and editors.

Checked on a copy of a real database: both columns added, every token starting with none.

Summary

Test plan

  • Tested locally
  • Tests pass

Pre-merge checklist

Code quality:

  • Code follows project style
  • No breaking changes (or clearly documented)
  • No console errors or warnings

Version & Release:

  • Version bumped? If releasing to users, update:
    • frontend/package.json version
    • docker-compose.yml APP_VERSION
    • CHANGELOG.md with release notes
  • GitHub Actions will auto-tag Docker images with the new version

Before merging to main:

  • All tests passing
  • PR reviewed and approved
  • Branch is up to date with main
  • No merge conflicts

Related issues

A token's conditions live in a new locations.conditions column, JSON
[{ id, left? }], and in token_vitals, so each game system keeps its own and a
switch swaps them with the token's health (tokens/vitals.js FIELDS).

PUT /api/locations/:id/conditions sets the whole list, as the injuries route
does: for whoever may change the token's health (tokenAccess.mayChangeHealth),
a player's list following them onto every token of theirs. Each entry must be a
condition the running system offers (runtime.conditionsIn: a published custom
system's own, or the standard set with no modifiers under a built-in game). One
that ends after rounds starts at its own rounds unless `left` is given; unknown
ids, duplicates, rounds outside 1 to 99 and more than 60 are refused by name.

The public token list shows which conditions a token has to everyone and the
rounds left only to the GM and granted editors. GET
/api/systems/conditions/:system lists a system's conditions publicly, with
modifiers only for the GM and editors.

Checked on a copy of a real database: both columns added, every token starting
with none.
@over2take
over2take merged commit de33da3 into feature/system-builder Oct 9, 2026
4 checks passed
@over2take
over2take deleted the sb/4e2a-token-conditions branch October 13, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant