Skip to content

Commit

Permalink
Merge pull request #34152 from Qrox/fault-names
Browse files Browse the repository at this point in the history
Move "faulty" prefix to the correct fault names
  • Loading branch information
ZhilkinSerg authored Sep 22, 2019
2 parents bc74033 + da3d304 commit 919e957
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
3 changes: 2 additions & 1 deletion data/json/items/bionics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"color": "yellow",
"use_action": "install_bionic",
"flags": [ "CBM" ],
"is_upgrade": false
"is_upgrade": false,
"faults": [ "fault_bionic_salvaged" ]
},
{
"abstract": "bionic_general_npc_usable",
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/faults_bionic.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"id": "fault_bionic_salvaged",
"type": "fault",
"name": ": already deployed",
"name": "Already deployed",
"description": "This bionic needs to be reset to its factory state.",
"time": "45 m",
"skills": [ [ "mechanics", 3 ], [ "electronics", 2 ], [ "firstaid", 4 ] ],
Expand Down
6 changes: 3 additions & 3 deletions data/json/items/gun/faults_gun.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"id": "fault_gun_blackpowder",
"type": "fault",
"name": "blackpowder fouling",
"name": "Blackpowder fouling",
"description": "Firing blackpowder loads from a gun fouls it, which reduces reliability and, if left uncleaned, leads to rust.",
"time": "50 s",
"skills": [ [ "mechanics", 1 ] ],
Expand All @@ -14,7 +14,7 @@
{
"id": "fault_gun_chamber_spent",
"type": "fault",
"name": "spent casing in chamber",
"name": "Spent casing in chamber",
"description": "This gun currently has an empty casing chambered. It will have to be removed before firing.",
"time": 50,
"skills": [ ],
Expand All @@ -23,7 +23,7 @@
{
"id": "fault_gun_clogged",
"type": "fault",
"name": "clogging",
"name": "Clogging",
"description": "Clogging is usually caused by firing many blackpowder loads without cleaning; it prevents firing the gun until cleaned. Some guns are more resistant to this than others.",
"time": "5 m",
"skills": [ [ "mechanics", 1 ] ],
Expand Down
18 changes: 9 additions & 9 deletions data/json/vehicleparts/faults.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"id": "fault_engine_belt_drive",
"type": "fault",
"name": "drive belt",
"name": "Worn drive belt",
"description": "Required for operation of an attached alternator.",
"time": "5 m",
"skills": [ [ "mechanics", 2 ] ],
Expand All @@ -14,7 +14,7 @@
{
"id": "fault_engine_glow_plug",
"type": "fault",
"name": "glow plugs",
"name": "Faulty glow plugs",
"description": "Help when starting an engine in low ambient temperatures.",
"time": "40 m",
"skills": [ [ "mechanics", 4 ] ],
Expand All @@ -23,7 +23,7 @@
{
"id": "fault_engine_immobiliser",
"type": "fault",
"name": "immobiliser",
"name": "Active immobiliser",
"description": "Prevents starting of the vehicle without the appropriate key.",
"time": "5 m",
"skills": [ [ "mechanics", 2 ], [ "electronics", 5 ] ],
Expand All @@ -32,7 +32,7 @@
{
"id": "fault_engine_pump_diesel",
"type": "fault",
"name": "diesel pump",
"name": "Faulty diesel pump",
"description": "Required to pump and pressurize diesel from a vehicles tank.",
"time": "40 m",
"skills": [ [ "mechanics", 4 ] ],
Expand All @@ -41,7 +41,7 @@
{
"id": "fault_engine_filter_air",
"type": "fault",
"name": "air filter",
"name": "Expired air filter",
"description": "An expired filter reduces fuel efficiency and increases smoke production.",
"time": "5 m",
"skills": [ [ "mechanics", 1 ] ],
Expand All @@ -53,7 +53,7 @@
{
"id": "fault_engine_filter_fuel",
"type": "fault",
"name": "fuel filter",
"name": "Expired fuel filter",
"description": "An expired filter reduces performance and increases the chance of backfires.",
"time": "5 m",
"skills": [ [ "mechanics", 1 ] ],
Expand All @@ -65,7 +65,7 @@
{
"id": "fault_engine_pump_fuel",
"type": "fault",
"name": "fuel pump",
"name": "Faulty fuel pump",
"description": "Required to pump gasoline from a vehicles tank.",
"time": "40 m",
"skills": [ [ "mechanics", 4 ] ],
Expand All @@ -74,7 +74,7 @@
{
"id": "fault_engine_pump_water",
"type": "fault",
"name": "water pump",
"name": "Faulty water pump",
"description": "Required to pump water to an external radiator or heatsink.",
"time": "20 m",
"skills": [ [ "mechanics", 4 ] ],
Expand All @@ -83,7 +83,7 @@
{
"id": "fault_engine_starter",
"type": "fault",
"name": "starter motor",
"name": "Faulty starter motor",
"description": "Required to initially start the engine.",
"time": "10 m",
"skills": [ [ "mechanics", 3 ] ],
Expand Down
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2818,7 +2818,7 @@ std::string item::info( std::vector<iteminfo> &info, const iteminfo_query *parts
if( parts->test( iteminfo_parts::DESCRIPTION_FAULTS ) ) {
for( const fault_id &e : faults ) {
//~ %1$s is the name of a fault and %2$s is the description of the fault
info.emplace_back( "DESCRIPTION", string_format( _( "* <bad>Faulty %1$s</bad>. %2$s" ),
info.emplace_back( "DESCRIPTION", string_format( _( "* <bad>%1$s</bad>. %2$s" ),
e.obj().name(), e.obj().description() ) );
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8003,9 +8003,9 @@ void player::mend_item( item_location &&obj, bool interactive )
std::vector<std::pair<fault_id, bool>> opts;
for( const auto &f : obj->faults_potential() ) {
opts.emplace_back( f, !!obj->faults.count( f ) );
menu.addentry( -1, true, -1, string_format( "%s %s",
opts.back().second ? _( "Mend" ) : _( "Break" ),
f.obj().name() ) );
menu.addentry( -1, true, -1, string_format(
opts.back().second ? pgettext( "fault", "Mend: %s" ) : pgettext( "fault", "Set: %s" ),
f.obj().name() ) );
}
if( opts.empty() ) {
add_msg( m_info, _( "The %s doesn't have any faults to toggle." ), obj->tname() );
Expand Down
4 changes: 2 additions & 2 deletions src/veh_interact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1343,9 +1343,9 @@ bool veh_interact::overview( std::function<bool( const vehicle_part &pt )> enabl
int y = 0;
for( const auto &e : pt.faults() ) {
y += fold_and_print( w_msg, point( 1, y ), getmaxx( w_msg ) - 2, c_red,
_( "Faulty %1$s" ), e.obj().name() );
"%s", e.obj().name() );
y += fold_and_print( w_msg, point( 3, y ), getmaxx( w_msg ) - 4, c_light_gray,
e.obj().description() );
"%s", e.obj().description() );
y++;
}
wrefresh( w_msg );
Expand Down

0 comments on commit 919e957

Please sign in to comment.