Skip to content

Commit

Permalink
Move spell cost calculation up slightly to account for spell cost ter…
Browse files Browse the repository at this point in the history
…naries (CleverRaven#69760)

* Initial commit

* Update src/activity_handlers.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Standing-Storm and github-actions[bot] authored Nov 26, 2023
1 parent e504afd commit dfb8658
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3775,11 +3775,12 @@ 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 );
Expand Down

0 comments on commit dfb8658

Please sign in to comment.