nthiebes / old-world-builder

An army builder for Warhammer: The Old World and Warhammer Fantasy Battles.
https://old-world-builder.com
Other
25 stars 38 forks source link

Add generated spells selection for casters to the game view #201

Closed TheFakeCake closed 1 month ago

TheFakeCake commented 3 months ago

This PR aims to add generated spell selection to the game view (issue #190).

<GeneratedSpells>

The new <GeneratedSpells> component used in the <GameView> page handles the UI.

lores-of-magic-with-spells.json

A new JSON data file containing all the lores of magic and their spells has been added.

Spell rules index

Spells have been added to the rules index.

Demo

spell_generation_demo.webm

nthiebes commented 3 months ago

Very nice! 🙌 I'm moving houses right now, so it will take a bit before I can properly review your pr.

nthiebes commented 2 months ago

@TheFakeCake Hey, for some reason I thought that I already let you know that the spells are now available in the export. Apparently not! If you pull from master, the rules-index-export.json should now contain all the spells.

TheFakeCake commented 2 months ago

I updated the PR to use the now available spell rules export. I also added support for Lore of Chaos spell filtering depending on the unit's Mark of Chaos.

There are unhandled edge cases for now, like Magic Items giving access to spells for example, but the feature is already usable.

Special things that need support (not a complete list)

nthiebes commented 2 months ago

@TheFakeCake It works great! 🙌 I only had two comments, so I hope we're soon ready to ship it.

TheFakeCake commented 2 months ago

I added support for a few more magic items and options (including Spell Familiar).

About the lores and spells translations, I can put all of them in :

Which would you prefer ?

TheFakeCake commented 2 months ago

So, it was kind of painful to use the localization files for the translations, but it's done, though the lores of magic exist both in the i18n files and nameMap.

I tried removing them from the nameMap and use the translations instead, but the RuleLink components are so dependant on the existing system, I met a wall.

Speaking of rules link, I also had to make a new component, only used for the spells at the moment.

nthiebes commented 1 month ago

I have a once in a lifetime excuse (hopefully 🤞) why it took me so long to finally merge this. The house I just moved to was hit by a lightning strike and was on fire 🔥. Not joking…

Your PR looks great, and I'll merge it now and release it next week.

TheFakeCake commented 1 month ago

Woaah, sorry to read that, I hope it's ok

Don't worry about the PRs, take all the time you need