Skip to content

Commit d93fe2b

Browse files
Merge pull request #35 from TheGiddyLimit/feature/more-items-conversion
2 parents 78dddd8 + 8f58b74 commit d93fe2b

File tree

13 files changed

+732
-36
lines changed

13 files changed

+732
-36
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ There is a lot of 5e content to automate, so all contribution is welcomed and ap
2525

2626
### Coordination
2727

28-
We organise on the [5eTools Discord server](https://discord.gg/5etools).
28+
We organise on the [5etools Discord server](https://discord.gg/5etools).
2929

3030
Although we will respond to issues and pull requests here, the easiest way to get a quick response or report minor typos/bugs is to message the **#plutonium-addon-automation** channel. Come join us if you'd like to help out! (*Especially* join us if you plan to fill out a lot of data at once—helps avoid wasted effort.)
3131

@@ -34,9 +34,10 @@ Although we will respond to issues and pull requests here, the easiest way to ge
3434
## Setting up
3535

3636
Run these precursory steps when you first set up:
37+
3738
1) Install [Node.js](https://nodejs.org/en/).
3839
2) Clone this repo locally.
39-
3) Run `npm i` within the your local repo.
40+
3) Run `npm i` within your local repo.
4041

4142
### Building locally
4243

@@ -50,13 +51,13 @@ Use `npm t` to verify the data files against the schema.
5051

5152
## Development guide
5253

53-
There isn't yet a tutorial to explain the data format. However, you can likely work most of it out by looking at examples. Familiarity with [5eTools' homebrew](https://github.com/TheGiddyLimit/homebrew) format and Foundry's data structure (including for [dnd5e](https://github.com/foundryvtt/dnd5e/wiki/Roll-Formulas), [DAE](https://gitlab.com/tposney/dae/-/blob/master/Readme.md#supported-fields-for-dnd5e), etc.) is very helpful.
54+
There isn't yet a tutorial to explain the data format. However, you can likely work most of it out by looking at examples. Familiarity with [5etools' homebrew](https://github.com/TheGiddyLimit/homebrew) format and Foundry's data structure (including for [dnd5e](https://github.com/foundryvtt/dnd5e/wiki/Roll-Formulas), [DAE](https://gitlab.com/tposney/dae/-/blob/master/Readme.md#supported-fields-for-dnd5e), etc.) is very helpful.
5455

5556
### Data layout
5657

5758
The `module/data/` directory is laid out as follows:
58-
- Each 'entity type' (the array names in 5eTools' JSON format—`"monster"`, `"spell"`, `"classFeature"`, etc.) is given its own directory.
59-
- Within that directory, a `__core.json` file contains data for all entities which are natively available on 5eTools (i.e. without loading homebrew).
59+
- Each 'entity type' (the array names in 5etools' JSON format—`"monster"`, `"spell"`, `"classFeature"`, etc.) is given its own directory.
60+
- Within that directory, a `__core.json` file contains data for all entities which are natively available on 5etools (i.e. without loading homebrew).
6061
- Within the same directory, each homebrew source has its own file named `<brewSourceJson>.json` (e.g. `WJMAiS.json` for *Wildjammer: More Adventures in Space*). If a homebrew source has multiple datatypes, one file per datatype is required (excluding datatypes without automation).
6162

6263
### Macros
@@ -66,6 +67,7 @@ Many facets of automation must be handled with macros. These are attached using
6667
In the [`macro-item/`](./macro-item) directory is a directory for each datatype. Save your (well-formatted, commented) macro code as a Javascript file in one of these directories, structured as an async function named `macro`, with filename `<sourceJson>_<item-name-lowercase-hyphenated>.js` (e.g. `XGE_toll-the-dead.js`). **Note that the first and last lines of the file**—the ones that turn the macro into an async function—**are stripped on compilation into the module's data**.
6768

6869
You can create a new macro file using the `npm run mt --` command. The directory (`-d`) should match that of the JSON file into which the macro will be built.
70+
6971
```bash
7072
npm run mt -- -d <directory> -s <jsonSource> -n <entity name>
7173
# example: npm run mt -- -d spell -s PHB -n "toll the dead"
@@ -89,7 +91,7 @@ In the interests of consistency and user experience, we have some guidelines to
8991
1) **We play D&D 5e.**
9092
- Always assume the default ruleset.
9193
- If you can do some fancy (invisible) macro work to support variant rules, go ahead, but never compromise core function.
92-
2) **Maximum eficiency; minimum effort.**
94+
2) **Maximum efficiency; minimum effort.**
9395
- If something can be automated reliably, it should.
9496
- If something can't be automated reliably, it shouldn't.
9597
- Avoid automating only half of an item's effects without somehow informing the user of this.
@@ -103,4 +105,4 @@ In the interests of consistency and user experience, we have some guidelines to
103105
4) **KISS: keep it simple, sweetie.**
104106
- Avoid using macros except when absolutely necessary, and make sure they're readable and maintainable.
105107
- Certainly avoid referencing anything outside the item that you can't guarantee will be present.
106-
- Plutonium should only import one item per game-mechanic name. If a single class feature or spell has multiple, indepdendent functions (e.g. the paladin class' Lay on Hands feature), activating that item should prompt the user to choose the function (via a [macro](https://github.com/TheGiddyLimit/plutonium-addon-automation/issues/26)).
108+
- Plutonium should only import one item per game-mechanic name. If a single class feature or spell has multiple, independent functions (e.g. the paladin class' Lay on Hands feature), activating that item should prompt the user to choose the function (via a [macro](https://github.com/TheGiddyLimit/plutonium-addon-automation/issues/26)).

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ As above, *Plutonium Add-on: Automation* is designed for the extensive automatio
3434
## Required set-up
3535

3636
You **must** configure some modules in a specific way, or the automation won't work. Configure the following:
37+
3738
- _**DFreds Convenient Effects** > Modify Status Effects_ — select either `Replace` (preferred) or `Add`.
3839
- _**Midi QoL** > Midi QoL config > Workflow > Apply Convenient Effects_ — select `Apply Item effects, if absent apply CE`.
3940

4041
If you have [Item Macro](https://github.com/Kekilla0/Item-Macro) active, you also need to configure it as follows:
42+
4143
- _**Item Macro** > Override default macro execution_ — uncheck this.
4244
- _**Item Macro** > Character Sheet Hook_ — uncheck this.
4345
- (If installed) _**[Token Action HUD](https://github.com/Drental/fvtt-tokenactionhud)** > Item-Macro: item macro, original item, or both_ — select `Show the original item`. (Note this is a user setting, so ensure that each user does this or use a module such as [Force Client Settings](https://gitlab.com/kimitsu_desu/force-client-settings) to guarantee it.)
4446

4547
## Contributing
4648

47-
Please see [`CONTRIBUTING.md`](./CONTRIBUTING.md).
49+
Please see [`CONTRIBUTING.md`](./CONTRIBUTING.md).

module/data/_generated/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"classFeature":{"PHB":{"Rogue":{"3":{"TCE":{"Steady Aim":0}}}}},"feat":{"PHB":{"Heavy Armor Master":1,"War Caster":1}},"item":{"DMG":{"Sentinel Shield":2}},"optionalfeature":{"TCE":{"Fire Rune":3}},"raceFeature":{"GiddyRace":{"Awakened Skeleton":{"GiddyRace":{"Skeletal":4}}}},"spell":{"GiddySpell":{"Collapse Astronomical Body":5,"Create Void":5},"WJMAiS":{"Hold Helm":6},"PHB":{"Blade Ward":7,"Heroism":7,"Hold Person":7,"Tongues":7,"True Strike":7},"TCE":{"Mind Sliver":7},"SCC":{"Silvery Barbs":7},"XGE":{"Toll the Dead":7}},"subclassFeature":{"PHB":{"Wizard":{"TCE":{"Bladesinging":{"2":{"TCE":{"Bladesong":8}}}}}}},"_file":{"0":"classFeature/__core.json","1":"feat/__core.json","2":"item/__core.json","3":"optionalfeature/__core.json","4":"raceFeature/GiddyRace.json","5":"spell/GiddySpell.json","6":"spell/WJMAiS.json","7":"spell/__core.json","8":"subclassFeature/__core.json"}}
1+
{"classFeature":{"PHB":{"Monk":{"2":{"PHB":{"Patient Defense":0}},"18":{"PHB":{"Empty Body":0}}},"Barbarian":{"1":{"PHB":{"Rage":0}}},"Rogue":{"3":{"TCE":{"Steady Aim":0}}}}},"feat":{"PHB":{"Heavy Armor Master":1,"Inspiring Leader":1,"War Caster":1}},"item":{"DMG":{"Sentinel Shield":2}},"optionalfeature":{"TCE":{"Fire Rune":3}},"raceFeature":{"GiddyRace":{"Awakened Skeleton":{"GiddyRace":{"Skeletal":4}}},"PHB":{"Elf":{"PHB":{"Fey Ancestry":5}}}},"spell":{"GiddySpell":{"Collapse Astronomical Body":6,"Create Void":6},"WJMAiS":{"Hold Helm":7},"PHB":{"Aura of Purity":8,"Bane":8,"Barkskin":8,"Beacon of Hope":8,"Blade Ward":8,"Bless":8,"Blur":8,"Darkvision":8,"Fly":8,"Greater Invisibility":8,"Haste":8,"Heroism":8,"Hold Person":8,"Invisibility":8,"Sanctuary":8,"Tongues":8,"True Strike":8,"Vicious Mockery":8},"XGE":{"Frostbite":8,"Toll the Dead":8},"TCE":{"Mind Sliver":8,"Tasha's Caustic Brew":8},"SCC":{"Silvery Barbs":8}},"subclassFeature":{"PHB":{"Wizard":{"TCE":{"Bladesinging":{"2":{"TCE":{"Bladesong":9}}}}}}},"_file":{"0":"classFeature/__core.json","1":"feat/__core.json","2":"item/__core.json","3":"optionalfeature/__core.json","4":"raceFeature/GiddyRace.json","5":"raceFeature/__core.json","6":"spell/GiddySpell.json","7":"spell/WJMAiS.json","8":"spell/__core.json","9":"subclassFeature/__core.json"}}

module/data/classFeature/__core.json

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,204 @@
11
{
22
"classFeature": [
3+
{
4+
"name": "Empty Body",
5+
"source": "PHB",
6+
"className": "Monk",
7+
"classSource": "PHB",
8+
"level": 18,
9+
"effects": [
10+
{
11+
"flags": {
12+
"core": {
13+
"statusId": "Empty Body"
14+
},
15+
"dae": {
16+
"specialDuration": [
17+
"shortRest"
18+
]
19+
}
20+
},
21+
"changes": [
22+
{
23+
"key": "macro.CE",
24+
"mode": "CUSTOM",
25+
"value": "Invisible",
26+
"priority": "20"
27+
},
28+
{
29+
"key": "data.traits.dr.value",
30+
"mode": "ADD",
31+
"value": "acid",
32+
"priority": "20"
33+
},
34+
{
35+
"key": "data.traits.dr.value",
36+
"mode": "ADD",
37+
"value": "bludgeoning",
38+
"priority": "20"
39+
},
40+
{
41+
"key": "data.traits.dr.value",
42+
"mode": "ADD",
43+
"value": "cold",
44+
"priority": "20"
45+
},
46+
{
47+
"key": "data.traits.dr.value",
48+
"mode": "ADD",
49+
"value": "fire",
50+
"priority": "20"
51+
},
52+
{
53+
"key": "data.traits.dr.value",
54+
"mode": "ADD",
55+
"value": "lightning",
56+
"priority": "20"
57+
},
58+
{
59+
"key": "data.traits.dr.value",
60+
"mode": "ADD",
61+
"value": "necrotic",
62+
"priority": "20"
63+
},
64+
{
65+
"key": "data.traits.dr.value",
66+
"mode": "ADD",
67+
"value": "piercing",
68+
"priority": "20"
69+
},
70+
{
71+
"key": "data.traits.dr.value",
72+
"mode": "ADD",
73+
"value": "poison",
74+
"priority": "20"
75+
},
76+
{
77+
"key": "data.traits.dr.value",
78+
"mode": "ADD",
79+
"value": "psychic",
80+
"priority": "20"
81+
},
82+
{
83+
"key": "data.traits.dr.value",
84+
"mode": "ADD",
85+
"value": "radiant",
86+
"priority": "20"
87+
},
88+
{
89+
"key": "data.traits.dr.value",
90+
"mode": "ADD",
91+
"value": "slashing",
92+
"priority": "20"
93+
},
94+
{
95+
"key": "data.traits.dr.value",
96+
"mode": "ADD",
97+
"value": "thunder",
98+
"priority": "20"
99+
}
100+
],
101+
"duration": {
102+
"seconds": 60
103+
}
104+
}
105+
]
106+
},
107+
{
108+
"name": "Patient Defense",
109+
"source": "PHB",
110+
"className": "Monk",
111+
"classSource": "PHB",
112+
"level": 2,
113+
"effects": [
114+
{
115+
"changes": [
116+
{
117+
"key": "flags.midi-qol.grants.disadvantage.attack.all",
118+
"mode": "OVERRIDE",
119+
"value": "1",
120+
"priority": "20"
121+
},
122+
{
123+
"key": "flags.midi-qol.advantage.ability.save.dex",
124+
"mode": "OVERRIDE",
125+
"value": "1",
126+
"priority": "20"
127+
}
128+
],
129+
"duration": {
130+
"seconds": 7
131+
},
132+
"flags": {
133+
"dae": {
134+
"specialDuration": [
135+
"turnStartSource",
136+
"shortRest"
137+
]
138+
}
139+
}
140+
}
141+
]
142+
},
143+
{
144+
"name": "Rage",
145+
"source": "PHB",
146+
"className": "Barbarian",
147+
"classSource": "PHB",
148+
"level": 1,
149+
"effects": [
150+
{
151+
"flags": {
152+
"dae": {
153+
"specialDuration": [
154+
"shortRest"
155+
]
156+
}
157+
},
158+
"changes": [
159+
{
160+
"key": "data.bonuses.mwak.damage",
161+
"mode": "ADD",
162+
"value": "floor(0.132 * @classes.barbarian.levels + 1.93)",
163+
"priority": "20"
164+
},
165+
{
166+
"key": "data.traits.dr.value",
167+
"mode": "ADD",
168+
"value": "slashing",
169+
"priority": "20"
170+
},
171+
{
172+
"key": "data.traits.dr.value",
173+
"mode": "ADD",
174+
"value": "piercing",
175+
"priority": "20"
176+
},
177+
{
178+
"key": "data.traits.dr.value",
179+
"mode": "ADD",
180+
"value": "bludgeoning",
181+
"priority": "20"
182+
},
183+
{
184+
"key": "flags.midi-qol.advantage.ability.save.str",
185+
"mode": "OVERRIDE",
186+
"value": "1",
187+
"priority": "20"
188+
},
189+
{
190+
"key": "flags.midi-qol.advantage.ability.check.str",
191+
"mode": "OVERRIDE",
192+
"value": "1",
193+
"priority": "20"
194+
}
195+
],
196+
"duration": {
197+
"seconds": 60
198+
}
199+
}
200+
]
201+
},
3202
{
4203
"name": "Steady Aim",
5204
"source": "TCE",

module/data/feat/__core.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
}
1818
]
1919
},
20+
{
21+
"name": "Inspiring Leader",
22+
"source": "PHB",
23+
"effects": [
24+
{
25+
"flags": {
26+
"dae": {
27+
"specialDuration": [
28+
"shortRest"
29+
]
30+
}
31+
}
32+
}
33+
]
34+
},
2035
{
2136
"name": "War Caster",
2237
"source": "PHB",

module/data/raceFeature/__core.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"raceFeature": [
3+
{
4+
"name": "Fey Ancestry",
5+
"source": "PHB",
6+
"raceName": "Elf",
7+
"raceSource": "PHB",
8+
"effects": [
9+
{
10+
"changes": [
11+
{
12+
"key": "data.traits.ci.value",
13+
"mode": "ADD",
14+
"value": "unconscious",
15+
"priority": "20"
16+
}
17+
],
18+
"transfer": true
19+
}
20+
]
21+
}
22+
]
23+
}

0 commit comments

Comments
 (0)