Skip to content

Add birthAugur item type for extensible birth augur automation#686

Open
cyface wants to merge 6 commits intomainfrom
feature/birth-augur-automation
Open

Add birthAugur item type for extensible birth augur automation#686
cyface wants to merge 6 commits intomainfrom
feature/birth-augur-automation

Conversation

@cyface
Copy link
Collaborator

@cyface cyface commented Mar 4, 2026

Summary

  • New birthAugur item type: Extensible item with effect field for automation (replaces hard-coded index-only approach)
  • Item-first actor integration: _getBirthAugurBonusFor() and prepareDerivedData() check birthAugur items first, falling back to legacy birthAugurIndex for un-migrated characters
  • Single augur enforced: Adding a new birthAugur item auto-deletes existing ones via _onCreateDescendantDocuments
  • Actor sheet UI: Shows augur item display (icon + name + modifier + delete) when item exists, legacy dropdown when not, compendium link when core book is active
  • PC parser: Creates birthAugur items on import alongside legacy birthAugurIndex
  • World migration: migrateBirthAugurToItem() creates birthAugur items for Player actors with legacy birthAugurIndex
  • Item sheet: New template with name, effect type dropdown, description, and image
  • i18n: 20 new keys translated in all 7 language files (en, de, es, fr, it, pl, cn)
  • Tests: 5 new item-based lookup tests, 15 pc-parser tests updated with birthAugur item expectations

Companion PR

Test plan

  • npm test — 553 tests pass
  • npm run format — lint clean
  • npm run compare-lang — no missing keys
  • Manual: drag augur from compendium → automation works
  • Manual: delete augur → automation stops
  • Manual: PC parser import → augur item created
  • Manual: existing character with birthAugurIndex → legacy fallback works
  • Manual: world migration → augur items created for old characters

🤖 Generated with Claude Code

cyface and others added 5 commits March 3, 2026 21:43
Create module/birth-augurs.mjs with all 30 DCC birth augurs, their
effect types, and a matchAugurFromText() helper for migration/parsing.
Add birthAugurIndex field to base-actor.mjs with auto-migration from
existing birthAugur text. Add birthAugurMode config to player-data.mjs.

Refs: #684 #470

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d tests

- Use birthAugurEffect instead of birthAugurMod in template conditional
  to avoid Handlebars treating 0 as falsy (hid modifier for luck 10-11)
- Clear _computedBirthAugurEffect and _computedBirthAugurMod when no
  augur is selected to prevent stale values
- Add tests for armorClass and speed augur effects
- Remove unused i18n keys (BirthAugurCustom, BirthAugurIndex)
- Fix design doc file name reference

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Translate 37 new birth augur i18n keys into Chinese, German,
Spanish, French, Italian, and Polish.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Register new birthAugur item type with data model (effect field),
config entries (item type, default image, effect dropdown labels),
system.json document type, item-piles filter, compendium link,
and bump migration version to 0.67.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cyface cyface changed the title Automate birth augur (lucky roll) modifiers Add birthAugur item type for extensible birth augur automation Mar 4, 2026
- Move _birthAugurItem cache before compute methods in
  prepareDerivedData to fix item-based augur bonuses not applying
- Add .catch() to fire-and-forget deleteEmbeddedDocuments in
  _onCreateDescendantDocuments
- Add warning log for out-of-range augurIndex in migration
- Fix DCC.Delete → DCC.ItemDelete in template tooltip
- Simplify _getBirthAugurBonusFor to use cached _birthAugurItem
- Simplify item-based tests to set _birthAugurItem directly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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