Skip to content

Commit

Permalink
More centralized string reverts (#38421)
Browse files Browse the repository at this point in the history
* Revert "Move string consts from iuse"

This reverts commit d692f0a.

* Complete revert

* Revert "Move string consts to file"

This reverts commit 7b89cc2.

* Complete revert
  • Loading branch information
kevingranade authored Feb 28, 2020
1 parent b0abf52 commit d9dbfbe
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 159 deletions.
35 changes: 1 addition & 34 deletions src/cata_string_consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ static const efftype_id effect_lack_sleep( "lack_sleep" );
static const efftype_id effect_laserlocked( "laserlocked" );
static const efftype_id effect_lightsnare( "lightsnare" );
static const efftype_id effect_lying_down( "lying_down" );
static const efftype_id effect_masked_scent( "masked_scent" );
static const efftype_id effect_melatonin_supplements( "melatonin" );
static const efftype_id effect_masked_scent( "masked_scent" );
static const efftype_id effect_mending( "mending" );
static const efftype_id effect_meth( "meth" );
static const efftype_id effect_milked( "milked" );
Expand Down Expand Up @@ -945,7 +945,6 @@ static const std::string flag_AUT_START( "AUT_START" );
static const std::string flag_AUTODOC( "AUTODOC" );
static const std::string flag_AUTODOC_COUCH( "AUTODOC_COUCH" );
static const std::string flag_BAD_DAY( "BAD_DAY" );
static const std::string flag_BAROMETER( "BAROMETER" );
static const std::string flag_BARRICADABLE_DOOR( "BARRICADABLE_DOOR" );
static const std::string flag_BARRICADABLE_DOOR_DAMAGED( "BARRICADABLE_DOOR_DAMAGED" );
static const std::string flag_BARRICADABLE_DOOR_REINFORCED( "BARRICADABLE_DOOR_REINFORCED" );
Expand All @@ -962,7 +961,6 @@ static const std::string flag_BOMB( "BOMB" );
static const std::string flag_BUTCHER_EQ( "BUTCHER_EQ" );
static const std::string flag_BYPRODUCT( "BYPRODUCT" );
static const std::string flag_CABLE_SPOOL( "CABLE_SPOOL" );
static const std::string flag_CAMERA_PRO( "CAMERA_PRO" );
static const std::string flag_CAN_SIT( "CAN_SIT" );
static const std::string flag_CANNIBALISM( "CANNIBALISM" );
static const std::string flag_CARNIVORE_OK( "CARNIVORE_OK" );
Expand Down Expand Up @@ -991,7 +989,6 @@ static const std::string flag_DIAMOND( "DIAMOND" );
static const std::string flag_DIFFICULT_Z( "DIFFICULT_Z" );
static const std::string flag_DIG_TOOL( "DIG_TOOL" );
static const std::string flag_DIGGABLE( "DIGGABLE" );
static const std::string flag_DIGGABLE_CAN_DEEPEN( "DIGGABLE_CAN_DEEPEN" );
static const std::string flag_DIMENSIONAL_ANCHOR( "DIMENSIONAL_ANCHOR" );
static const std::string flag_DISABLE_SIGHTS( "DISABLE_SIGHTS" );
static const std::string flag_DONT_REMOVE_ROTTEN( "DONT_REMOVE_ROTTEN" );
Expand Down Expand Up @@ -1061,7 +1058,6 @@ static const std::string flag_HIDDEN_POISON( "HIDDEN_POISON" );
static const std::string flag_HOOD( "HOOD" );
static const std::string flag_HOT( "HOT" );
static const std::string flag_HURT_WHEN_WIELDED( "HURT_WHEN_WIELDED" );
static const std::string flag_HYGROMETER( "HYGROMETER" );
static const std::string flag_IN_CBM( "IN_CBM" );
static const std::string flag_INDOORS( "INDOORS" );
static const std::string flag_INEDIBLE( "INEDIBLE" );
Expand All @@ -1086,18 +1082,9 @@ static const std::string flag_MAG_BELT( "MAG_BELT" );
static const std::string flag_MAG_DESTROY( "MAG_DESTROY" );
static const std::string flag_MAG_EJECT( "MAG_EJECT" );
static const std::string flag_MAGIC_FOCUS( "MAGIC_FOCUS" );
static const std::string flag_MC_ENCRYPTED( "MC_ENCRYPTED" );
static const std::string flag_MC_HAS_DATA( "MC_HAS_DATA" );
static const std::string flag_MC_MAY_BE_ENCRYPTED( "MC_MAY_BE_ENCRYPTED" );
static const std::string flag_MC_MOBILE( "MC_MOBILE" );
static const std::string flag_MC_RANDOM_STUFF( "MC_RANDOM_STUFF" );
static const std::string flag_MC_SCIENCE_STUFF( "MC_SCIENCE_STUFF" );
static const std::string flag_MC_TURN_USED( "MC_TURN_USED" );
static const std::string flag_MC_USED( "MC_USED" );
static const std::string flag_MELTS( "MELTS" );
static const std::string flag_MESSY( "MESSY" );
static const std::string flag_MILLABLE( "MILLABLE" );
static const std::string flag_MINEABLE( "MINEABLE" );
static const std::string flag_MOUNTABLE( "MOUNTABLE" );
static const std::string flag_MOUNTED_GUN( "MOUNTED_GUN" );
static const std::string flag_MUSHY( "MUSHY" );
Expand Down Expand Up @@ -1135,7 +1122,6 @@ static const std::string flag_OVERSIZE( "OVERSIZE" );
static const std::string flag_PARTIAL_DEAF( "PARTIAL_DEAF" );
static const std::string flag_PERPETUAL( "PERPETUAL" );
static const std::string flag_PERSONAL( "PERSONAL" );
static const std::string flag_PLACE_RANDOMLY( "PLACE_RANDOMLY" );
static const std::string flag_PLANT( "PLANT" );
static const std::string flag_PLANTABLE( "PLANTABLE" );
static const std::string flag_PLOWABLE( "PLOWABLE" );
Expand All @@ -1155,7 +1141,6 @@ static const std::string flag_RADIO_CONTAINER( "RADIO_CONTAINER" );
static const std::string flag_RADIO_INVOKE_PROC( "RADIO_INVOKE_PROC" );
static const std::string flag_RADIO_MOD( "RADIO_MOD" );
static const std::string flag_RADIOACTIVE( "RADIOACTIVE" );
static const std::string flag_RADIOCARITEM( "RADIOCARITEM" );
static const std::string flag_RADIOSIGNAL_1( "RADIOSIGNAL_1" );
static const std::string flag_RADIOSIGNAL_2( "RADIOSIGNAL_2" );
static const std::string flag_RADIOSIGNAL_3( "RADIOSIGNAL_3" );
Expand All @@ -1177,7 +1162,6 @@ static const std::string flag_ROLLER_INLINE( "ROLLER_INLINE" );
static const std::string flag_ROLLER_ONE( "ROLLER_ONE" );
static const std::string flag_ROLLER_QUAD( "ROLLER_QUAD" );
static const std::string flag_ROUGH( "ROUGH" );
static const std::string flag_RUBBLE( "RUBBLE" );
static const std::string flag_SAFE_FUEL_OFF( "SAFE_FUEL_OFF" );
static const std::string flag_SAFECRACK( "SAFECRACK" );
static const std::string flag_SALT_WATER( "SALT_WATER" );
Expand All @@ -1189,9 +1173,7 @@ static const std::string flag_SHRUB( "SHRUB" );
static const std::string flag_SILENT( "SILENT" );
static const std::string flag_SKINNED( "SKINNED" );
static const std::string flag_SKINTIGHT( "SKINTIGHT" );
static const std::string flag_SLEEP_AID( "SLEEP_AID" );
static const std::string flag_SLOW_WIELD( "SLOW_WIELD" );
static const std::string flag_SLOWS_THIRST( "SLOWS_THIRST" );
static const std::string flag_SMOKABLE( "SMOKABLE" );
static const std::string flag_SMOKED( "SMOKED" );
static const std::string flag_SPEAR( "SPEAR" );
Expand Down Expand Up @@ -1243,7 +1225,6 @@ static const std::string flag_WIND_EXTINGUISH( "WIND_EXTINGUISH" );
static const std::string flag_WRITE_MESSAGE( "WRITE_MESSAGE" );
static const std::string flag_YOUNG( "YOUNG" );


static const skill_id skill_archery( "archery" );
static const skill_id skill_barter( "barter" );
static const skill_id skill_bashing( "bashing" );
Expand Down Expand Up @@ -1273,26 +1254,20 @@ static const skill_id skill_traps( "traps" );
static const skill_id skill_unarmed( "unarmed" );
static const skill_id weapon_skill( "weapon" );


static const quality_id qual_ANESTHESIA( "ANESTHESIA" );
static const quality_id qual_AXE( "AXE" );
static const quality_id qual_BUTCHER( "BUTCHER" );
static const quality_id qual_CUT( "CUT" );
static const quality_id qual_CUT_FINE( "CUT_FINE" );
static const quality_id qual_DIG( "DIG" );
static const quality_id qual_DRILL( "DRILL" );
static const quality_id qual_FISHING( "FISHING" );
static const quality_id qual_HAMMER( "HAMMER" );
static const quality_id qual_JACK( "JACK" );
static const quality_id qual_LIFT( "LIFT" );
static const quality_id qual_PRY( "PRY" );
static const quality_id qual_SAW_M( "SAW_M" );
static const quality_id qual_SAW_W( "SAW_W" );
static const quality_id qual_SCREW_FINE( "SCREW_FINE" );
static const quality_id qual_SELF_JACK( "SELF_JACK" );
static const quality_id qual_WELD( "WELD" );


static const zone_type_id zone_investigate_only( "NPC_INVESTIGATE_ONLY" );
static const zone_type_id zone_no_investigate( "NPC_NO_INVESTIGATE" );
static const zone_type_id zone_type_CHOP_TREES( "CHOP_TREES" );
Expand Down Expand Up @@ -1410,14 +1385,6 @@ static const ammotype ammo_battery( "battery" );
static const ammotype ammo_reactor_slurry( "reactor_slurry" );
static const ammotype ammo_plutonium( "plutonium" );

static const std::string title_BIONICS = translate_marker( "BIONICS" );
static const std::string title_EFFECTS = translate_marker( "EFFECTS" );
static const std::string title_ENCUMB = translate_marker( "ENCUMBRANCE AND WARMTH" );
static const std::string title_SKILLS = translate_marker( "SKILLS" );
static const std::string title_SPEED = translate_marker( "SPEED" );
static const std::string title_STATS = translate_marker( "STATS" );
static const std::string title_TRAITS = translate_marker( "TRAITS" );

const vitamin_id vitamin_iron( "iron" );

static const std::string null_item_id( "null" );
Expand Down
6 changes: 3 additions & 3 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4112,7 +4112,7 @@ needs_rates Character::calc_needs_rates() const

rates.thirst = get_option< float >( "PLAYER_THIRST_RATE" );
rates.thirst *= 1.0f + mutation_value( "thirst_modifier" );
if( worn_with_flag( flag_SLOWS_THIRST ) ) {
if( worn_with_flag( "SLOWS_THIRST" ) ) {
rates.thirst *= 0.7f;
}

Expand Down Expand Up @@ -4996,7 +4996,7 @@ Character::comfort_response_t Character::base_comfort_value( const tripoint &p )
if( carg ) {
const vehicle_stack items = vp->vehicle().get_items( carg->part_index() );
for( const item &items_it : items ) {
if( items_it.has_flag( flag_SLEEP_AID ) ) {
if( items_it.has_flag( "SLEEP_AID" ) ) {
// Note: BED + SLEEP_AID = 9 pts, or 1 pt below very_comfortable
comfort += 1 + static_cast<int>( comfort_level::slightly_comfortable );
comfort_response.aid = &items_it;
Expand Down Expand Up @@ -5033,7 +5033,7 @@ Character::comfort_response_t Character::base_comfort_value( const tripoint &p )
if( comfort_response.aid == nullptr ) {
const map_stack items = g->m.i_at( p );
for( const item &items_it : items ) {
if( items_it.has_flag( flag_SLEEP_AID ) ) {
if( items_it.has_flag( "SLEEP_AID" ) ) {
// Note: BED + SLEEP_AID = 9 pts, or 1 pt below very_comfortable
comfort += 1 + static_cast<int>( comfort_level::slightly_comfortable );
comfort_response.aid = &items_it;
Expand Down
10 changes: 5 additions & 5 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ void iexamine::locked_object( player &p, const tripoint &examp )
{
auto prying_items = p.crafting_inventory().items_with( []( const item & it ) -> bool {
item temporary_item( it.type );
return temporary_item.has_quality( qual_PRY, 1 );
return temporary_item.has_quality( quality_id( "PRY" ), 1 );
} );

if( prying_items.empty() ) {
Expand All @@ -1273,7 +1273,7 @@ void iexamine::locked_object( player &p, const tripoint &examp )

// Sort by their quality level.
std::sort( prying_items.begin(), prying_items.end(), []( const item * a, const item * b ) -> bool {
return a->get_quality( qual_PRY ) > b->get_quality( qual_PRY );
return a->get_quality( quality_id( "PRY" ) ) > b->get_quality( quality_id( "PRY" ) );
} );

//~ %1$s: terrain/furniture name, %2$s: prying tool name
Expand Down Expand Up @@ -3224,12 +3224,12 @@ static item_location maple_tree_sap_container()

void iexamine::tree_maple( player &p, const tripoint &examp )
{
if( !p.has_quality( qual_DRILL ) ) {
if( !p.has_quality( quality_id( "DRILL" ) ) ) {
add_msg( m_info, _( "You need a tool to drill the crust to tap this maple tree." ) );
return;
}

if( !p.has_quality( qual_HAMMER ) ) {
if( !p.has_quality( quality_id( "HAMMER" ) ) ) {
add_msg( m_info,
_( "You need a tool to hammer the spile into the crust to tap this maple tree." ) );
return;
Expand Down Expand Up @@ -3302,7 +3302,7 @@ void iexamine::tree_maple_tapped( player &p, const tripoint &examp )

switch( selectmenu.ret ) {
case REMOVE_TAP: {
if( !p.has_quality( qual_HAMMER ) ) {
if( !p.has_quality( quality_id( "HAMMER" ) ) ) {
add_msg( m_info, _( "You need a hammering tool to remove the spile from the crust." ) );
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/item_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ item_action_map item_action_generator::map_actions_to_items( player &p,

// Don't try to remove 'irremovable' toolmods
if( actual_item->is_toolmod() && use == item_action_id( "TOOLMOD_ATTACH" ) &&
actual_item->has_flag( flag_IRREMOVABLE ) ) {
actual_item->has_flag( "IRREMOVABLE" ) ) {
continue;
}

Expand Down
Loading

0 comments on commit d9dbfbe

Please sign in to comment.