# Changelog

## 0.8.8

- **Generated attacks measure in feet.** The statblock generator writes an attack's unit as text ("reach 5 ft."), and the import kept that text, so the attacks of generated creatures carried the unit "ft." instead of dnd5e's "ft". Units now import as dnd5e's own: ft, mi, m and km.
- **Armor Class takes bonuses.** Imported creatures had a flat Armor Class, and dnd5e ignores every bonus on a flat AC: the Shield spell, Shield of Faith, a Ring of Protection, cover. dnd5e 6 also turns a flat AC into an override, which ignores them too. Creatures now import with natural armor at the same value, so bonuses apply. Creatures you already imported keep their flat AC until you import them again.
- **A grab limited only by the grappler grapples.** "If the warden isn't already grappling a creature with this action, the target is Grappled" was read as a prerequisite the import can't check, so the attack never grappled. The grappler's own capacity no longer counts as one, alone or after a size limit.
- **Conditions and spells written as data.** When a creature carries an ability's conditions and the SRD spells it casts as data beside the text, as the statblock generator's creatures will, the import uses them where the text names no condition the import can apply: with their duration, repeat save and escape DC, but never past a gate such as "if the target drops to 0 Hit Points". An ability that casts an SRD spell without saying "casts" still imports as a cast of that spell. Areas already came across as data.

## 0.8.7

Verified on Foundry 14.369 with dnd5e 6.0.6 and Midi-QOL, and on every supported core back to V10 with dnd5e 2.4.1.

**2024 statblocks: abilities written only as text now import as working dnd5e abilities.** This covers creatures whose mechanics exist only in the statblock text, such as every Archives "Make it yours" creature and older Vault entries.
- Saving-throw abilities ("Dexterity Saving Throw: DC 17, each creature in a 30-foot Cone. Failure: 56 (16d6) Fire damage. Success: Half damage.") import with their save, DC, damage, half-damage on a success, and area. Before, they imported as plain actions with no save.
- Damage written as bare dice ("Failure: 2d6 Fire damage") imports as damage too.
- Attacks import their damage. A 2024 attack ("Melee Attack Roll: +5, reach 5 ft. 10 (2d6 + 3) Slashing damage plus 3 (1d6) Acid damage.") used to import with no damage at all.
  - Attacks keep their long range (150/600 ft.) and two-handed damage.
  - "Melee or Ranged" attacks import as both a melee attack at their reach and a ranged one at their range.
- 2024 Line ("60-foot-long, 5-foot-wide Line") and Emanation ("15-foot Emanation") areas get their area.
- Uses from the name: "(Recharge 5–6)" becomes a recharge, and "(3/Day)" becomes daily uses. Each ability keeps a single uses pool instead of an unused second one.
- **Conditions are applied:** Prone, Grappled (with its escape DC), Paralyzed, Poisoned, Restrained and the rest.
  - An attack's conditions land on a hit; a save's land on a failed save.
  - Effects last "until the end of its next turn" or "for 1 minute" as written.
  - "Repeats the save at the end of each of its turns" becomes a Midi-QOL repeating save.
  - 2014 wording works too: "or become frightened for 1 minute" applies the condition (every dragon's Frightful Presence, the Lich's Frightening Gaze, poison stings), and "can repeat the saving throw at the end of each of its turns" becomes the repeating save.
  - "If the target is Large or smaller" limits the condition by size under Midi-QOL.
  - Preconditions ("with Advantage if the target is Grappled") and the creature's own state ("unless the azer has the Incapacitated condition") never become riders.
  - A condition that only some outcomes give stays in the description: one behind a trigger (the Phase Spider's Poisoned needs the bite to drop the target to 0 Hit Points, and so does the Paralyzed "while Poisoned"), a "Failure by 5 or More" result, or one for some targets only ("If the target has 20 Hit Points or fewer").
  - A use with labeled options, such as a sphinx's First, Second and Third Roar or a 2014 metallic dragon's breath weapons ("Cold Breath. … Paralyzing Breath. …"), stays in the description instead of landing every option on one roll.
  - A condition that lasts while another does ("While Poisoned, the target has the Paralyzed condition", "While Grappled, the target has the Restrained condition") shares that condition's effect, so one repeat save, or escaping the grapple, ends both. On Foundry V10, where an effect holds one status, the linked condition is its own effect.
  - A rider with a second prerequisite the import can't check stays in the description ("If the target is a Medium or smaller creature and the darkmantle had Advantage on the attack roll"); a grappler's own "isn't grappling a creature" doesn't count.
  - A trait's description of the creature's own state ("it returns to its vampire form and has the Paralyzed condition") is never applied to a target.
  - Italic save headers ("_Wisdom Saving Throw:_ DC 15") are read as saves.
- **Follow-up rolls become their own activities**, as dnd5e's own 2024 monsters model them:
  - A charge rider ("…moved 20+ feet straight toward it immediately before the hit…") becomes a "Moving Attack" with the extra damage and the condition, so an ordinary hit no longer knocks the target prone. Charge damage that replaces the hit's ("or 11 (2d8 + 2) Bludgeoning damage if the seahorse moved…") replaces it rather than importing as two-handed damage.
  - A "Second Failure" effect, such as the Basilisk's Petrified, becomes a "Second Save".
  - A later save in the same ability, such as Swallow's regurgitation, becomes its own save activity ("Regurgitate: Save"), with its own damage (an ice wall's second save).
  - Damage that repeats on later turns, such as Swallow's acid, becomes a "Damage: Ongoing" roll. The swallow itself applies Blinded and Restrained without dealing the acid, and an attack's rider save no longer deals a later turn's damage up front (a pit fiend's poison, a purple worm's acid).
  - An option instead of the hit's damage, such as the Animated Rug's Smother grappling, blinding and restraining instead of dealing damage, becomes its own "Grapple" attack. An ordinary hit applies none of those conditions.
  - With Midi-QOL, a later turn's damage roll or save is no longer paired with the attack as "other damage" rolled on every hit; an attack's rider save still is.
  - dnd5e 2.x and 3.x have one roll per item, so there these follow-up conditions stay in the description instead of landing with the first roll.
- Damage-only abilities, such as Fire Aura ("each creature … in a 5-foot Emanation … takes 5 (1d10) Fire damage"), roll their damage as a dnd5e damage activity.
- **Abilities that cast a spell** become dnd5e cast activities linked to the SRD spell, as dnd5e's own 2024 monsters do. That covers Misty Step (3/Day), Protective Magic's Counterspell or Shield, and legendary actions such as "uses Spellcasting to cast Command (level 2 version)".
  - A cast that offers several spells ("casts Bless, Dispel Magic, Healing Word, or Lesser Restoration") gets a cast activity for each, and "casts the Misty Step spell" is read too.
  - Each cast spends the ability's daily uses or legendary actions.
  - Casts keep their stated level.

**Abilities the statblock generator invents** are written in looser statblock wording, so the import now reads that wording too:
- Conditions written the 2014 way ("The target is Charmed by the pixie for 1 minute") are applied, with their repeat saves.
- A repeat save's outcome ("At the end of each of the target's turns, it repeats the save. On a failure, the target has the Restrained condition") becomes a "Second Save". A later escalation ("…it has the Petrified condition instead") stays in the description instead of landing on the first failed save.
- Save riders keep their size limit ("If the target is Large or smaller, it must succeed on a DC 15 Strength saving throw or have the Prone condition").
- "Each other creature within 5 feet of it" becomes a 5-foot area, and "5-foot-wide, 30-foot-long" lines keep their width.
- Damage the generator lists for later turns ("burning … at the end of each of its turns") rolls on its own, instead of being added to the breath's first roll.
- A charge trait's extra damage ("…the attack deals an extra 3 (1d6) piercing damage. The target must succeed on a DC 13 Strength saving throw or have the Prone condition.") lands whatever the save; the save only decides Prone. The 2014 SRD's Charge traits (Boar, Minotaur, Unicorn and others) used to lose that damage entirely.

**2024 creatures use 2024 spells**
- Spells and casts for a 2024 creature come only from the 2024 SRD spell compendium, never the 2014 version.
- In worlds without one (dnd5e 2.x/3.x), the spell keeps its description and the import reports it, rather than substituting a 2014 spell.
- Each matched spell records which compendium entry it came from.

**Spells**
- 2024 statblocks import their spells. Spellcasting written as "At Will: …", "2/Day Each: …" or "1/Day: …" (inline or one list per line) now becomes real dnd5e spells, matched from the 2024 compendium. Before, these creatures imported with no spells at all.
- Spells written only as text in the 2014 layout ("Cantrips (at will): …", "1st level (4 slots): …") are matched from the compendium too, instead of importing as text-only items.
- A footnote after the last spell list ("* The archmage casts these spells on itself before combat.") no longer becomes part of the last spell's name.
- On dnd5e 5.1 and later, at-will and innate spells matched from the compendium keep their casting method. Before, they turned into unprepared slot spells, so a creature without slots couldn't cast them. Limited-use spells (2/Day) now spend their own uses instead of a spell slot.

## 0.8.6

Verified on Foundry 14.369 with dnd5e 6.0.6, and on every supported core back to V10.

**Mechanics**
- Attacks with a saving-throw rider ("…must succeed on a DC 14 Constitution saving throw or take 7 (2d6) poison damage") import the save as its own roll. The rider's damage no longer lands on every hit.
- Spells roll the statblock's spell save DC and spell attack bonus, even when they differ from what dnd5e would calculate.
- Healing abilities roll their healing, including ones written as "regains 45 (10d8) hit points".
- Compendium spells match only spells (the Shield spell no longer picks up the Shield armor), at the right level, from the statblock's 2014 or 2024 rules.
- Statblock spell slots are kept instead of being recalculated from caster level.
- Converted statblocks keep their legendary action count, and wall areas keep their stated height.
- On dnd5e 4.x, passive traits that force a save or deal damage (auras) keep their roll.

**Dragging and dropping**
- Dropping onto an unlinked token updates the actor's prototype token when you tick it.
- A multi-file drop uses its JSON file, whatever order the files are in.
- Dropping a package onto an actor in the sidebar works without opening the importer first.
- Creatures dropped on the map go into your Import folder.
- A player's Vault drop places a token with the creature's art.
- The transfer prompt names the creature being changed, and refusals show once.

**Players and permissions**
- Map file drops respect "Players may import creatures".
- Players without upload permission can import packages with embedded art (placeholders are used).
- A player's portrait drag that is not allowed shows a clear message instead of an error.

**Foundry V10–V12**
- Import folders, the custom pose art Browse button and older-style prompts work again on V10–V12.

**Other**
- dnd5e 6 chat cards get the same tidy presentation as earlier versions.
- The My Vault list loads more than 24 creatures on V12+.
- Site media links in saved packages resolve instead of failing.
- No deprecation warnings on Foundry 14 (activity repair and chat hooks updated).
- Removed the last retired Send to Foundry code.

## 0.8.5

- Retired website Send to Foundry and its automatic module queue polling.
- Use Save to Vault, then My Vault import or canvas drag-and-drop. Manual package import, Portrait token drag-and-drop, component selection, account linking, and pose automation remain available.

## 0.8.4

- Creatures imported before 0.8.3 could not have their attack bonuses, save DCs
  or damage edited: the sheet wrote to a second, hidden copy of each activity
  because the import had keyed activities by their AutoToken entry slug instead
  of a Foundry id. The GM's client now repairs those creatures once on load,
  including unlinked tokens already placed on scenes, and reports how many it
  fixed. Edits made in the meantime are kept. `game.modules.get("autotoken").api.repairActivityKeys()`
  runs the same repair on demand.

## 0.8.3

- Remove obsolete manifest metadata that caused an unknown `system` key warning.
- Preserve spell attack bonuses on legacy dnd5e imports without a casting ability.

- Generated activities now use matching, valid Foundry IDs so editing an imported
  activity updates the original rather than creating an incomplete duplicate.
- Monster spell attacks import as features with spell attacks; explicit spell
  entries remain spells. Neither is labeled as a simple melee or ranged weapon.
- Drag the dedicated **Drag Token to Foundry** control beneath the live Portrait
  token canvas to drop the current token into Foundry as an exact 512×512 WebP. The drop is
  self-contained, so it can target another user's world without linking the
  creator's AutoToken account. The destination world still enforces its own
  player-import, Actor Create, ownership, and player-edit permissions.
- **Everything available** now means every component the dropped package really
  contains. A portrait-token-only drop onto an existing token applies the media
  and skips absent statblock mechanics instead of failing the whole transfer.
- Vault drops no longer fail on creatures whose damage is written in stat-block
  notation such as `13 (2d8 + 4)`. Import now reduces those to the rollable dice
  expression, so dnd5e no longer rejects the created items
  (`Expected [%*/], [+-], end of input... but "(" found`).

## 0.8.2

Dragging a creature onto the map works properly now. It lands where you dropped
it, it places the creature you dragged, and a token you happened to have
selected no longer hijacks the drop. You can also drag straight in from your
Vault on autotoken.app, and dropping onto a creature already on the map asks
what to transfer in a prompt you can actually read.

Imports bring their portrait art with them, creatures whose only art is a
portrait are no longer refused, and re-importing a creature updates its name
instead of leaving the one it first arrived with. When an import fails it says
so, rather than reporting success and changing nothing.

## 0.8.1

### New features

- **Send creatures from autotoken.app straight into a running world.** Pick a
  linked world on the site and the creature arrives in Foundry — as a new actor, or
  applied onto the actor or token you have selected, with the same choice of
  portrait, token art and stat block you get from a drop. The world has to be open
  with the module linked; it collects the transfer within a few seconds and reports
  back on the site when it lands.
- **Decide what your players may do.** Three new world settings, in any
  combination: players may use your Vault, players may import creatures they
  supply themselves, and players may edit creatures they own (on by default).
  Whatever you leave off is hidden on their screen rather than shown as a control
  that refuses them.
  - Your AutoToken account is never shared with your players. A player browsing
    your Vault is served by your own client, which holds the account link and
    performs the import for them, so your credentials stay in your browser and the
    Vault works for players while you are online.
  - Creatures a player imports are owned by that player, and a player can only
    change creatures they own — using Foundry's own ownership, so assigning a
    character or granting ownership on an actor is all it takes.
  - Both import settings still respect Foundry's own **Create New Actors**
    permission, which by default only Assistant GMs have. Turning one on while
    Foundry withholds that permission now tells you so instead of silently doing
    nothing.

### Fixes

- **Applying a stat block no longer throws away the artwork that came with it.**
  Dropping a creature onto an existing actor with "Stat block" ticked downloaded
  the portrait and token art into your world and then wrote AutoToken URLs onto the
  actor instead — links Foundry cannot load — so the sheet and token showed broken
  or placeholder art while the import reported success. Applying the same art
  without the stat block had always worked, which is what made it look random.
- **Asking for the circular portrait token gives you the circular portrait token.**
  With a stat block in the same import it quietly substituted the top-down art, on
  both the prototype and the token already on the map.
- **Creatures made only in the Portrait workshop can be imported at all.** A
  creature with portrait art and a circular token but no top-down art and no
  mechanics was refused outright, with an error blaming a missing stat block — even
  though the Vault row offered an enabled Import button.
- **Applying just the portrait no longer demands a stat block.** Portrait art is
  the selection the drop prompt pre-picks for a portrait-only creature, and it
  answered "Create-actor import requires usable statblock mechanics."
- Dragging a creature out of the module's own **My Vault** list onto a token or
  actor now applies portrait-only creatures too, rather than refusing them for
  having no top-down art.
- **Art from early imports can be pulled back into your world.** Creatures
  imported before the module saved media locally kept a storage link on the
  actor and its token. Foundry cannot draw those — the token is blank and the
  console reports a blocked request on every world load — and the repair tool
  could not mend them either, because it tried to download the very link that
  does not answer. It now asks your linked account for the file instead, which
  is the only way it is readable. In a macro or the console:
  `game.modules.get("autotoken").api.repairRemoteMedia()` reports what is
  affected without touching anything, and
  `repairRemoteMedia({ apply: true })` downloads the art and rewrites the
  documents.

## 0.7.1

- **Link AutoToken directly from Foundry.** The primary account-link action now
  opens a signed-in approval page that names the requesting Foundry client and
  requested permissions, with explicit Approve and Deny controls. The one-time
  code and QR flow remain available as an alternate-device fallback.
- **Browse My Vault as a sortable creature registry.** Search, sortable columns,
  pagination, thumbnails, connection status, one-click import, and Vault drag
  flows now share the same registry state and canonical import pipeline across
  supported Foundry versions.
- Protected Vault portrait and pose media now download through scoped AutoToken
  authorization and localize into the Foundry world before actor creation.
  Foundry V10 also keeps its legacy prototype-token image field synchronized so
  localized token art survives actor validation.
- Manual JSON and linked Vault imports now use the same preview, component
  choices, document APIs, warnings, and final import report.
- **Custom stance art for any token.** The AutoToken Poses section of the
  Token Config (prototype and placed tokens) now includes a "Custom stance
  art" block on every token — imported or not. Assign your own image per
  stance (idle, casting, combat, downed) via a file picker or path; the
  existing combat/HP pose automation then drives those images exactly as it
  does for imported pose sets. Custom art overrides imported poses per
  stance, and clearing a field restores the imported art. This makes the
  module useful standalone as a bring-your-own-art state swapper.
- Saving custom stance art applies to the token immediately, matching the
  existing Default-stance behavior.
- **Choose what to import from package files.** Dropping an exported
  AutoToken package (.json) onto a token on the canvas, or onto an actor in
  the sidebar, now opens the same "Choose what to import" prompt the Vault
  drag flow uses — apply just the portrait, just the token art and poses,
  or the statblock to that existing actor without touching the rest.
  Dropped on empty canvas, the file imports as a full new creature at the
  drop position.

## 0.6.4

- Canonical skill totals now survive import without dnd5e proficiency logic
  adding the actor's ability modifier a second time.
- Modern dnd5e activity cards no longer repeat an ability's full description
  or fall back to a weapon/activity subtype in the collapsed chat header.
  AutoToken cards now open collapsed with only the icon and ability name,
  while the existing expandable body retains the canonical text once.
- Activities-era cylinder templates now retain an explicit source height
  instead of falling back to Foundry's 5-foot default.
- Changing a placed token's Default stance now immediately updates the token
  artwork instead of saving only the automation flag.
- Ranged monster attacks now carry a ranged weapon classification instead of
  inheriting dnd5e's Simple Melee item default.

## 0.6.3

- The QR tile no longer collapses onto the Account Link buttons: Foundry
  core pins button heights, which squashed the tile's box while its QR
  content kept rendering on top of the actions above. The tile now sizes
  to its content in every Foundry version.

## 0.6.2

- Account linking works again: the module now calls www.autotoken.app
  directly. The old apex default started redirecting after the domain
  cutover, which silently broke "Get Foundry Code" and the QR image
  (browsers reject CORS preflights that hit a redirect). Clients that
  stored the apex URL are rewritten automatically.
- The Account Link panel is a single clear column: three numbered steps
  (get the code here, open autotoken.app/foundry/link, sign in and enter
  it), full-width buttons that no longer truncate or collide with the QR
  tile, and the QR sits under the actions with a "Scan with your phone"
  label. Once a code is active, opening the approval page becomes the
  primary action.

## 0.6.1

- The AutoToken QA button in the Actors sidebar is now hidden unless the
  "Developer QA Tools" world setting is enabled (it was visible to every GM).

## 0.6.0

- Importer redesign in the AutoToken workshop aesthetic: the header plaque
  and step indicator are gone; the empty state is a drag-and-drop zone with
  browse and paste-JSON entry points beside the Vault link panel, and loading
  a package flows straight into the preview.
- Drag a creature package file anywhere onto the drop zone to load it.
- Linked users open the importer on My Vault; the Settings tab moved to a
  gear button in the status strip.
- First world load whispers the GM a one-time welcome in chat with buttons
  to open the importer or link a Vault.
- The import preview shows the creature's portrait art and a Token Setup
  card: pick the starting pose from the package's pose tiles and toggle
  automatic pose switching (combat art in combat, downed at 0 HP) per actor
  before importing. Packages without a pose set get a pointer to forge one
  on autotoken.app.

## 0.5.0

- Item icons are now carried in the creature package as final URLs and
  localized into the world on import, like portraits and token art.
- Removed the bundled icon catalog, module-side icon resolution, and the
  AutoToken Icons companion module integration. The module no longer ships or
  fetches any icon assets of its own.

## 0.4.1

- Chained identity flow for SRD library generation support.
- Launch verification fixes across import validation and media localization.

## 0.4.0

- Canonical AutoToken creature package import (JSON and ZIP).
- dnd5e NPC actor builder with activities support on dnd5e 3.x+.
- Committed top-down pose set wiring with pose automation.
- Media localizer for world-local hosting of imported art.
- AutoToken Icons companion module integration.
