-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make enchantment mutations work again #78659
Make enchantment mutations work again #78659
Conversation
astyle Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This is because your calories remain constant but your new size expects appropriate caloric values for that size. In the druid form transformation EoCs, I have effects to directly modify your calories to account for the size changes (and return you to where they were before when you change back), whereas the Blood Mage spell just applies the mutations and has no such special handling. Becoming emaciated is an undesirable side effect of growing bigger so suddenly. I did include flags to handle shapeshifted size ( |
It have special handling, but only if you gain the destroyer's soul through its spell. Spawing the item directly bypasses the handling EOC. I know, I'm the one who added the demonic possession handling. |
I've seen this, and maybe we can use this flag to recalculate your body fat percentage: void Character::recalculate_size()
{
if( has_flag( json_flag_TEMPORARY_SHAPESHIFT ) ) {
- if( has_flag( json_flag_SHAPESHIFT_SIZE_TINY ) ) {
- size_class = creature_size::tiny;
- } else if( has_flag( json_flag_SHAPESHIFT_SIZE_SMALL ) ) {
- size_class = creature_size::small;
- } else if( has_flag( json_flag_SHAPESHIFT_SIZE_LARGE ) ) {
- size_class = creature_size::large;
- } else if( has_flag( json_flag_SHAPESHIFT_SIZE_HUGE ) ) {
- size_class = creature_size::huge;
- } else {
- size_class = creature_size::medium;
- }
+ magical_resize();
} else {
if( has_flag( json_flag_TINY ) ) {
size_class = creature_size::tiny;
@@ -545,6 +535,28 @@ void Character::recalculate_size()
path_settings->size = size_class;
}
+void Character::magical_resize()
+{
+ const float bmi_before = get_bmi_fat();
+ creature_size old_size_class = size_class;
+ if( has_flag( json_flag_SHAPESHIFT_SIZE_TINY ) ) {
+ size_class = creature_size::tiny;
+ } else if( has_flag( json_flag_SHAPESHIFT_SIZE_SMALL ) ) {
+ size_class = creature_size::small;
+ } else if( has_flag( json_flag_SHAPESHIFT_SIZE_LARGE ) ) {
+ size_class = creature_size::large;
+ } else if( has_flag( json_flag_SHAPESHIFT_SIZE_HUGE ) ) {
+ size_class = creature_size::huge;
+ } else {
+ size_class = creature_size::medium;
+ }
+ if( old_size_class != size_class ) {
+ const float bmi_after = get_bmi_fat();
+ int nkcal = get_stored_kcal() * bmi_before / bmi_after;
+ set_stored_kcal( nkcal );
+ }
+} Nah, this does not work when back to human, need to reconsider it. |
Summary
Infrastructure "Make enchantment mutations work again"
Purpose of change
Fix #74994
Fix #77971
Describe the solution
Removed dead codes about enchantment mutations.
Made new infrastructure, that save mutations to
cached_mutations
, allow functioning mutations to be properly read inenchantment_cache
.New enchantment mutations will override old enchantments and conflicting
my_mutations
, following the mutating rules. Overridden mutations are disabled untill said enchantments are removed.Removed redundants caused by #74994 .
Describe alternatives you've considered
Testing
Worked fine and passed test cases locally.
Picking up The Architect's Cub and you can immediately see through walls.
Wear the Ixythyug the Destroyer's soul, and see that the bonus stats actually have effect, and the conflicting no longer works.
Transform to a bear, you got the traits, buffs, flags, integrated armors etc correctly, and can't transform into a cougar unless first back to human.
Change to cougar and see that you can pounce.
The mutation UI and @ menu also work as expected, character creating and debug mutating works as usual.
Additional context
Wearing the Ixythyug the Destroyer's soul immediately makes you emaciated, while druid transforming does not have this side effect. Is this intended behavior?