From 33fcc042ec419b270424643148dc21d38064396a Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Sat, 25 Nov 2023 22:53:32 -0600 Subject: [PATCH 1/2] Initial commit --- src/activity_handlers.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index d6b19b2ad42a7..96ec5bf9a44a2 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -3775,11 +3775,13 @@ void activity_handlers::spellcasting_finish( player_activity *act, Character *yo // spells with the components in hand. spell_being_cast.use_components( *you ); + // pay the cost. Allows ternaries based on having an effect or trait to calculate cost correctly + int cost = spell_being_cast.energy_cost( *you ); + spell_being_cast.cast_all_effects( *you, *target ); if( act->get_value( 2 ) != 0 ) { - // pay the cost - int cost = spell_being_cast.energy_cost( *you ); + switch( spell_being_cast.energy_source() ) { case magic_energy_type::mana: you->magic->mod_mana( *you, -cost ); From ddb4eaa68377acf39090690c3649bd9ed93ec1bc Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Sat, 25 Nov 2023 23:24:00 -0600 Subject: [PATCH 2/2] Update src/activity_handlers.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/activity_handlers.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 96ec5bf9a44a2..aae8b2c3a2b26 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -3781,7 +3781,6 @@ void activity_handlers::spellcasting_finish( player_activity *act, Character *yo spell_being_cast.cast_all_effects( *you, *target ); if( act->get_value( 2 ) != 0 ) { - switch( spell_being_cast.energy_source() ) { case magic_energy_type::mana: you->magic->mod_mana( *you, -cost );