Skip to content

Commit a333e6c

Browse files
committed
Finish adding magic items
1 parent 7775159 commit a333e6c

File tree

6 files changed

+422
-20
lines changed

6 files changed

+422
-20
lines changed

src/ts/effects/dnd5e/changes/attributes.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ function acFormula({
6060
};
6161
}
6262

63+
function addDarkvision({
64+
value,
65+
priority,
66+
}: {
67+
value: string;
68+
priority?: number;
69+
}): Partial<EffectChangeData> {
70+
return {
71+
key: "system.attributes.senses.darkvision",
72+
mode: CONST.ACTIVE_EFFECT_MODES.ADD,
73+
value,
74+
priority,
75+
};
76+
}
77+
6378
function upgradeDarkvision({
6479
value,
6580
priority,
@@ -75,6 +90,21 @@ function upgradeDarkvision({
7590
};
7691
}
7792

93+
function upgradeTrueSight({
94+
value,
95+
priority,
96+
}: {
97+
value: string;
98+
priority?: number;
99+
}): Partial<EffectChangeData> {
100+
return {
101+
key: "system.attributes.senses.truesight",
102+
mode: CONST.ACTIVE_EFFECT_MODES.UPGRADE,
103+
value,
104+
priority,
105+
};
106+
}
107+
78108
function exhaustion({
79109
value,
80110
priority,
@@ -164,5 +194,7 @@ export {
164194
movement,
165195
upgradeMovement,
166196
upgradeDarkvision,
197+
upgradeTrueSight,
167198
multiplyEncumbrance,
199+
addDarkvision,
168200
};

src/ts/effects/dnd5e/changes/bonuses.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,36 @@ function attackBonus({
2525
};
2626
}
2727

28+
function spellDcBonus({
29+
value,
30+
priority,
31+
}: {
32+
value: string;
33+
priority?: number;
34+
}): Partial<EffectChangeData> {
35+
return {
36+
key: `system.bonuses.spell.dc`,
37+
mode: CONST.ACTIVE_EFFECT_MODES.ADD,
38+
value,
39+
priority,
40+
};
41+
}
42+
43+
function checkBonus({
44+
value,
45+
priority,
46+
}: {
47+
value: string;
48+
priority?: number;
49+
}): Partial<EffectChangeData> {
50+
return {
51+
key: `system.bonuses.abilities.check`,
52+
mode: CONST.ACTIVE_EFFECT_MODES.ADD,
53+
value,
54+
priority,
55+
};
56+
}
57+
2858
function damageBonus({
2959
damageType,
3060
value,
@@ -66,4 +96,4 @@ function saveBonus({
6696
};
6797
}
6898

69-
export { attackBonus, damageBonus, saveBonus };
99+
export { attackBonus, checkBonus, damageBonus, saveBonus, spellDcBonus };

src/ts/effects/dnd5e/changes/midi-qol.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function failAbilitySave({
147147
function advantageSkill({
148148
skillType,
149149
}: {
150-
skillType: "ste";
150+
skillType: "ste" | "prc";
151151
}): Partial<EffectChangeData> {
152152
return {
153153
key: `flags.midi-qol.advantage.skill.${skillType}`,
@@ -258,6 +258,14 @@ function optionalSkill({
258258
};
259259
}
260260

261+
function magicResistanceSaves(): Partial<EffectChangeData> {
262+
return {
263+
key: `flags.midi-qol.magicResistance.save.all`,
264+
mode: CONST.ACTIVE_EFFECT_MODES.CUSTOM,
265+
value: "1",
266+
};
267+
}
268+
261269
export {
262270
advantage,
263271
advantageDeathSave,
@@ -280,4 +288,5 @@ export {
280288
optionalSave,
281289
optionalAbilityCheck,
282290
optionalSkill,
291+
magicResistanceSaves,
283292
};

src/ts/effects/dnd5e/changes/traits.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function addConditionImmunity({
44
condition,
55
}: {
66
condition:
7+
| "diseased"
78
| "frightened"
89
| "paralyzed"
910
| "poisoned"

0 commit comments

Comments
 (0)