Skip to content

Commit

Permalink
Backporting #48651 [Magiclysm] Can't cast if Stunned
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Aug 14, 2021
1 parent d55e25c commit 9f0d802
Showing 1 changed file with 7 additions and 0 deletions.
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 @@ -1487,6 +1488,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

0 comments on commit 9f0d802

Please sign in to comment.