foundryvtt / dnd5e

An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com).
MIT License
321 stars 218 forks source link

Shift type-specific logic into data models where possible #2094

Open arbron opened 1 year ago

arbron commented 1 year ago
JPMeehan commented 8 months ago

SpellData#getCardData returns context.isSpell = true, but the places isSpell gets used just do a plain type check for type === "spell". This makes it difficult for module subtypes that are spell-like (psionic powers, martial maneuvers from 3pp) to display info as richly as the system-native spells.

JPMeehan commented 8 months ago

Similar issue with property sorting - right now it's a hard check of if ( item.type !== "spell" ) context.properties = sortObjectEntries(context.properties, "label");, but having this be a (static?) property of a module subtype would allow for more customization