Skip to content

Commit

Permalink
Feature Parsing Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPrimate committed Sep 25, 2024
1 parent f79bb84 commit a9d16aa
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 3 deletions.
4 changes: 4 additions & 0 deletions data/class-features.json
Original file line number Diff line number Diff line change
Expand Up @@ -10324,5 +10324,9 @@
{
"name": "Regain Bardic Inspiration",
"path": "icons/magic/control/buff-flight-wings-runes-blue.webp"
},
{
"name": "Imbue Aura of Protection",
"path": "icons/magic/symbols/runes-star-pentagon-orange-purple.webp"
}
]
83 changes: 82 additions & 1 deletion src/parser/enrichers/DDBFeatureEnricher.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { generateATLChange, generateUpgradeChange } from "../../effects/effects.js";
import { effectModules, generateATLChange, generateUpgradeChange } from "../../effects/effects.js";
import utils from "../../lib/utils.js";
import DDBFeatureActivity from "../features/DDBFeatureActivity.js";
import DDBBaseEnricher from "./DDBBaseEnricher.js";
Expand Down Expand Up @@ -739,6 +739,29 @@ export default class DDBFeatureEnricher extends DDBBaseEnricher {
"bonuses.hp": "floor(@classes.sorcerer.levels / 2)",
},
},
"Imbue Aura of Protection": () => {
if (effectModules().atlInstalled) {
return {
type: "utility",
data: {
name: "Use/Apply Light",
},
};
} else {
return {
type: "ddbmacro",
data: {
name: "Use/Apply Light",
macro: {
name: "Apply Light",
function: "ddb.generic.light",
visible: false,
parameters: '{"targetsSelf":true,"targetsToken":true,"lightConfig":{"dim":0,"bright":20},"flag":"light"}',
},
},
};
}
},
"Intimidating Presence": {
// type: "save",
targetType: "creature",
Expand Down Expand Up @@ -1906,6 +1929,28 @@ export default class DDBFeatureEnricher extends DDBBaseEnricher {
},
},
],
"Imbue Aura of Protection": [
{
constructor: {
name: "Aura Damage",
type: "damage",
},
build: {
noeffect: true,
generateConsumption: false,
generateTarget: false,
generateRange: false,
generateActivation: true,
generateDamage: true,
activationOverride: {
type: "special",
value: 1,
condition: "",
},
damageParts: [DDBBaseEnricher.basicDamagePart({ customFormula: "@abilities.mod.cha + @prof", types: ["radiant"] })],
},
},
],
"Lay On Hands: Healing Pool": [
{
constructor: {
Expand Down Expand Up @@ -2619,6 +2664,27 @@ export default class DDBFeatureEnricher extends DDBBaseEnricher {
},
],
},
"Imbue Aura of Protection": {
multiple: () => {
let effects = [];
if (effectModules().atlInstalled) {
effects.push({
type: "feat",
options: {
transfer: false,
},
data: {
"flags.ddbimporter.activityMatch": "Use/Apply Light",
},
atlChanges: [
generateATLChange("ATL.light.bright", CONST.ACTIVE_EFFECT_MODES.OVERRIDE, '@scale.paladin.aura-of-protection'),
generateATLChange("ATL.light.color", CONST.ACTIVE_EFFECT_MODES.OVERRIDE, '#ffffff'),
generateATLChange("ATL.light.alpha", CONST.ACTIVE_EFFECT_MODES.OVERRIDE, '0.25'),
],
});
}
},
},
"Maneuver: Ambush": {
type: "feat",
options: {
Expand Down Expand Up @@ -2845,6 +2911,21 @@ export default class DDBFeatureEnricher extends DDBBaseEnricher {
},
],
},
"Radiant Strikes": {
noActivity: true,
type: "feat",
options: {
transfer: true,
},
changes: [
{
key: "system.bonuses.mwak.damage",
mode: CONST.ACTIVE_EFFECT_MODES.ADD,
value: "1d8[radiant]",
priority: "20",
},
],
},
"Sacred Weapon": {
type: "enchant",
name: "Sacred Weapon",
Expand Down
10 changes: 10 additions & 0 deletions src/parser/enrichers/DDBSpellEnricher.js
Original file line number Diff line number Diff line change
Expand Up @@ -2580,6 +2580,16 @@ export default class DDDSpellEnricher extends DDBBaseEnricher {
generateTokenMagicFXChange("bloom"),
],
},
"Shining Smite": {
type: "spell",
name: "Shedding Light",
atlChanges: [
generateATLChange("ATL.light.bright", CONST.ACTIVE_EFFECT_MODES.OVERRIDE, '5'),
generateATLChange("ATL.light.color", CONST.ACTIVE_EFFECT_MODES.OVERRIDE, '#ffffff'),
generateATLChange("ATL.light.alpha", CONST.ACTIVE_EFFECT_MODES.OVERRIDE, '0.25'),
generateATLChange("ATL.light.animation", CONST.ACTIVE_EFFECT_MODES.OVERRIDE, '{"type": "pulse", "speed": 3,"intensity": 1}'),
],
},
"Slow": {
type: "spell",
changes: [
Expand Down
8 changes: 6 additions & 2 deletions src/parser/spells/DDBSpell.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,15 +803,19 @@ export default class DDBSpell {
}
if (this.spellDefinition.requiresSavingThrow && !this.spellDefinition.requiresAttackRoll) {
return "save";
} else if (this.spellDefinition.tags.includes("Damage") && this.spellDefinition.requiresAttackRoll) {
} else if ((this.spellDefinition.tags.includes("Damage") && this.spellDefinition.requiresAttackRoll)
|| this.spellDefinition.attackType !== null
) {
return "attack";
} else if (this.spellDefinition.tags.includes("Damage")) {
return "damage";
} else if (this.spellDefinition.tags.includes("Healing") && this.healingParts.length === 0) {
return "utility"; // e.g. things like lesser restoration
} else if (this.spellDefinition.tags.includes("Buff")) {
return "utility";
} else if (this.enricher.effect) {
} else if (this.spellDefinition.modifiers.some((mod) => mod.type === "damage")) {
return "damage";
} else if (this.enricher.effect && !this.enricher.effect.noActivity) {
return "utility";
}
// KNOWN_ISSUE_4_0: Enchants like for magic weapon etc
Expand Down

0 comments on commit a9d16aa

Please sign in to comment.