TheGiddyLimit / plutonium-addon-automation

An interoperability addon which makes Plutonium play nice with automation modules.
https://thegiddylimit.github.io/plutonium-addon-automation/
MIT License
32 stars 7 forks source link

Add integration with Chris's Premades #87

Closed TheGiddyLimit closed 1 year ago

TheGiddyLimit commented 1 year ago

This allows PAA to grab item data from CPR, and return it in a format which Plutonium can use. Note if both PAA and CPR have data for an item, then PAA's version takes priority (i.e., the two are not merged).

See: https://foundryvtt.com/packages/chris-premades

Closes #86


Here's an example of a before/after for Heat Metal

2c2
<   "name": "Heat Metal (Without)",
---
>   "name": "Heat Metal (With)",
24c24
<       "type": "object"
---
>       "type": "creature"
45c45
<     "chatFlavor": "",
---
>     "chatFlavor": "[2d8 - fire] Use a bonus action on each subsequent turn to cause this damage again",
53c53
<           "2d8",
---
>           "2d8[fire]",
61c61
<       "ability": "con",
---
>       "ability": "",
96a97,136
>     "ddbimporter": {
>       "id": 138066,
>       "definitionId": 2141,
>       "entityTypeId": 435869154,
>       "dndbeyond": {
>         "lookup": "generic",
>         "lookupName": "generic",
>         "level": null,
>         "castAtLevel": null
>       },
>       "originalName": "Heat Metal",
>       "sources": [
>         {
>           "sourceId": 1,
>           "pageNumber": null,
>           "sourceType": 2
>         },
>         {
>           "sourceId": 2,
>           "pageNumber": 250,
>           "sourceType": 1
>         }
>       ],
>       "tags": [
>         "Damage",
>         "Debuff"
>       ],
>       "version": "3.3.10",
>       "effectsApplied": true
>     },
>     "custom-character-sheet-sections": {
>       "sectionName": ""
>     },
>     "rest-recovery": {
>       "data": {
>         "recovery": {
>           "enabled": false
>         }
>       }
>     },
98c138,139
<       "effectActivation": false
---
>       "effectActivation": false,
>       "onUseMacroName": "[postActiveEffects]function.await chrisPremades.macros.heatMetal.item"
114a156,180
>     "itemacro": {
>       "macro": {
>         "name": "Heat Metal",
>         "type": "script",
>         "scope": "global",
>         "command": "",
>         "author": "PQGBBcoVSwpUhViM",
>         "_id": null,
>         "img": "icons/svg/dice-target.svg",
>         "folder": null,
>         "sort": 0,
>         "ownership": {
>           "default": 0
>         },
>         "flags": {},
>         "_stats": {
>           "systemId": null,
>           "systemVersion": null,
>           "coreVersion": null,
>           "createdTime": null,
>           "modifiedTime": null,
>           "lastModifiedBy": null
>         }
>       }
>     },
Spappz commented 1 year ago

I also note that Chris' Premades have a lot of junk data in them, some of which appears will be copied over to PAA? The ddbimporter and custom-character-sheet-sections module flags, for instance, shouldn't be used by PAA at all I think.

TheGiddyLimit commented 1 year ago

I also note that Chris' Premades have a lot of junk data in them, some of which appears will be copied over to PAA? The ddbimporter and custom-character-sheet-sections module flags, for instance, shouldn't be used by PAA at all I think.

I kept them in to match CPR's output as closely as possible, since CPR is already outside of our module ecology and so we make no assumptions about what the user is running. That said, they are indeed junky. Wrote a quick script to see what's all in there, and these are the results