Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Magiclysm] Can't cast if Stunned #48651

Merged
merged 2 commits into from
Jul 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static const efftype_id effect_alarm_clock( "alarm_clock" );
static const efftype_id effect_incorporeal( "incorporeal" );
static const efftype_id effect_laserlocked( "laserlocked" );
static const efftype_id effect_relax_gas( "relax_gas" );
static const efftype_id effect_stunned( "stunned" );

static const itype_id itype_radiocontrol( "radiocontrol" );
static const itype_id itype_shoulder_strap( "shoulder_strap" );
Expand Down Expand Up @@ -1486,6 +1487,12 @@ static bool assign_spellcasting( Character &you, spell &sp, bool fake_spell )
return false;
}

if( !sp.has_flag( spell_flag::NO_HANDS ) && you.has_effect( effect_stunned ) ) {
add_msg( game_message_params{ m_bad, gmf_bypass_cooldown },
_( "You can't focus enough to cast spell." ) );
return false;
}

if( sp.energy_source() == magic_energy_type::hp && !you.has_quality( qual_CUT ) ) {
add_msg( game_message_params{ m_bad, gmf_bypass_cooldown },
_( "You cannot cast Blood Magic without a cutting implement." ) );
Expand Down