Skip to content

Commit

Permalink
[Magiclysm] Incremental spellcrafting skill gain (and focus loss) in …
Browse files Browse the repository at this point in the history
…spell study (#48021)

* Incremental spellcrafting skill gain (and focus loss) in spell study

* oh this is already in scope
  • Loading branch information
Musteval authored Mar 14, 2021
1 parent fb7f80e commit 45f883c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4361,6 +4361,8 @@ void activity_handlers::study_spell_do_turn( player_activity *act, player *p )
const int xp = roll_remainder( studying.exp_modifier( *p ) / to_turns<float>( 6_seconds ) );
act->values[0] += xp;
studying.gain_exp( xp );
p->practice( studying.skill(), xp, studying.get_difficulty() );

// Notify player if the spell leveled up
if( studying.get_level() > old_level ) {
p->add_msg_if_player( m_good, _( "You gained a level in %s!" ), studying.name() );
Expand All @@ -4376,8 +4378,6 @@ void activity_handlers::study_spell_finish( player_activity *act, player *p )
if( act->get_str_value( 1 ) == "study" ) {
p->add_msg_if_player( m_good, _( "You gained %i experience from your study session." ),
total_exp_gained );
const spell &sp = p->magic->get_spell( spell_id( act->name ) );
p->practice( sp.skill(), total_exp_gained, sp.get_difficulty() );
} else if( act->get_str_value( 1 ) == "learn" && act->values[2] == 0 ) {
p->magic->learn_spell( act->name, *p );
}
Expand Down

0 comments on commit 45f883c

Please sign in to comment.