diff --git a/data/json/mutations/mutations.json b/data/json/mutations/mutations.json index ddc4d693e5596..62a2bb88fc647 100644 --- a/data/json/mutations/mutations.json +++ b/data/json/mutations/mutations.json @@ -7806,6 +7806,15 @@ "starting_trait": true, "valid": false }, + { + "type": "mutation", + "id": "BRAWLER", + "name": { "str": "Brawler" }, + "points": -4, + "description": "Whether from personal choice or childhood trauma, using ranged weapons is off-limits to you, even if your life depended on it.", + "starting_trait": true, + "valid": false + }, { "type": "mutation", "id": "FAST_REFLEXES", diff --git a/src/avatar_action.cpp b/src/avatar_action.cpp index e0c32d56a2f60..9e33c9e198286 100644 --- a/src/avatar_action.cpp +++ b/src/avatar_action.cpp @@ -77,6 +77,7 @@ static const move_mode_id move_mode_prone( "prone" ); static const skill_id skill_swimming( "swimming" ); +static const trait_id trait_BRAWLER( "BRAWLER" ); static const trait_id trait_GRAZER( "GRAZER" ); static const trait_id trait_RUMINANT( "RUMINANT" ); static const trait_id trait_SHELL2( "SHELL2" ); @@ -756,6 +757,11 @@ static bool can_fire_turret( avatar &you, const map &m, const turret_data &turre return false; } + if( you.has_trait( trait_BRAWLER ) ) { + add_msg( m_bad, _( "You refuse to use the %s." ), turret.name() ); + return false; + } + switch( turret.query() ) { case turret_data::status::no_ammo: add_msg( m_bad, _( "The %s is out of ammo." ), turret.name() ); diff --git a/src/handle_action.cpp b/src/handle_action.cpp index 63ef0f5eb30d0..620247cbe4d02 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -133,6 +133,7 @@ static const quality_id qual_CUT( "CUT" ); static const skill_id skill_melee( "melee" ); +static const trait_id trait_BRAWLER( "BRAWLER" ); static const trait_id trait_HIBERNATE( "HIBERNATE" ); static const trait_id trait_PROF_CHURL( "PROF_CHURL" ); static const trait_id trait_SHELL2( "SHELL2" ); @@ -1456,11 +1457,19 @@ static void fire() turret_data turret; if( vp && ( turret = vp->vehicle().turret_query( player_character.pos() ) ) ) { + if( player_character.has_trait( trait_BRAWLER ) ) { + add_msg( m_bad, _( "You refuse to use the turret." ) ); + return; + } avatar_action::fire_turret_manual( player_character, here, turret ); return; } if( vp.part_with_feature( "CONTROLS", true ) ) { + if( player_character.has_trait( trait_BRAWLER ) ) { + add_msg( m_bad, _( "You refuse to use the turret." ) ); + return; + } if( vp->vehicle().turrets_aim_and_fire_all_manual() ) { return; } diff --git a/src/ranged.cpp b/src/ranged.cpp index 44d7af52dd2f7..51fe799d9d384 100644 --- a/src/ranged.cpp +++ b/src/ranged.cpp @@ -131,6 +131,7 @@ static const skill_id skill_gun( "gun" ); static const skill_id skill_launcher( "launcher" ); static const skill_id skill_throw( "throw" ); +static const trait_id trait_BRAWLER( "BRAWLER" ); static const trait_id trait_PYROMANIA( "PYROMANIA" ); static const trap_str_id tr_practice_target( "tr_practice_target" ); @@ -3704,6 +3705,11 @@ bool gunmode_checks_common( avatar &you, const map &m, std::vector const gun_mode &gmode ) { bool result = true; + if( you.has_trait( trait_BRAWLER ) ) { + messages.push_back( string_format( _( "Pfft. You are a brawler; using %s is beneath you." ), + gmode->tname() ) ); + result = false; + } // Check that passed gun mode is valid and we are able to use it if( !( gmode && you.can_use( *gmode ) ) ) { diff --git a/src/vehicle_use.cpp b/src/vehicle_use.cpp index 7aeb98b1c0f8b..9b5eeb41b6672 100644 --- a/src/vehicle_use.cpp +++ b/src/vehicle_use.cpp @@ -91,6 +91,8 @@ static const quality_id qual_SCREW( "SCREW" ); static const skill_id skill_mechanics( "mechanics" ); +static const trait_id trait_BRAWLER( "BRAWLER" ); + static const vpart_id vpart_horn_bicycle( "horn_bicycle" ); static const zone_type_id zone_type_VEHICLE_PATROL( "VEHICLE_PATROL" ); @@ -811,23 +813,29 @@ void vehicle::use_controls( const tripoint &pos ) } } - if( has_part( "TURRET" ) ) { - options.emplace_back( _( "Set turret targeting modes" ), keybind( "TURRET_TARGET_MODE" ) ); + // TODO: Decide - Do I disable options or remove them entirely? + if( has_part( "TURRET" ) /*&& !player_character.has_trait(trait_BRAWLER) */ ) { + bool enabled = !player_character.has_trait( trait_BRAWLER ); + + options.emplace_back( 0, enabled, keybind( "TURRET_TARGET_MODE" ), + _( "Set turret targeting modes" ) ); actions.emplace_back( [&] { turrets_set_targeting(); refresh(); } ); - options.emplace_back( _( "Set turret firing modes" ), keybind( "TURRET_FIRE_MODE" ) ); + options.emplace_back( 0, enabled, keybind( "TURRET_FIRE_MODE" ), _( "Set turret firing modes" ) ); actions.emplace_back( [&] { turrets_set_mode(); refresh(); } ); // We can also fire manual turrets with ACTION_FIRE while standing at the controls. - options.emplace_back( _( "Aim turrets manually" ), keybind( "TURRET_MANUAL_AIM" ) ); + options.emplace_back( 0, enabled, keybind( "TURRET_MANUAL_AIM" ), _( "Aim turrets manually" ) ); actions.emplace_back( [&] { turrets_aim_and_fire_all_manual( true ); refresh(); } ); // This lets us manually override and set the target for the automatic turrets instead. - options.emplace_back( _( "Aim automatic turrets" ), keybind( "TURRET_MANUAL_OVERRIDE" ) ); + options.emplace_back( 0, enabled, keybind( "TURRET_MANUAL_OVERRIDE" ), + _( "Aim automatic turrets" ) ); actions.emplace_back( [&] { turrets_override_automatic_aim(); refresh(); } ); - options.emplace_back( _( "Aim individual turret" ), keybind( "TURRET_SINGLE_FIRE" ) ); + options.emplace_back( 0, enabled, keybind( "TURRET_SINGLE_FIRE" ), _( "Aim individual turret" ) ); actions.emplace_back( [&] { turrets_aim_and_fire_single(); refresh(); } ); + // } } uilist menu;