Skip to content

Commit

Permalink
Touchups to spellcasting behavior and UI (#2598)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaosvolt committed Apr 15, 2023
1 parent ad32f42 commit ca7c4f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,7 @@ static void cast_spell()
if( !can_cast_spells ) {
add_msg( game_message_params{ m_bad, gmf_bypass_cooldown },
_( "You can't cast any of the spells you know!" ) );
return;
}

const int spell_index = u.magic->select_spell( u );
Expand Down
10 changes: 9 additions & 1 deletion src/panels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,15 @@ static void draw_mana_wide( const player &u, const catacurses::window &w )

static bool spell_panel()
{
return get_avatar().magic->knows_spell();
std::vector<spell_id> spells = get_avatar().magic->spells();
bool has_manacasting = false;
for( spell_id sp : spells ) {
spell temp_spell = get_avatar().magic->get_spell( sp );
if( temp_spell.energy_source() == mana_energy ) {
has_manacasting = true;
}
}
return has_manacasting;
}

bool default_render()
Expand Down

0 comments on commit ca7c4f3

Please sign in to comment.