Skip to content

Commit

Permalink
[Mods] Psionic powers say "Power level" instead of "Spell level" in t…
Browse files Browse the repository at this point in the history
…he UI (#74150)

* Initial commit

* Update src/magic.cpp

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

* Update src/magic.cpp

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

* Update src/magic.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 May 29, 2024
1 parent bf808f6 commit 8b0ea8d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2505,11 +2505,19 @@ void spellcasting_callback::spell_info_text( const spell &sp, int width )
} else if( temp_level_adjust > 0 ) {
temp_level_adjust_string = " (+" + std::to_string( temp_level_adjust ) + ")";
}
const bool is_psi = sp.has_flag( spell_flag::PSIONIC );

info_txt.emplace_back(
colorize( columnize( string_format( "%s: %d%s%s", _( "Spell Level" ), sp.get_effective_level(),
sp.is_max_level( pc ) ? _( " (MAX)" ) : "", temp_level_adjust_string.c_str() ),
string_format( "%s: %d", _( "Max Level" ), sp.get_max_level( pc ) ) ), c_light_gray ) );
if( is_psi ) {
info_txt.emplace_back(
colorize( columnize( string_format( "%s: %d%s%s", _( "Power Level" ), sp.get_effective_level(),
sp.is_max_level( pc ) ? _( " (MAX)" ) : "", temp_level_adjust_string.c_str() ),
string_format( "%s: %d", _( "Max Level" ), sp.get_max_level( pc ) ) ), c_light_gray ) );
} else {
info_txt.emplace_back(
colorize( columnize( string_format( "%s: %d%s%s", _( "Spell Level" ), sp.get_effective_level(),
sp.is_max_level( pc ) ? _( " (MAX)" ) : "", temp_level_adjust_string.c_str() ),
string_format( "%s: %d", _( "Max Level" ), sp.get_max_level( pc ) ) ), c_light_gray ) );
}
info_txt.emplace_back(
colorize( columnize( sp.colorized_fail_percent( pc ),
string_format( "%s: %d", _( "Difficulty" ), sp.get_difficulty( pc ) ) ), c_light_gray ) );
Expand All @@ -2522,7 +2530,6 @@ void spellcasting_callback::spell_info_text( const spell &sp, int width )
info_txt.emplace_back( );

const bool cost_encumb = sp.energy_cost_encumbered( pc );
const bool is_psi = sp.has_flag( spell_flag::PSIONIC );
if( is_psi ) {
std::string cost_string = cost_encumb ? _( "Channeling Cost (impeded)" ) : _( "Channeling Cost" );
std::string energy_cur = sp.energy_source() == magic_energy_type::hp ? "" :
Expand Down

0 comments on commit 8b0ea8d

Please sign in to comment.