SamuKata
PathCompanion
PathCompanion

patreon


Spells! Or, what exactly is low-hanging fruit?

I've taken a quick break from archetypes to work on spells. Unfortunately, spells require the most patience from me, and sometimes they're hard to focus on for long periods of time.

This is mostly due to the fact that, like General feats, there are a ton of very niche spells that technically have an effect, and for completeness' sake should probably be implemented in PathCompanion. But, they're so niche, sometimes very complicated, and rarely used that it's not really worth it at the moment. Now is the time for low-hanging fruit (unless one of you needs something especially specific!). Focusing on the high-profile spells effects like haste, slow, and polymorph are much more interesting to people than spells like mental block, hide bruises, and batrachian surge (not to mention especially niche and complicated spells like Fey Blight and Fey Boon). At the same time, sometimes those spells aren't that hard to implement, so I do them anyway.

Sorting through each spell, reading what it does in detail, determining whether it has some sort of mechanical effect, determining if it's worth spending the effort on implementing that effect (or just writing in a marker for now, or a TODO) takes a lot of brainpower and patience, so this part of app development is going much slower, unfortunately. Bear with me - in my next release I hope to have all the important 3rd-level spells and below implemented.

Occasionally I get sidetracked because I come up with a Brilliant Idea that doesn't take that much time, so I commit myself to doing it. For example, my database of spell information I downloaded had the HTML formatting for spell information (yay!) but it didn't embed links (boo). Of course, I don't want to link to d20pfsrd or aonprd, so that's OK. I've been putting off linking up tooltip info within spell descriptions for a while, so I decided to commit myself to doing it as part of this next update.

I wrote a quick regular expression to search out any time an item is in italics in a spell's description (`<i>(.*?)</i>`, if anyone is interested), and then went through each instance of italic content in every spell in the database. This ended up being about 5500 instances, but with a quick glance I could tell if:

  a) is the content in the italics a referenced spell?

and

  b) Is the referenced spell self-referential (meaning, if you're looking at the description for "fireball" and it references itself, we don't want to create a tooltip to show you the info you're already looking at).

and

  c) Are the italics lined up correctly? (You have no idea how often the text decoration is incorrectly aligned on the spell name. For example, in "delayed blast fireball" sometimes looks like "delayed blast <i>fireball</i>" and sometimes looks like <i>delayed blast <i>fireball</i></i> - so I cleaned those up)

Then a quick replacement with a function call (`{renderSpellInline("\L$1", "$1)}`) quickly replaces the spell name with a tooltip (because React is a wonderful framework to work with). This has turned out to be absolutely invaluable, because so many spells say simply "This spell works exactly as X except as noted above." and it drives me crazy to not be able to quickly look up that information.

Doing that for about 5500 instances only took about 8 hours of work. It was a bit tedious, but strangely not as tedious as reading the spells and making low-hanging fruit judgment calls on each one.

Speaking of which, I guess I should get back to that.


More Creators