Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Features "Add the ability for bionics to teach spells"
Purpose of change
The Technomander in Magiclysm is suppose to be a class that is a hybrid of using CBMs and magic, but there was quite a lack of ability to do that in a lot of ways.
Describe the solution
Add a std::map<spell_id, int> to bionic_data and appropriate logic in Character::add_bionic and Character::remove_bionic that allow you to learn (and then forget) spells attached to a CBM. Spells that have a spell class will override any spell class you currently have, making you forget any spell learned from that spell class. Hopefully those who mod via json don't write conflicting CBMs or they might end up with some weird circumstances, though i wouldn't exactly consider that a bug, more "not using this right".
Testing
Loaded a world with magiclysm, learned all spells, gave the character EARTHSHAPER (which conflicts with technomancer). debug installed the optical sneeze beam cbm and lost the earthhshaper trait and all associated spells, gained technomancer and learned optical sneeze beam at level 4. Uninstalled the CBM and lost optical sneeze beam (technomancer stays). installed while already knowing optical sneeze beam at level 1, and it sets it to level 4.
Additional context
I considered adding an activation to bionics that would activate a spell, but i think that it could be a separate pr, and not necessary for magiclysm right now.
Relies on #39938