From 05940bfe3aa1c95c10dc2df49bb2b7a88f23b039 Mon Sep 17 00:00:00 2001 From: Eric <52087122+Ramza13@users.noreply.github.com> Date: Thu, 20 Feb 2020 17:45:51 -0500 Subject: [PATCH] More string consts into single file (#38183) --- src/activity_handlers.cpp | 2 +- src/cata_string_consts.h | 31 ++++++++++++++++ src/character.cpp | 62 ++++++++++++++++---------------- src/consumption.cpp | 2 +- src/faction.cpp | 4 +-- src/game.cpp | 10 +++--- src/handle_action.cpp | 2 +- src/iexamine.cpp | 2 +- src/item.cpp | 2 +- src/iuse.cpp | 4 +-- src/iuse_actor.cpp | 8 ++--- src/magic_spell_effect.cpp | 5 +-- src/magic_teleporter_list.cpp | 3 +- src/map.cpp | 20 +++++------ src/mapgen.cpp | 48 ++++++++++++------------- src/melee.cpp | 4 +-- src/mission_start.cpp | 2 +- src/monattack.cpp | 12 +++---- src/monexamine.cpp | 4 +-- src/monmove.cpp | 4 +-- src/npc.cpp | 2 +- src/npcmove.cpp | 6 ++-- src/panels.cpp | 2 +- src/player.cpp | 54 ++++++++++++++-------------- src/player_hardcoded_effects.cpp | 2 +- src/ranged.cpp | 6 ++-- src/start_location.cpp | 4 +-- src/suffer.cpp | 8 ++--- src/teleport.cpp | 8 ++--- src/veh_type.cpp | 2 +- src/vehicle_move.cpp | 6 ++-- tests/encumbrance_test.cpp | 5 +-- 32 files changed, 185 insertions(+), 151 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 6835e56dbca58..fd444cd3ef738 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -1166,7 +1166,7 @@ void activity_handlers::butcher_finish( player_activity *act, player *p ) _( "You did something wrong and hacked the corpse badly. Maybe it's still recoverable." ) ); break; } - corpse_item.set_flag( "FIELD_DRESS_FAILED" ); + corpse_item.set_flag( flag_FIELD_DRESS_FAILED ); g->m.add_splatter( type_gib, p->pos(), rng( corpse->size + 2, ( corpse->size + 1 ) * 2 ) ); g->m.add_splatter( type_blood, p->pos(), rng( corpse->size + 2, ( corpse->size + 1 ) * 2 ) ); diff --git a/src/cata_string_consts.h b/src/cata_string_consts.h index b770d2ce27d81..3ac4865c64d56 100644 --- a/src/cata_string_consts.h +++ b/src/cata_string_consts.h @@ -922,6 +922,7 @@ static const mtype_id mon_zombie_tough( "mon_zombie_tough" ); static const mtype_id mon_zombie_waif( "mon_zombie_waif" ); static const std::string flag_ACID( "ACID" ); +static const std::string flag_ACID_IMMUNE( "ACID_IMMUNE" ); static const std::string flag_ACT_IN_FIRE( "ACT_IN_FIRE" ); static const std::string flag_ACT_ON_RANGED_HIT( "ACT_ON_RANGED_HIT" ); static const std::string flag_ACTIVE_CLOAKING( "ACTIVE_CLOAKING" ); @@ -954,11 +955,13 @@ 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" ); static const std::string flag_BARRICADABLE_WINDOW_CURTAINS( "BARRICADABLE_WINDOW_CURTAINS" ); +static const std::string flag_BASH_IMMUNE( "BASH_IMMUNE" ); static const std::string flag_BATTERY_MOUNT( "BATTERY_MOUNT" ); static const std::string flag_BED( "BED" ); static const std::string flag_BEEPER( "BEEPER" ); static const std::string flag_BELTABLE( "BELTABLE" ); static const std::string flag_BELTED( "BELTED" ); +static const std::string flag_BIO_IMMUNE( "BIO_IMMUNE" ); static const std::string flag_BIPOD( "BIPOD" ); static const std::string flag_BIRD( "BIRD" ); static const std::string flag_BLIND( "BLIND" ); @@ -991,9 +994,11 @@ static const std::string flag_CHARGEDIM( "CHARGEDIM" ); static const std::string flag_CHEMLAB( "CHEMLAB" ); static const std::string flag_CHIMES( "CHIMES" ); static const std::string flag_CITY_START( "CITY_START" ); +static const std::string flag_CLIMATE_CONTROL( "CLIMATE_CONTROL" ); static const std::string flag_CLIMB_SIMPLE( "CLIMB_SIMPLE" ); static const std::string flag_CLIMBABLE( "CLIMBABLE" ); static const std::string flag_COLD( "COLD" ); +static const std::string flag_COLD_IMMUNE( "COLD_IMMUNE" ); static const std::string flag_COLLAPSES( "COLLAPSES" ); static const std::string flag_COLLAPSIBLE_STOCK( "COLLAPSIBLE_STOCK" ); static const std::string flag_CONDUCTIVE( "CONDUCTIVE" ); @@ -1007,6 +1012,7 @@ static const std::string flag_CORPSE( "CORPSE" ); static const std::string flag_CRAFTRIG( "CRAFTRIG" ); static const std::string flag_CURRENT( "CURRENT" ); static const std::string flag_CURTAIN( "CURTAIN" ); +static const std::string flag_CUT_IMMUNE( "CUT_IMMUNE" ); static const std::string flag_DANGEROUS( "DANGEROUS" ); static const std::string flag_DEAF( "DEAF" ); static const std::string flag_DEEP_WATER( "DEEP_WATER" ); @@ -1033,8 +1039,18 @@ static const std::string flag_EASY_DECONSTRUCT( "EASY_DECONSTRUCT" ); static const std::string flag_EATEN_COLD( "EATEN_COLD" ); static const std::string flag_EATEN_HOT( "EATEN_HOT" ); static const std::string flag_EDIBLE_FROZEN( "EDIBLE_FROZEN" ); +static const std::string flag_EFFECT_ACID_IMMUNE( "EFFECT_ACID_IMMUNE" ); +static const std::string flag_EFFECT_BASH_IMMUNE( "EFFECT_BASH_IMMUNE" ); +static const std::string flag_EFFECT_BIO_IMMUNE( "EFFECT_BIO_IMMUNE" ); +static const std::string flag_EFFECT_COLD_IMMUNE( "EFFECT_COLD_IMMUNE" ); +static const std::string flag_EFFECT_CUT_IMMUNE( "EFFECT_CUT_IMMUNE" ); +static const std::string flag_EFFECT_ELECTRIC_IMMUNE( "EFFECT_ELECTRIC_IMMUNE" ); +static const std::string flag_EFFECT_FEATHER_FALL( "EFFECT_FEATHER_FALL" ); +static const std::string flag_EFFECT_HEAT_IMMUNE( "EFFECT_HEAT_IMMUNE" ); static const std::string flag_EFFECT_INVISIBLE( "EFFECT_INVISIBLE" ); static const std::string flag_EFFECT_NIGHT_VISION( "EFFECT_NIGHT_VISION" ); +static const std::string flag_EFFECT_STAB_IMMUNE( "EFFECT_STAB_IMMUNE" ); +static const std::string flag_ELECTRIC_IMMUNE( "ELECTRIC_IMMUNE" ); static const std::string flag_EMITTER( "EMITTER" ); static const std::string flag_ENGINE( "ENGINE" ); static const std::string flag_ETHEREAL_ITEM( "ETHEREAL_ITEM" ); @@ -1048,6 +1064,7 @@ static const std::string flag_FERTILIZER( "FERTILIZER" ); static const std::string flag_FIELD_DRESS( "FIELD_DRESS" ); static const std::string flag_FIELD_DRESS_FAILED( "FIELD_DRESS_FAILED" ); static const std::string flag_FILTHY( "FILTHY" ); +static const std::string flag_FIN( "FIN" ); static const std::string flag_FIRE( "FIRE" ); static const std::string flag_FIRE_100( "FIRE_100" ); static const std::string flag_FIRE_20( "FIRE_20" ); @@ -1095,6 +1112,7 @@ static const std::string flag_GROWTH_HARVEST( "GROWTH_HARVEST" ); static const std::string flag_GROWTH_MATURE( "GROWTH_MATURE" ); static const std::string flag_GROWTH_SEEDLING( "GROWTH_SEEDLING" ); static const std::string flag_HALF_BOARD( "HALF_BOARD" ); +static const std::string flag_HEAT_IMMUNE( "HEAT_IMMUNE" ); static const std::string flag_HELI_CRASH( "HELI_CRASH" ); static const std::string flag_HELMET_COMPAT( "HELMET_COMPAT" ); static const std::string flag_HIDDEN_HALLU( "HIDDEN_HALLU" ); @@ -1169,12 +1187,14 @@ static const std::string flag_NEGATIVE_MONOTONY_OK( "NEGATIVE_MONOTONY_OK" ); static const std::string flag_NEVER_JAMS( "NEVER_JAMS" ); static const std::string flag_no_auto_equip( "no_auto_equip" ); static const std::string flag_NO_CVD( "NO_CVD" ); +static const std::string flag_NO_DISEASE( "NO_DISEASE" ); static const std::string flag_NO_DISPLAY( "NO_DISPLAY" ); static const std::string flag_NO_DROP( "NO_DROP" ); static const std::string flag_NO_INGEST( "NO_INGEST" ); static const std::string flag_NO_PACKED( "NO_PACKED" ); static const std::string flag_NO_PARASITES( "NO_PARASITES" ); static const std::string flag_NO_QUICKDRAW( "NO_QUICKDRAW" ); +static const std::string flag_NO_RADIATION( "NO_RADIATION" ); static const std::string flag_NO_RELOAD( "NO_RELOAD" ); static const std::string flag_NO_REPAIR( "NO_REPAIR" ); static const std::string flag_NO_RESIZE( "NO_RESIZE" ); @@ -1182,6 +1202,7 @@ static const std::string flag_NO_ROOF_NEEDED( "NO_ROOF_NEEDED" ); static const std::string flag_NO_SALVAGE( "NO_SALVAGE" ); static const std::string flag_NO_STERILE( "NO_STERILE" ); static const std::string flag_NO_TAKEOFF( "NO_TAKEOFF" ); +static const std::string flag_NO_THIRST( "NO_THIRST" ); static const std::string flag_NO_UNLOAD( "NO_UNLOAD" ); static const std::string flag_NO_UNWIELD( "NO_UNWIELD" ); static const std::string flag_NOCOLLIDE( "NOCOLLIDE" ); @@ -1226,10 +1247,12 @@ static const std::string flag_PROCESSING_RESULT( "PROCESSING_RESULT" ); static const std::string flag_PROTRUSION( "PROTRUSION" ); static const std::string flag_PSEUDO( "PSEUDO" ); static const std::string flag_PSYCHOPATH( "PSYCHOPATH" ); +static const std::string flag_PSYSHIELD_PARTIAL( "PSYSHIELD_PARTIAL" ); static const std::string flag_PULPED( "PULPED" ); static const std::string flag_PUMP_ACTION( "PUMP_ACTION" ); static const std::string flag_PUMP_RAIL_COMPATIBLE( "PUMP_RAIL_COMPATIBLE" ); static const std::string flag_QUARTERED( "QUARTERED" ); +static const std::string flag_RAD_PROOF( "RAD_PROOF" ); static const std::string flag_RAD_RESIST( "RAD_RESIST" ); static const std::string flag_RADIO_ACTIVATION( "RADIO_ACTIVATION" ); static const std::string flag_RADIO_CONTAINER( "RADIO_CONTAINER" ); @@ -1248,6 +1271,7 @@ static const std::string flag_RAMP_END( "RAMP_END" ); static const std::string flag_RAW( "RAW" ); static const std::string flag_REACH_ATTACK( "REACH_ATTACK" ); static const std::string flag_REACH3( "REACH3" ); +static const std::string flag_REBREATHER( "REBREATHER" ); static const std::string flag_RECHARGE( "RECHARGE" ); static const std::string flag_REDUCED_BASHING( "REDUCED_BASHING" ); static const std::string flag_REDUCED_WEIGHT( "REDUCED_WEIGHT" ); @@ -1255,6 +1279,7 @@ static const std::string flag_RELOAD_AND_SHOOT( "RELOAD_AND_SHOOT" ); static const std::string flag_RELOAD_EJECT( "RELOAD_EJECT" ); static const std::string flag_RELOAD_ONE( "RELOAD_ONE" ); static const std::string flag_REMOTE_CONTROLS( "REMOTE_CONTROLS" ); +static const std::string flag_REQUIRES_BALANCE( "REQUIRES_BALANCE" ); static const std::string flag_REQUIRES_TINDER( "REQUIRES_TINDER" ); static const std::string flag_RESTRICT_HANDS( "RESTRICT_HANDS" ); static const std::string flag_REVIVE_SPECIAL( "REVIVE_SPECIAL" ); @@ -1277,6 +1302,7 @@ static const std::string flag_SECRET( "SECRET" ); static const std::string flag_SECURITY( "SECURITY" ); static const std::string flag_SEMITANGIBLE( "SEMITANGIBLE" ); static const std::string flag_SHARP( "SHARP" ); +static const std::string flag_SHORT( "SHORT" ); static const std::string flag_SHRUB( "SHRUB" ); static const std::string flag_SIGN( "SIGN" ); static const std::string flag_SILENT( "SILENT" ); @@ -1284,6 +1310,7 @@ 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_MOVEMENT( "SLOWS_MOVEMENT" ); static const std::string flag_SLOWS_THIRST( "SLOWS_THIRST" ); static const std::string flag_SMOKABLE( "SMOKABLE" ); static const std::string flag_SMOKED( "SMOKED" ); @@ -1293,6 +1320,7 @@ static const std::string flag_SPEAR( "SPEAR" ); static const std::string flag_SPEEDLOADER( "SPEEDLOADER" ); static const std::string flag_SPLINT( "SPLINT" ); static const std::string flag_SPR_START( "SPR_START" ); +static const std::string flag_STAB_IMMUNE( "STAB_IMMUNE" ); static const std::string flag_STABLE( "STABLE" ); static const std::string flag_STEERABLE( "STEERABLE" ); static const std::string flag_STEREO( "STEREO" ); @@ -1318,11 +1346,13 @@ static const std::string flag_TOBACCO( "TOBACCO" ); static const std::string flag_TRACK( "TRACK" ); static const std::string flag_TRACKED( "TRACKED" ); static const std::string flag_TRADER_AVOID( "TRADER_AVOID" ); +static const std::string flag_TRANSLOCATOR( "TRANSLOCATOR" ); static const std::string flag_TRANSPARENT( "TRANSPARENT" ); static const std::string flag_TREE( "TREE" ); static const std::string flag_TURRET( "TURRET" ); static const std::string flag_TURRET_CONTROLS( "TURRET_CONTROLS" ); static const std::string flag_TURRET_MOUNT( "TURRET_MOUNT" ); +static const std::string flag_TWO_WAY_RADIO( "TWO_WAY_RADIO" ); static const std::string flag_UNARMED_BONUS( "UNARMED_BONUS" ); static const std::string flag_UNARMED_WEAPON( "UNARMED_WEAPON" ); static const std::string flag_UNBREAKABLE_MELEE( "UNBREAKABLE_MELEE" ); @@ -1369,6 +1399,7 @@ static const std::string flag_WINDSHIELD( "WINDSHIELD" ); static const std::string flag_WORKBENCH( "WORKBENCH" ); static const std::string flag_WRITE_MESSAGE( "WRITE_MESSAGE" ); static const std::string flag_YOUNG( "YOUNG" ); +static const std::string flag_ZOOM( "ZOOM" ); static const skill_id skill_archery( "archery" ); static const skill_id skill_barter( "barter" ); diff --git a/src/character.cpp b/src/character.cpp index 5a2b602d72ef4..07024893728db 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -2619,9 +2619,9 @@ void Character::do_skill_rust() SkillLevel &skill_level_obj = pair.second; if( aSkill.is_combat_skill() && - ( ( has_trait_flag( "PRED2" ) && calendar::once_every( 8_hours ) ) || - ( has_trait_flag( "PRED3" ) && calendar::once_every( 4_hours ) ) || - ( has_trait_flag( "PRED4" ) && calendar::once_every( 3_hours ) ) ) ) { + ( ( has_trait_flag( flag_PRED2 ) && calendar::once_every( 8_hours ) ) || + ( has_trait_flag( flag_PRED3 ) && calendar::once_every( 4_hours ) ) || + ( has_trait_flag( flag_PRED4 ) && calendar::once_every( 3_hours ) ) ) ) { // Their brain is optimized to remember this if( one_in( 13 ) ) { // They've already passed the roll to avoid rust at @@ -2928,7 +2928,7 @@ bool Character::in_climate_control() if( w.active && w.is_power_armor() ) { return true; } - if( worn_with_flag( "CLIMATE_CONTROL" ) ) { + if( worn_with_flag( flag_CLIMATE_CONTROL ) ) { return true; } } @@ -3553,7 +3553,7 @@ std::pair Character::get_fatigue_description() const void Character::mod_thirst( int nthirst ) { - if( has_trait_flag( "NO_THIRST" ) ) { + if( has_trait_flag( flag_NO_THIRST ) ) { return; } set_thirst( std::max( -100, thirst + nthirst ) ); @@ -4315,7 +4315,7 @@ void Character::check_needs_extremes() void Character::get_sick() { // NPCs are too dumb to handle infections now - if( is_npc() || has_trait_flag( "NO_DISEASE" ) ) { + if( is_npc() || has_trait_flag( flag_NO_DISEASE ) ) { // In a shocking twist, disease immunity prevents diseases. return; } @@ -5443,34 +5443,34 @@ bool Character::is_immune_damage( const damage_type dt ) const case DT_TRUE: return false; case DT_BIOLOGICAL: - return has_effect_with_flag( "EFFECT_BIO_IMMUNE" ) || - worn_with_flag( "BIO_IMMUNE" ); + return has_effect_with_flag( flag_EFFECT_BIO_IMMUNE ) || + worn_with_flag( flag_BIO_IMMUNE ); case DT_BASH: - return has_effect_with_flag( "EFFECT_BASH_IMMUNE" ) || - worn_with_flag( "BASH_IMMUNE" ); + return has_effect_with_flag( flag_EFFECT_BASH_IMMUNE ) || + worn_with_flag( flag_BASH_IMMUNE ); case DT_CUT: - return has_effect_with_flag( "EFFECT_CUT_IMMUNE" ) || - worn_with_flag( "CUT_IMMUNE" ); + return has_effect_with_flag( flag_EFFECT_CUT_IMMUNE ) || + worn_with_flag( flag_CUT_IMMUNE ); case DT_ACID: return has_trait( trait_ACIDPROOF ) || - has_effect_with_flag( "EFFECT_ACID_IMMUNE" ) || - worn_with_flag( "ACID_IMMUNE" ); + has_effect_with_flag( flag_EFFECT_ACID_IMMUNE ) || + worn_with_flag( flag_ACID_IMMUNE ); case DT_STAB: - return has_effect_with_flag( "EFFECT_STAB_IMMUNE" ) || - worn_with_flag( "STAB_IMMUNE" ); + return has_effect_with_flag( flag_EFFECT_STAB_IMMUNE ) || + worn_with_flag( flag_STAB_IMMUNE ); case DT_HEAT: return has_trait( trait_M_SKIN2 ) || has_trait( trait_M_SKIN3 ) || - has_effect_with_flag( "EFFECT_HEAT_IMMUNE" ) || - worn_with_flag( "HEAT_IMMUNE" ); + has_effect_with_flag( flag_EFFECT_HEAT_IMMUNE ) || + worn_with_flag( flag_HEAT_IMMUNE ); case DT_COLD: - return has_effect_with_flag( "EFFECT_COLD_IMMUNE" ) || - worn_with_flag( "COLD_IMMUNE" ); + return has_effect_with_flag( flag_EFFECT_COLD_IMMUNE ) || + worn_with_flag( flag_COLD_IMMUNE ); case DT_ELECTRIC: return has_active_bionic( bio_faraday ) || - worn_with_flag( "ELECTRIC_IMMUNE" ) || + worn_with_flag( flag_ELECTRIC_IMMUNE ) || has_artifact_with( AEP_RESIST_ELECTRICITY ) || - has_effect_with_flag( "EFFECT_ELECTRIC_IMMUNE" ); + has_effect_with_flag( flag_EFFECT_ELECTRIC_IMMUNE ); default: return true; } @@ -5479,7 +5479,7 @@ bool Character::is_immune_damage( const damage_type dt ) const bool Character::is_rad_immune() const { bool has_helmet = false; - return ( is_wearing_power_armor( &has_helmet ) && has_helmet ) || worn_with_flag( "RAD_PROOF" ); + return ( is_wearing_power_armor( &has_helmet ) && has_helmet ) || worn_with_flag( flag_RAD_PROOF ); } int Character::throw_range( const item &it ) const @@ -6408,7 +6408,7 @@ void Character::set_rad( int new_rad ) void Character::mod_rad( int mod ) { - if( has_trait_flag( "NO_RADIATION" ) ) { + if( has_trait_flag( flag_NO_RADIATION ) ) { return; } set_rad( std::max( 0, get_rad() + mod ) ); @@ -7899,7 +7899,7 @@ bool Character::covered_with_flag( const std::string &flag, const body_part_set bool Character::is_waterproof( const body_part_set &parts ) const { - return covered_with_flag( "WATERPROOF", parts ); + return covered_with_flag( flag_WATERPROOF, parts ); } void Character::update_morale() @@ -8573,10 +8573,10 @@ bool Character::has_fire( const int quantity ) const if( g->m.has_nearby_fire( pos() ) ) { return true; - } else if( has_item_with_flag( "FIRE" ) ) { + } else if( has_item_with_flag( flag_FIRE ) ) { return true; - } else if( has_item_with_flag( "FIRESTARTER" ) ) { - auto firestarters = all_items_with_flag( "FIRESTARTER" ); + } else if( has_item_with_flag( flag_FIRESTARTER ) ) { + auto firestarters = all_items_with_flag( flag_FIRESTARTER ); for( auto &i : firestarters ) { if( has_charges( i->typeId(), quantity ) ) { return true; @@ -8632,10 +8632,10 @@ void Character::use_fire( const int quantity ) if( g->m.has_nearby_fire( pos() ) ) { return; - } else if( has_item_with_flag( "FIRE" ) ) { + } else if( has_item_with_flag( flag_FIRE ) ) { return; - } else if( has_item_with_flag( "FIRESTARTER" ) ) { - auto firestarters = all_items_with_flag( "FIRESTARTER" ); + } else if( has_item_with_flag( flag_FIRESTARTER ) ) { + auto firestarters = all_items_with_flag( flag_FIRESTARTER ); for( auto &i : firestarters ) { if( has_charges( i->typeId(), quantity ) ) { use_charges( i->typeId(), quantity ); diff --git a/src/consumption.cpp b/src/consumption.cpp index cdae5d7c7bd03..d0ccf79ade706 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -632,7 +632,7 @@ ret_val Character::will_eat( const item &food, bool interactive ) } const bool carnivore = has_trait( trait_CARNIVORE ); - if( food.has_flag( flag_CANNIBALISM ) && !has_trait_flag( "CANNIBAL" ) ) { + if( food.has_flag( flag_CANNIBALISM ) && !has_trait_flag( flag_CANNIBAL ) ) { add_consequence( _( "The thought of eating human flesh makes you feel sick." ), CANNIBALISM ); } diff --git a/src/faction.cpp b/src/faction.cpp index d30a365f8b6a2..f0d95f947c3ca 100644 --- a/src/faction.cpp +++ b/src/faction.cpp @@ -546,8 +546,8 @@ int npc::faction_display( const catacurses::window &fac_w, const int width ) con } std::string can_see; nc_color see_color; - bool u_has_radio = g->u.has_item_with_flag( "TWO_WAY_RADIO", true ); - bool guy_has_radio = has_item_with_flag( "TWO_WAY_RADIO", true ); + bool u_has_radio = g->u.has_item_with_flag( flag_TWO_WAY_RADIO, true ); + bool guy_has_radio = has_item_with_flag( flag_TWO_WAY_RADIO, true ); // TODO: NPCS on mission contactable same as travelling if( has_companion_mission() && mission != NPC_MISSION_TRAVELLING ) { can_see = _( "Not interactable while on a mission" ); diff --git a/src/game.cpp b/src/game.cpp index 6dd356f08eb71..d22c26a1d7bb8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -8832,11 +8832,11 @@ bool game::walk_move( const tripoint &dest_loc ) if( u.is_mounted() ) { auto crit = u.mounted_creature.get(); if( !crit->has_flag( MF_RIDEABLE_MECH ) && - ( m.has_flag_ter_or_furn( "MOUNTABLE", dest_loc ) || - m.has_flag_ter_or_furn( "BARRICADABLE_DOOR", dest_loc ) || - m.has_flag_ter_or_furn( "OPENCLOSE_INSIDE", dest_loc ) || - m.has_flag_ter_or_furn( "BARRICADABLE_DOOR_DAMAGED", dest_loc ) || - m.has_flag_ter_or_furn( "BARRICADABLE_DOOR_REINFORCED", dest_loc ) ) ) { + ( m.has_flag_ter_or_furn( flag_MOUNTABLE, dest_loc ) || + m.has_flag_ter_or_furn( flag_BARRICADABLE_DOOR, dest_loc ) || + m.has_flag_ter_or_furn( flag_OPENCLOSE_INSIDE, dest_loc ) || + m.has_flag_ter_or_furn( flag_BARRICADABLE_DOOR_DAMAGED, dest_loc ) || + m.has_flag_ter_or_furn( flag_BARRICADABLE_DOOR_REINFORCED, dest_loc ) ) ) { add_msg( m_warning, _( "You cannot pass obstacles whilst mounted." ) ); return false; } diff --git a/src/handle_action.cpp b/src/handle_action.cpp index 1ea55139937c9..b653887465643 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -1033,7 +1033,7 @@ static void loot() player &u = g->u; int flags = 0; auto &mgr = zone_manager::get_manager(); - const bool has_fertilizer = u.has_item_with_flag( "FERTILIZER" ); + const bool has_fertilizer = u.has_item_with_flag( flag_FERTILIZER ); // Manually update vehicle cache. // In theory this would be handled by the related activity (activity_on_turn_move_loot()) diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 28c54448a62db..7ce469f22c725 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -2129,7 +2129,7 @@ void iexamine::harvest_plant( player &p, const tripoint &examp, bool from_activi ret_val iexamine::can_fertilize( player &p, const tripoint &tile, const itype_id &fertilizer ) { - if( !g->m.has_flag_furn( "PLANT", tile ) ) { + if( !g->m.has_flag_furn( flag_PLANT, tile ) ) { return ret_val::make_failure( _( "Tile isn't a plant" ) ); } if( g->m.i_at( tile ).size() > 1 ) { diff --git a/src/item.cpp b/src/item.cpp index 752061a6f5515..252514165c272 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -5703,7 +5703,7 @@ bool item::is_gun() const bool item::is_firearm() const { - static const std::string primitive_flag( "PRIMITIVE_RANGED_WEAPON" ); + static const std::string primitive_flag( flag_PRIMITIVE_RANGED_WEAPON ); return is_gun() && !has_flag( primitive_flag ); } diff --git a/src/iuse.cpp b/src/iuse.cpp index 207f232e2ae20..ccb0411a117ef 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -1855,7 +1855,7 @@ int iuse::pack_cbm( player *p, item *it, bool, const tripoint & ) const int success = p->get_skill_level( skill_firstaid ) - rng( 0, 6 ); if( success > 0 ) { p->add_msg_if_player( m_good, _( "You carefully prepare the CBM for sterilization." ) ); - bionic.get_item()->unset_flag( "NO_PACKED" ); + bionic.get_item()->unset_flag( flag_NO_PACKED ); } else { p->add_msg_if_player( m_bad, _( "You fail to properly prepare the CBM." ) ); } @@ -8309,7 +8309,7 @@ int iuse::autoclave( player *p, item *it, bool t, const tripoint &pos ) it->erase_var( "CYCLETIME" ); for( item &bio : it->contents ) { if( bio.is_bionic() && !bio.has_flag( flag_NO_PACKED ) ) { - bio.unset_flag( "NO_STERILE" ); + bio.unset_flag( flag_NO_STERILE ); } } } else { diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index cac466d0b8552..a8c316758a884 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -1878,9 +1878,9 @@ int enzlave_actor::use( player &p, item &it, bool t, const tripoint & ) const int tolerance_level = 9; if( p.has_trait( trait_PSYCHOPATH ) || p.has_trait( trait_SAPIOVORE ) ) { tolerance_level = 0; - } else if( p.has_trait_flag( "PRED4" ) ) { + } else if( p.has_trait_flag( flag_PRED4 ) ) { tolerance_level = 5; - } else if( p.has_trait_flag( "PRED3" ) ) { + } else if( p.has_trait_flag( flag_PRED3 ) ) { tolerance_level = 7; } @@ -1924,9 +1924,9 @@ int enzlave_actor::use( player &p, item &it, bool t, const tripoint & ) const if( p.has_trait( trait_PACIFIST ) ) { moraleMalus *= 5; maxMalus *= 3; - } else if( p.has_trait_flag( "PRED1" ) ) { + } else if( p.has_trait_flag( flag_PRED1 ) ) { moraleMalus /= 4; - } else if( p.has_trait_flag( "PRED2" ) ) { + } else if( p.has_trait_flag( flag_PRED2 ) ) { moraleMalus /= 5; } diff --git a/src/magic_spell_effect.cpp b/src/magic_spell_effect.cpp index f31dd3a640b85..2f4de55b4efe7 100644 --- a/src/magic_spell_effect.cpp +++ b/src/magic_spell_effect.cpp @@ -44,6 +44,7 @@ #include "translations.h" #include "timed_event.h" #include "teleport.h" +#include "cata_string_consts.h" namespace spell_detail { @@ -662,13 +663,13 @@ void spell_effect::spawn_ethereal_item( const spell &sp, Creature &caster, const item granted( sp.effect_data(), calendar::turn ); if( !granted.is_comestible() && !( sp.has_flag( spell_flag::PERMANENT ) && sp.is_max_level() ) ) { granted.set_var( "ethereal", to_turns( sp.duration_turns() ) ); - granted.set_flag( "ETHEREAL_ITEM" ); + granted.set_flag( flag_ETHEREAL_ITEM ); } if( granted.count_by_charges() && sp.damage() > 0 ) { granted.charges = sp.damage(); } if( g->u.can_wear( granted ).success() ) { - granted.set_flag( "FIT" ); + granted.set_flag( flag_FIT ); g->u.wear_item( granted, false ); } else if( !g->u.is_armed() ) { g->u.weapon = granted; diff --git a/src/magic_teleporter_list.cpp b/src/magic_teleporter_list.cpp index 4f9499c4fcfc1..a528b6b25a5f3 100644 --- a/src/magic_teleporter_list.cpp +++ b/src/magic_teleporter_list.cpp @@ -23,6 +23,7 @@ #include "color.h" #include "string_formatter.h" #include "translations.h" +#include "cata_string_consts.h" static bool popup_string( std::string &result, std::string &title ) { @@ -61,7 +62,7 @@ static cata::optional find_valid_teleporters_omt( const tripoint &omt_ tinymap checker; checker.load( sm_pt, true ); for( const tripoint &p : checker.points_on_zlevel() ) { - if( checker.has_flag_furn( "TRANSLOCATOR", p ) ) { + if( checker.has_flag_furn( flag_TRANSLOCATOR, p ) ) { return checker.getabs( p ); } } diff --git a/src/map.cpp b/src/map.cpp index 9340a784a1f91..dc80728128db2 100755 --- a/src/map.cpp +++ b/src/map.cpp @@ -2418,9 +2418,9 @@ bool map::is_last_ter_wall( const bool no_furn, const point &p, if( no_furn && has_furn( point( x2, y2 ) ) ) { loop = false; result = false; - } else if( !has_flag_ter( "FLAT", point( x2, y2 ) ) ) { + } else if( !has_flag_ter( flag_FLAT, point( x2, y2 ) ) ) { loop = false; - if( !has_flag_ter( "WALL", point( x2, y2 ) ) ) { + if( !has_flag_ter( flag_WALL, point( x2, y2 ) ) ) { result = false; } } @@ -2574,7 +2574,7 @@ bool map::has_nearby_fire( const tripoint &p, int radius ) if( get_field( pt, fd_fire ) != nullptr ) { return true; } - if( has_flag_ter_or_furn( "USABLE_FIRE", p ) ) { + if( has_flag_ter_or_furn( flag_USABLE_FIRE, p ) ) { return true; } } @@ -3058,12 +3058,12 @@ void map::bash_ter_furn( const tripoint &p, bash_params ¶ms ) } // Clear out any partially grown seeds - if( has_flag_ter_or_furn( "PLANT", p ) ) { + if( has_flag_ter_or_furn( flag_PLANT, p ) ) { i_clear( p ); } - if( ( smash_furn && has_flag_furn( "FUNGUS", p ) ) || - ( smash_ter && has_flag_ter( "FUNGUS", p ) ) ) { + if( ( smash_furn && has_flag_furn( flag_FUNGUS, p ) ) || + ( smash_ter && has_flag_ter( flag_FUNGUS, p ) ) ) { fungal_effects( *g, *this ).create_spores( p ); } @@ -6799,7 +6799,7 @@ void map::grow_plant( const tripoint &p ) rotten_item_spawn( *seed, p ); furn_set( p, furn_str_id( furn.plant->transform ) ); } else if( seed->age() < plantEpoch * 3 * furn.plant->growth_multiplier ) { - if( has_flag_furn( "GROWTH_MATURE", p ) ) { + if( has_flag_furn( flag_GROWTH_MATURE, p ) ) { return; } @@ -6813,17 +6813,17 @@ void map::grow_plant( const tripoint &p ) rotten_item_spawn( *seed, p ); //You've skipped the seedling stage so roll monsters twice - if( !has_flag_furn( "GROWTH_SEEDLING", p ) ) { + if( !has_flag_furn( flag_GROWTH_SEEDLING, p ) ) { rotten_item_spawn( *seed, p ); } furn_set( p, furn_str_id( furn.plant->transform ) ); } else { //You've skipped two stages so roll monsters two times - if( has_flag_furn( "GROWTH_SEEDLING", p ) ) { + if( has_flag_furn( flag_GROWTH_SEEDLING, p ) ) { rotten_item_spawn( *seed, p ); rotten_item_spawn( *seed, p ); //One stage change - } else if( has_flag_furn( "GROWTH_MATURE", p ) ) { + } else if( has_flag_furn( flag_GROWTH_MATURE, p ) ) { rotten_item_spawn( *seed, p ); //Goes from seed to harvest in one check } else { diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 1e550f80fcc0b..b436cffb8da70 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1353,10 +1353,10 @@ class jmapgen_terrain : public jmapgen_piece void apply( mapgendata &dat, const jmapgen_int &x, const jmapgen_int &y ) const override { dat.m.ter_set( point( x.get(), y.get() ), id ); // Delete furniture if a wall was just placed over it. TODO: need to do anything for fluid, monsters? - if( dat.m.has_flag_ter( "WALL", point( x.get(), y.get() ) ) ) { + if( dat.m.has_flag_ter( flag_WALL, point( x.get(), y.get() ) ) ) { dat.m.furn_set( point( x.get(), y.get() ), f_null ); // and items, unless the wall has PLACE_ITEM flag indicating it stores things. - if( !dat.m.has_flag_ter( "PLACE_ITEM", point( x.get(), y.get() ) ) ) { + if( !dat.m.has_flag_ter( flag_PLACE_ITEM, point( x.get(), y.get() ) ) ) { dat.m.i_clear( tripoint( x.get(), y.get(), dat.m.get_abs_sub().z ) ); } } @@ -3532,8 +3532,8 @@ void map::draw_lab( mapgendata &dat ) // We determine if a border isn't handled by checking the east-facing // border space where the door normally is -- it should be a wall or door. tripoint east_border( 23, 11, abs_sub.z ); - if( !has_flag_ter( "WALL", east_border ) && - !has_flag_ter( "DOOR", east_border ) ) { + if( !has_flag_ter( flag_WALL, east_border ) && + !has_flag_ter( flag_DOOR, east_border ) ) { // TODO: create a ter_reset function that does ter_set, // furn_set, and i_clear? ter_id lw_type = tower_lab ? t_reinforced_glass : t_concrete_wall; @@ -3790,7 +3790,7 @@ void map::draw_lab( mapgendata &dat ) if( i + j > 10 && i + j < 36 && abs( i - j ) < 13 ) { // Doors and walls get sometimes destroyed: // 100% at the edge, usually in a central cross, occasionally elsewhere. - if( ( has_flag_ter( "DOOR", point( i, j ) ) || has_flag_ter( "WALL", point( i, j ) ) ) ) { + if( ( has_flag_ter( flag_DOOR, point( i, j ) ) || has_flag_ter( flag_WALL, point( i, j ) ) ) ) { if( ( i == 0 || j == 0 || i == 23 || j == 23 ) || ( !one_in( 3 ) && ( i == 11 || i == 12 || j == 11 || j == 12 ) ) || one_in( 4 ) ) { @@ -3803,8 +3803,8 @@ void map::draw_lab( mapgendata &dat ) } // and then randomly destroy 5% of the remaining nonstairs. } else if( one_in( 20 ) && - !has_flag_ter( "GOES_DOWN", point( x, y ) ) && - !has_flag_ter( "GOES_UP", point( x, y ) ) ) { + !has_flag_ter( flag_GOES_DOWN, point( x, y ) ) && + !has_flag_ter( flag_GOES_UP, point( x, y ) ) ) { destroy( { i, j, abs_sub.z } ); // bashed squares can create dirt & floors, but we want rock floors. if( t_dirt == ter( point( i, j ) ) || t_floor == ter( point( i, j ) ) ) { @@ -3882,7 +3882,7 @@ void map::draw_lab( mapgendata &dat ) t_strconc_floor == ter( point( i, j ) ) || t_thconc_floor_olight == ter( point( i, j ) ) ) ) { ter_set( point( i, j ), fluid_type ); - } else if( has_flag_ter( "DOOR", point( i, j ) ) && !one_in( 3 ) ) { + } else if( has_flag_ter( flag_DOOR, point( i, j ) ) && !one_in( 3 ) ) { // We want the actual debris, but not the rubble marker or dirt. make_rubble( { i, j, abs_sub.z } ); ter_set( point( i, j ), fluid_type ); @@ -3907,7 +3907,7 @@ void map::draw_lab( mapgendata &dat ) if( t_thconc_floor == ter( p ) || t_strconc_floor == ter( p ) || t_thconc_floor_olight == ter( p ) ) { ter_set( p, fluid_type ); - } else if( has_flag_ter( "DOOR", p ) ) { + } else if( has_flag_ter( flag_DOOR, p ) ) { // We want the actual debris, but not the rubble marker or dirt. make_rubble( { p, abs_sub.z } ); ter_set( p, fluid_type ); @@ -3947,9 +3947,9 @@ void map::draw_lab( mapgendata &dat ) ARTPROP_GLOWING }; draw_rough_circle( [this]( const point & p ) { - if( has_flag_ter( "GOES_DOWN", p ) || - has_flag_ter( "GOES_UP", p ) || - has_flag_ter( "CONSOLE", p ) ) { + if( has_flag_ter( flag_GOES_DOWN, p ) || + has_flag_ter( flag_GOES_UP, p ) || + has_flag_ter( flag_CONSOLE, p ) ) { return; // spare stairs and consoles. } make_rubble( {p, abs_sub.z } ); @@ -3963,7 +3963,7 @@ void map::draw_lab( mapgendata &dat ) // radioactive accident. case 6: { tripoint center( rng( 6, SEEX * 2 - 7 ), rng( 6, SEEY * 2 - 7 ), abs_sub.z ); - if( has_flag_ter( "WALL", center.xy() ) ) { + if( has_flag_ter( flag_WALL, center.xy() ) ) { // just skip it, we don't want to risk embedding radiation out of sight. break; } @@ -3980,9 +3980,9 @@ void map::draw_lab( mapgendata &dat ) set_radiation( p, 50 ); }, center.xy(), 1 ); draw_circle( [this]( const point & p ) { - if( has_flag_ter( "GOES_DOWN", p ) || - has_flag_ter( "GOES_UP", p ) || - has_flag_ter( "CONSOLE", p ) ) { + if( has_flag_ter( flag_GOES_DOWN, p ) || + has_flag_ter( flag_GOES_UP, p ) || + has_flag_ter( flag_CONSOLE, p ) ) { return; // spare stairs and consoles. } make_rubble( {p, abs_sub.z } ); @@ -4015,12 +4015,12 @@ void map::draw_lab( mapgendata &dat ) // Create a mostly spread fungal area throughout entire lab. if( !one_in( 5 ) && ( has_flag( flag_FLAT, point( i, j ) ) ) ) { ter_set( point( i, j ), t_fungus_floor_in ); - if( has_flag_furn( "ORGANIC", point( i, j ) ) ) { + if( has_flag_furn( flag_ORGANIC, point( i, j ) ) ) { furn_set( point( i, j ), f_fungal_clump ); } - } else if( has_flag_ter( "DOOR", point( i, j ) ) && !one_in( 5 ) ) { + } else if( has_flag_ter( flag_DOOR, point( i, j ) ) && !one_in( 5 ) ) { ter_set( point( i, j ), t_fungus_floor_in ); - } else if( has_flag_ter( "WALL", point( i, j ) ) && one_in( 3 ) ) { + } else if( has_flag_ter( flag_WALL, point( i, j ) ) && one_in( 3 ) ) { ter_set( point( i, j ), t_fungus_wall ); } } @@ -4029,12 +4029,12 @@ void map::draw_lab( mapgendata &dat ) // Make a portal surrounded by more dense fungal stuff and a fungaloid. draw_rough_circle( [this]( const point & p ) { - if( has_flag_ter( "GOES_DOWN", p ) || - has_flag_ter( "GOES_UP", p ) || - has_flag_ter( "CONSOLE", p ) ) { + if( has_flag_ter( flag_GOES_DOWN, p ) || + has_flag_ter( flag_GOES_UP, p ) || + has_flag_ter( flag_CONSOLE, p ) ) { return; // spare stairs and consoles. } - if( has_flag_ter( "WALL", p ) ) { + if( has_flag_ter( flag_WALL, p ) ) { ter_set( p, t_fungus_wall ); } else { ter_set( p, t_fungus_floor_in ); @@ -4095,7 +4095,7 @@ void map::draw_lab( mapgendata &dat ) // We determine if a border isn't handled by checking the east-facing // border space where the door normally is -- it should be a wall or door. tripoint east_border( 23, 11, abs_sub.z ); - if( !has_flag_ter( "WALL", east_border ) && !has_flag_ter( "DOOR", east_border ) ) { + if( !has_flag_ter( flag_WALL, east_border ) && !has_flag_ter( flag_DOOR, east_border ) ) { // TODO: create a ter_reset function that does ter_set, furn_set, and i_clear? ter_id lw_type = tower_lab ? t_reinforced_glass : t_concrete_wall; ter_id tw_type = tower_lab ? t_reinforced_glass : t_concrete_wall; diff --git a/src/melee.cpp b/src/melee.cpp index db8bc2be63f3e..b232233f24462 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -255,7 +255,7 @@ float player::hit_roll() const } // Farsightedness makes us hit worse - if( has_trait( trait_HYPEROPIC ) && !worn_with_flag( "FIX_FARSIGHT" ) && + if( has_trait( trait_HYPEROPIC ) && !worn_with_flag( flag_FIX_FARSIGHT ) && !has_effect( effect_contacts ) ) { hit -= 2.0f; } @@ -290,7 +290,7 @@ std::string Character::get_miss_reason() _( "Your torso encumbrance throws you off-balance." ), roll_remainder( encumb( bp_torso ) / 10.0 ) ); const int farsightedness = 2 * ( has_trait( trait_HYPEROPIC ) && - !worn_with_flag( "FIX_FARSIGHT" ) && + !worn_with_flag( flag_FIX_FARSIGHT ) && !has_effect( effect_contacts ) ); add_miss_reason( _( "You can't hit reliably due to your farsightedness." ), diff --git a/src/mission_start.cpp b/src/mission_start.cpp index b6395f05c76c0..808c93a695205 100644 --- a/src/mission_start.cpp +++ b/src/mission_start.cpp @@ -142,7 +142,7 @@ static tripoint find_potential_computer_point( const tinymap &compmap ) } int wall = 0; for( const tripoint &p2 : compmap.points_in_radius( p, 1 ) ) { - if( compmap.has_flag_ter( "WALL", p2 ) ) { + if( compmap.has_flag_ter( flag_WALL, p2 ) ) { wall++; } } diff --git a/src/monattack.cpp b/src/monattack.cpp index 4aa522dddebdd..b31efaaaedf5a 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -1276,8 +1276,8 @@ bool mattack::growplants( monster *z ) for( const auto &p : g->m.points_in_radius( z->pos(), 3 ) ) { // Only affect natural, dirtlike terrain or trees. - if( !( g->m.has_flag_ter( "DIGGABLE", p ) || - g->m.has_flag_ter( "TREE", p ) || + if( !( g->m.has_flag_ter( flag_DIGGABLE, p ) || + g->m.has_flag_ter( flag_TREE, p ) || g->m.ter( p ) == t_tree_young ) ) { continue; } @@ -2106,7 +2106,7 @@ bool mattack::plant( monster *z ) { fungal_effects fe( *g, g->m ); const tripoint monster_position = z->pos(); - const bool is_fungi = g->m.has_flag_ter( "FUNGUS", monster_position ); + const bool is_fungi = g->m.has_flag_ter( flag_FUNGUS, monster_position ); // Spores taking seed and growing into a fungaloid fe.spread_fungus( monster_position ); if( is_fungi && one_in( 10 + g->num_creatures() / 5 ) ) { @@ -2724,8 +2724,8 @@ bool mattack::stare( monster *z ) z->moves -= 200; if( z->sees( g->u ) ) { //dimensional effects don't take against dimensionally anchored foes. - if( g->u.worn_with_flag( "DIMENSIONAL_ANCHOR" ) || - g->u.has_effect_with_flag( "DIMENSIONAL_ANCHOR" ) ) { + if( g->u.worn_with_flag( flag_DIMENSIONAL_ANCHOR ) || + g->u.has_effect_with_flag( flag_DIMENSIONAL_ANCHOR ) ) { add_msg( m_warning, _( "You feel a strange reverberation across your body." ) ); return true; } @@ -2747,7 +2747,7 @@ bool mattack::fear_paralyze( monster *z ) return false; } if( g->u.sees( *z ) && !g->u.has_effect( effect_fearparalyze ) ) { - if( g->u.has_artifact_with( AEP_PSYSHIELD ) || ( g->u.worn_with_flag( "PSYSHIELD_PARTIAL" ) && + if( g->u.has_artifact_with( AEP_PSYSHIELD ) || ( g->u.worn_with_flag( flag_PSYSHIELD_PARTIAL ) && one_in( 4 ) ) ) { add_msg( _( "The %s probes your mind, but is rebuffed!" ), z->name() ); ///\EFFECT_INT decreases chance of being paralyzed by fear attack diff --git a/src/monexamine.cpp b/src/monexamine.cpp index d73069489b1e3..3f2ebac11428f 100644 --- a/src/monexamine.cpp +++ b/src/monexamine.cpp @@ -118,12 +118,12 @@ bool monexamine::pet_menu( monster &z ) amenu.addentry( milk, true, 'm', _( "Milk %s" ), pet_name ); } if( z.has_flag( MF_PET_MOUNTABLE ) && !z.has_effect( effect_saddled ) && - g->u.has_item_with_flag( "TACK" ) && g->u.get_skill_level( skill_survival ) >= 1 ) { + g->u.has_item_with_flag( flag_TACK ) && g->u.get_skill_level( skill_survival ) >= 1 ) { amenu.addentry( attach_saddle, true, 'h', _( "Tack up %s" ), pet_name ); } else if( z.has_flag( MF_PET_MOUNTABLE ) && z.has_effect( effect_saddled ) ) { amenu.addentry( remove_saddle, true, 'h', _( "Remove tack from %s" ), pet_name ); } else if( z.has_flag( MF_PET_MOUNTABLE ) && !z.has_effect( effect_saddled ) && - g->u.has_item_with_flag( "TACK" ) && g->u.get_skill_level( skill_survival ) < 1 ) { + g->u.has_item_with_flag( flag_TACK ) && g->u.get_skill_level( skill_survival ) < 1 ) { amenu.addentry( remove_saddle, false, 'h', _( "You don't know how to saddle %s" ), pet_name ); } if( z.has_flag( MF_PAY_BOT ) ) { diff --git a/src/monmove.cpp b/src/monmove.cpp index 40119755c16be..8d9135f50f3a3 100644 --- a/src/monmove.cpp +++ b/src/monmove.cpp @@ -1422,7 +1422,7 @@ bool monster::move_to( const tripoint &p, bool force, const float stagger_adjust force = true; if( g->u.sees( *this ) ) { add_msg( _( "The %1$s flies over the %2$s." ), name(), - g->m.has_flag_furn( "CLIMBABLE", p ) ? g->m.furnname( p ) : + g->m.has_flag_furn( flag_CLIMBABLE, p ) ? g->m.furnname( p ) : g->m.tername( p ) ); } } else if( climbs() ) { @@ -1430,7 +1430,7 @@ bool monster::move_to( const tripoint &p, bool force, const float stagger_adjust force = true; if( g->u.sees( *this ) ) { add_msg( _( "The %1$s climbs over the %2$s." ), name(), - g->m.has_flag_furn( "CLIMBABLE", p ) ? g->m.furnname( p ) : + g->m.has_flag_furn( flag_CLIMBABLE, p ) ? g->m.furnname( p ) : g->m.tername( p ) ); } } diff --git a/src/npc.cpp b/src/npc.cpp index 90067d610fb08..8d267cea57006 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -804,7 +804,7 @@ bool npc::can_read( const item &book, std::vector &fail_reasons ) // Check for conditions that disqualify us if( type->intel > 0 && has_trait( trait_ILLITERATE ) ) { fail_reasons.emplace_back( _( "I can't read!" ) ); - } else if( has_trait( trait_HYPEROPIC ) && !worn_with_flag( "FIX_FARSIGHT" ) && + } else if( has_trait( trait_HYPEROPIC ) && !worn_with_flag( flag_FIX_FARSIGHT ) && !has_effect( effect_contacts ) && !has_bionic( bio_eye_optic ) ) { fail_reasons.emplace_back( _( "I can't read without my glasses." ) ); } else if( fine_detail_vision_mod() > 4 ) { diff --git a/src/npcmove.cpp b/src/npcmove.cpp index 8943206686755..5883d470023b9 100644 --- a/src/npcmove.cpp +++ b/src/npcmove.cpp @@ -2279,7 +2279,7 @@ void npc::move_to( const tripoint &pt, bool no_bashing, std::set *nomo moves -= 100; moved = true; } - } else if( get_dex() > 1 && g->m.has_flag_ter_or_furn( "CLIMBABLE", p ) ) { + } else if( get_dex() > 1 && g->m.has_flag_ter_or_furn( flag_CLIMBABLE, p ) ) { ///\EFFECT_DEX_NPC increases chance to climb CLIMBABLE furniture or terrain int climb = get_dex(); if( one_in( climb ) ) { @@ -3815,8 +3815,8 @@ void npc::reach_omt_destination() if( is_player_ally() ) { talk_function::assign_guard( *this ); if( rl_dist( g->u.pos(), pos() ) > SEEX * 2 || !g->u.sees( pos() ) ) { - if( g->u.has_item_with_flag( "TWO_WAY_RADIO", true ) && - has_item_with_flag( "TWO_WAY_RADIO", true ) ) { + if( g->u.has_item_with_flag( flag_TWO_WAY_RADIO, true ) && + has_item_with_flag( flag_TWO_WAY_RADIO, true ) ) { add_msg( m_info, _( "From your two-way radio you hear %s reporting in, " "'I've arrived, boss!'" ), disp_name() ); } diff --git a/src/panels.cpp b/src/panels.cpp index 0a59e6578bb03..28556f76f9d95 100644 --- a/src/panels.cpp +++ b/src/panels.cpp @@ -867,7 +867,7 @@ static void draw_limb_health( avatar &u, const catacurses::window &w, int limb_i nc_color color = c_light_red; const auto bp = avatar::hp_to_bp( static_cast( limb_index ) ); - if( u.worn_with_flag( "SPLINT", bp ) ) { + if( u.worn_with_flag( flag_SPLINT, bp ) ) { const auto &eff = u.get_effect( effect_mending, bp ); const int mend_perc = eff.is_null() ? 0.0 : 100 * eff.get_duration() / eff.get_max_duration(); diff --git a/src/player.cpp b/src/player.cpp index bae48f2461bff..95a5710837db1 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -462,7 +462,7 @@ int player::run_cost( int base_cost, bool diag ) const const bool flatground = movecost < 105; // The "FLAT" tag includes soft surfaces, so not a good fit. const bool on_road = flatground && g->m.has_flag( flag_ROAD, pos() ); - const bool on_fungus = g->m.has_flag_ter_or_furn( "FUNGUS", pos() ); + const bool on_fungus = g->m.has_flag_ter_or_furn( flag_FUNGUS, pos() ); if( !is_mounted() ) { if( movecost > 100 ) { @@ -501,13 +501,13 @@ int player::run_cost( int base_cost, bool diag ) const movecost *= 1.1f; } - if( worn_with_flag( "SLOWS_MOVEMENT" ) ) { + if( worn_with_flag( flag_SLOWS_MOVEMENT ) ) { movecost *= 1.1f; } - if( worn_with_flag( "FIN" ) ) { + if( worn_with_flag( flag_FIN ) ) { movecost *= 1.5f; } - if( worn_with_flag( "ROLLER_INLINE" ) ) { + if( worn_with_flag( flag_ROLLER_INLINE ) ) { if( on_road ) { movecost *= 0.5f; } else { @@ -516,7 +516,7 @@ int player::run_cost( int base_cost, bool diag ) const } // Quad skates might be more stable than inlines, // but that also translates into a slower speed when on good surfaces. - if( worn_with_flag( "ROLLER_QUAD" ) ) { + if( worn_with_flag( flag_ROLLER_QUAD ) ) { if( on_road ) { movecost *= 0.7f; } else { @@ -525,7 +525,7 @@ int player::run_cost( int base_cost, bool diag ) const } // Skates with only one wheel (roller shoes) are fairly less stable // and fairly slower as well - if( worn_with_flag( "ROLLER_ONE" ) ) { + if( worn_with_flag( flag_ROLLER_ONE ) ) { if( on_road ) { movecost *= 0.85f; } else { @@ -594,8 +594,8 @@ int player::swim_speed() const ret -= hand_bonus_mult * ( 20 + str_cur * 4 ); } /** @EFFECT_STR increases swim speed bonus from swim_fins */ - if( worn_with_flag( "FIN", bp_foot_l ) || worn_with_flag( "FIN", bp_foot_r ) ) { - if( worn_with_flag( "FIN", bp_foot_l ) && worn_with_flag( "FIN", bp_foot_r ) ) { + if( worn_with_flag( flag_FIN, bp_foot_l ) || worn_with_flag( flag_FIN, bp_foot_r ) ) { + if( worn_with_flag( flag_FIN, bp_foot_l ) && worn_with_flag( flag_FIN, bp_foot_r ) ) { ret -= ( 15 * str_cur ); } else { ret -= ( 15 * str_cur ) / 2; @@ -618,7 +618,7 @@ int player::swim_speed() const /** @EFFECT_DEX increases swim speed */ ret -= str_cur * 6 + dex_cur * 4; - if( worn_with_flag( "FLOTATION" ) ) { + if( worn_with_flag( flag_FLOTATION ) ) { ret = std::min( ret, 400 ); ret = std::max( ret, 200 ); } @@ -962,7 +962,7 @@ int player::overmap_sight_range( int light_level ) const float multiplier = Character::mutation_value( "overmap_multiplier" ); // Binoculars double your sight range. - const bool has_optic = ( has_item_with_flag( "ZOOM" ) || has_bionic( bio_eye_optic ) || + const bool has_optic = ( has_item_with_flag( flag_ZOOM ) || has_bionic( bio_eye_optic ) || ( is_mounted() && mounted_creature->has_flag( MF_MECH_RECON_VISION ) ) ); if( has_optic ) { @@ -997,10 +997,10 @@ bool player::sight_impaired() const has_effect( effect_darkness ) ) && ( !( has_trait( trait_PER_SLIME_OK ) ) ) ) || ( underwater && !has_bionic( bio_membrane ) && !has_trait( trait_MEMBRANE ) && - !worn_with_flag( "SWIM_GOGGLES" ) && !has_trait( trait_PER_SLIME_OK ) && + !worn_with_flag( flag_SWIM_GOGGLES ) && !has_trait( trait_PER_SLIME_OK ) && !has_trait( trait_CEPH_EYES ) && !has_trait( trait_SEESLEEP ) ) || ( ( has_trait( trait_MYOPIC ) || has_trait( trait_URSINE_EYE ) ) && - !worn_with_flag( "FIX_NEARSIGHT" ) && + !worn_with_flag( flag_FIX_NEARSIGHT ) && !has_effect( effect_contacts ) && !has_bionic( bio_eye_optic ) ) || has_trait( trait_PER_SLIME ) ); @@ -1032,7 +1032,7 @@ bool player::avoid_trap( const tripoint &pos, const trap &tr ) const bool player::has_alarm_clock() const { - return ( has_item_with_flag( "ALARMCLOCK", true ) || + return ( has_item_with_flag( flag_ALARMCLOCK, true ) || ( g->m.veh_at( pos() ) && !empty( g->m.veh_at( pos() )->vehicle().get_avail_parts( "ALARMCLOCK" ) ) ) || has_bionic( bio_watch ) ); @@ -1040,7 +1040,7 @@ bool player::has_alarm_clock() const bool player::has_watch() const { - return ( has_item_with_flag( "WATCH", true ) || + return ( has_item_with_flag( flag_WATCH, true ) || ( g->m.veh_at( pos() ) && !empty( g->m.veh_at( pos() )->vehicle().get_avail_parts( "WATCH" ) ) ) || has_bionic( bio_watch ) ); @@ -1324,9 +1324,9 @@ void player::on_hit( Creature *source, body_part bp_hit, source->add_effect( effect_blind, 2_turns ); } } - if( worn_with_flag( "REQUIRES_BALANCE" ) && !has_effect( effect_downed ) ) { + if( worn_with_flag( flag_REQUIRES_BALANCE ) && !has_effect( effect_downed ) ) { int rolls = 4; - if( worn_with_flag( "ROLLER_ONE" ) ) { + if( worn_with_flag( flag_ROLLER_ONE ) ) { rolls += 2; } if( has_trait( trait_PROF_SKATER ) ) { @@ -1709,7 +1709,7 @@ void player::apply_damage( Creature *source, body_part hurt, int dam, const bool float player::fall_damage_mod() const { - if( has_effect_with_flag( "EFFECT_FEATHER_FALL" ) ) { + if( has_effect_with_flag( flag_EFFECT_FEATHER_FALL ) ) { return 0.0f; } float ret = 1.0f; @@ -4355,7 +4355,7 @@ void player::try_to_sleep( const time_duration &dur ) } } else if( has_trait( trait_M_SKIN3 ) ) { fungaloid_cosplay = true; - if( g->m.has_flag_ter_or_furn( "FUNGUS", pos() ) ) { + if( g->m.has_flag_ter_or_furn( flag_FUNGUS, pos() ) ) { add_msg_if_player( m_good, _( "Our fibers meld with the ground beneath us. The gills on our neck begin to seed the air with spores as our awareness fades." ) ); } @@ -4402,7 +4402,7 @@ void player::try_to_sleep( const time_duration &dur ) add_msg_if_player( m_good, _( "You lay beneath the waves' embrace, gazing up through the water's surface…" ) ); watersleep = true; - } else if( g->m.has_flag_ter( "SWIMMABLE", pos() ) ) { + } else if( g->m.has_flag_ter( flag_SWIMMABLE, pos() ) ) { add_msg_if_player( m_good, _( "You settle into the water and begin to drowse…" ) ); watersleep = true; } @@ -4478,7 +4478,7 @@ int player::sleep_spot( const tripoint &p ) const // Mousefolk can sleep just about anywhere. sleepy += 40; } - if( watersleep && g->m.has_flag_ter( "SWIMMABLE", pos() ) ) { + if( watersleep && g->m.has_flag_ter( flag_SWIMMABLE, pos() ) ) { sleepy += 10; //comfy water! } @@ -4627,16 +4627,16 @@ void player::practice( const skill_id &id, int amount, int cap, bool suppress_wa amount = 0; } } - if( has_trait_flag( "PRED2" ) && skill.is_combat_skill() ) { + if( has_trait_flag( flag_PRED2 ) && skill.is_combat_skill() ) { if( one_in( 3 ) ) { amount *= 2; } } - if( has_trait_flag( "PRED3" ) && skill.is_combat_skill() ) { + if( has_trait_flag( flag_PRED3 ) && skill.is_combat_skill() ) { amount *= 2; } - if( has_trait_flag( "PRED4" ) && skill.is_combat_skill() ) { + if( has_trait_flag( flag_PRED4 ) && skill.is_combat_skill() ) { amount *= 3; } @@ -4667,7 +4667,7 @@ void player::practice( const skill_id &id, int amount, int cap, bool suppress_wa focus_pool -= chance_to_drop / 100; // Apex Predators don't think about much other than killing. // They don't lose Focus when practicing combat skills. - if( ( rng( 1, 100 ) <= ( chance_to_drop % 100 ) ) && ( !( has_trait_flag( "PRED4" ) && + if( ( rng( 1, 100 ) <= ( chance_to_drop % 100 ) ) && ( !( has_trait_flag( flag_PRED4 ) && skill.is_combat_skill() ) ) ) { focus_pool--; } @@ -5438,9 +5438,9 @@ void player::place_corpse() for( const bionic &bio : *my_bionics ) { if( item::type_is_defined( bio.id.str() ) ) { item cbm( bio.id.str(), calendar::turn ); - cbm.set_flag( "FILTHY" ); - cbm.set_flag( "NO_STERILE" ); - cbm.set_flag( "NO_PACKED" ); + cbm.set_flag( flag_FILTHY ); + cbm.set_flag( flag_NO_STERILE ); + cbm.set_flag( flag_NO_PACKED ); cbm.faults.emplace( fault_bionic_salvaged ); body.put_in( cbm ); } diff --git a/src/player_hardcoded_effects.cpp b/src/player_hardcoded_effects.cpp index c85ac58333884..48b6f9769bac5 100644 --- a/src/player_hardcoded_effects.cpp +++ b/src/player_hardcoded_effects.cpp @@ -1011,7 +1011,7 @@ void player::hardcoded_effects( effect &it ) } if( has_trait( trait_M_SKIN3 ) ) { // Spores happen! - if( g->m.has_flag_ter_or_furn( "FUNGUS", pos() ) ) { + if( g->m.has_flag_ter_or_furn( flag_FUNGUS, pos() ) ) { if( get_fatigue() >= 0 ) { mod_fatigue( -5 ); // Local guides need less sleep on fungal soil } diff --git a/src/ranged.cpp b/src/ranged.cpp index 42ca346d8ec85..0aa63e36328eb 100644 --- a/src/ranged.cpp +++ b/src/ranged.cpp @@ -353,7 +353,7 @@ int player::fire_gun( const tripoint &target, int shots, item &gun ) } // usage of any attached bipod is dependent upon terrain - bool bipod = g->m.has_flag_ter_or_furn( "MOUNTABLE", pos() ); + bool bipod = g->m.has_flag_ter_or_furn( flag_MOUNTABLE, pos() ); if( !bipod ) { if( const optional_vpart_position vp = g->m.veh_at( pos() ) ) { bipod = vp->vehicle().has_part( pos(), "MOUNTABLE" ); @@ -2196,7 +2196,7 @@ static void cycle_action( item &weap, const tripoint &pos ) if( weap.ammo_data() && weap.ammo_data()->ammo->casing ) { const itype_id casing = *weap.ammo_data()->ammo->casing; if( weap.has_flag( flag_RELOAD_EJECT ) || weap.gunmod_find( "brass_catcher" ) ) { - weap.contents.push_back( item( casing ).set_flag( "CASING" ) ); + weap.contents.push_back( item( casing ).set_flag( flag_CASING ) ); } else { if( cargo.empty() ) { g->m.add_item_or_charges( eject, item( casing ) ); @@ -2214,7 +2214,7 @@ static void cycle_action( item &weap, const tripoint &pos ) if( mag && mag->type->magazine->linkage ) { item linkage( *mag->type->magazine->linkage, calendar::turn, 1 ); if( weap.gunmod_find( "brass_catcher" ) ) { - linkage.set_flag( "CASING" ); + linkage.set_flag( flag_CASING ); weap.contents.push_back( linkage ); } else if( cargo.empty() ) { g->m.add_item_or_charges( eject, linkage ); diff --git a/src/start_location.cpp b/src/start_location.cpp index a483970fe4a93..cda55d9f8d0f2 100644 --- a/src/start_location.cpp +++ b/src/start_location.cpp @@ -361,8 +361,8 @@ void start_location::burn( const tripoint &omtstart, const int uy = g->u.posy() % HALF_MAPSIZE_Y; std::vector valid; for( const tripoint &p : m.points_on_zlevel() ) { - if( !( m.has_flag_ter( "DOOR", p ) || - m.has_flag_ter( "OPENCLOSE_INSIDE", p ) || + if( !( m.has_flag_ter( flag_DOOR, p ) || + m.has_flag_ter( flag_OPENCLOSE_INSIDE, p ) || m.is_outside( p ) || ( p.x >= ux - rad && p.x <= ux + rad && p.y >= uy - rad && p.y <= uy + rad ) ) ) { if( m.has_flag( flag_FLAMMABLE, p ) || m.has_flag( flag_FLAMMABLE_ASH, p ) ) { diff --git a/src/suffer.cpp b/src/suffer.cpp index 45be17eb252c8..e8690c3381c47 100644 --- a/src/suffer.cpp +++ b/src/suffer.cpp @@ -144,7 +144,7 @@ void Character::suffer_while_underwater() if( !has_trait( trait_GILLS ) && !has_trait( trait_GILLS_CEPH ) ) { oxygen--; } - if( oxygen < 12 && worn_with_flag( "REBREATHER" ) ) { + if( oxygen < 12 && worn_with_flag( flag_REBREATHER ) ) { oxygen += 12; } if( oxygen <= 5 ) { @@ -156,7 +156,7 @@ void Character::suffer_while_underwater() apply_damage( nullptr, bp_torso, rng( 1, 4 ) ); } } - if( has_trait( trait_FRESHWATEROSMOSIS ) && !g->m.has_flag_ter( "SALT_WATER", pos() ) && + if( has_trait( trait_FRESHWATEROSMOSIS ) && !g->m.has_flag_ter( flag_SALT_WATER, pos() ) && get_thirst() > -60 ) { mod_thirst( -1 ); } @@ -1391,7 +1391,7 @@ bool Character::irradiate( float rads, bool bypass ) if( rads > 0 ) { bool has_helmet = false; const bool power_armored = is_wearing_power_armor( &has_helmet ); - const bool rad_resist = power_armored || worn_with_flag( "RAD_RESIST" ); + const bool rad_resist = power_armored || worn_with_flag( flag_RAD_RESIST ); if( is_rad_immune() && !bypass ) { // Power armor and some high-tech gear protects completely from radiation @@ -1527,7 +1527,7 @@ void Character::mend( int rate_multiplier ) } body_part part = hp_to_bp( static_cast( i ) ); - if( needs_splint && !worn_with_flag( "SPLINT", part ) ) { + if( needs_splint && !worn_with_flag( flag_SPLINT, part ) ) { continue; } diff --git a/src/teleport.cpp b/src/teleport.cpp index b903bfe30ad2a..9ed95831ecdd6 100644 --- a/src/teleport.cpp +++ b/src/teleport.cpp @@ -23,8 +23,8 @@ bool teleport::teleport( Creature &critter, int min_distance, int max_distance, tripoint origin = critter.pos(); tripoint new_pos = origin; //The teleportee is dimensionally anchored so nothing happens - if( p && ( p->worn_with_flag( "DIMENSIONAL_ANCHOR" ) || - p->has_effect_with_flag( "DIMENSIONAL_ANCHOR" ) ) ) { + if( p && ( p->worn_with_flag( flag_DIMENSIONAL_ANCHOR ) || + p->has_effect_with_flag( flag_DIMENSIONAL_ANCHOR ) ) ) { p->add_msg_if_player( m_warning, _( "You feel a strange, inwards force." ) ); return false; } @@ -59,8 +59,8 @@ bool teleport::teleport( Creature &critter, int min_distance, int max_distance, add_msg( m_bad, _( "You cannot teleport safely." ) ); } return false; - } else if( poor_player && ( poor_player->worn_with_flag( "DIMENSIONAL_ANCHOR" ) || - poor_player->has_effect_with_flag( "DIMENSIONAL_ANCHOR" ) ) ) { + } else if( poor_player && ( poor_player->worn_with_flag( flag_DIMENSIONAL_ANCHOR ) || + poor_player->has_effect_with_flag( flag_DIMENSIONAL_ANCHOR ) ) ) { poor_player->add_msg_if_player( m_warning, _( "You feel disjointed." ) ); return false; } else { diff --git a/src/veh_type.cpp b/src/veh_type.cpp index fc015e2031646..f4d3ab1a59529 100644 --- a/src/veh_type.cpp +++ b/src/veh_type.cpp @@ -437,7 +437,7 @@ void vpart_info::finalize() for( auto &e : vpart_info_all ) { if( e.second.folded_volume > 0_ml ) { - e.second.set_flag( "FOLDABLE" ); + e.second.set_flag( flag_FOLDABLE ); } for( const auto &f : e.second.flags ) { diff --git a/src/vehicle_move.cpp b/src/vehicle_move.cpp index f8e5e569e9190..82d2da1dd839f 100644 --- a/src/vehicle_move.cpp +++ b/src/vehicle_move.cpp @@ -509,13 +509,13 @@ veh_collision vehicle::part_collision( int part, const tripoint &p, ( g->m.is_bashable_ter_furn( p, false ) && g->m.move_cost_ter_furn( p ) != 2 && // Don't collide with tiny things, like flowers, unless we have a wheel in our space. ( part_with_feature( ret.part, VPFLAG_WHEEL, true ) >= 0 || - !g->m.has_flag_ter_or_furn( "TINY", p ) ) && + !g->m.has_flag_ter_or_furn( flag_TINY, p ) ) && // Protrusions don't collide with short terrain. // Tiny also doesn't, but it's already excluded unless there's a wheel present. !( part_with_feature( ret.part, "PROTRUSION", true ) >= 0 && - g->m.has_flag_ter_or_furn( "SHORT", p ) ) && + g->m.has_flag_ter_or_furn( flag_SHORT, p ) ) && // These are bashable, but don't interact with vehicles. - !g->m.has_flag_ter_or_furn( "NOCOLLIDE", p ) && + !g->m.has_flag_ter_or_furn( flag_NOCOLLIDE, p ) && // Do not collide with track tiles if we can use rails !( g->m.has_flag_ter_or_furn( TFLAG_RAIL, p ) && this->can_use_rails() ) ) ) { // Movecost 2 indicates flat terrain like a floor, no collision there. diff --git a/tests/encumbrance_test.cpp b/tests/encumbrance_test.cpp index ae5bb48cb717b..2407272c61585 100644 --- a/tests/encumbrance_test.cpp +++ b/tests/encumbrance_test.cpp @@ -16,6 +16,7 @@ #include "material.h" #include "type_id.h" #include "debug.h" +#include "cata_string_consts.h" static void test_encumbrance_on( player &p, @@ -117,7 +118,7 @@ TEST_CASE( "same_layer_encumbrance", "[encumbrance]" ) TEST_CASE( "tiny_clothing", "[encumbrance]" ) { item i( "longshirt" ); - i.set_flag( "UNDERSIZE" ); + i.set_flag( flag_UNDERSIZE ); test_encumbrance_items( { i }, "TORSO", longshirt_e * 3 ); } @@ -128,7 +129,7 @@ TEST_CASE( "tiny_character", "[encumbrance]" ) test_encumbrance_items( { i }, "TORSO", longshirt_e * 2, add_trait( "SMALL2" ) ); } SECTION( "undersize shrt" ) { - i.set_flag( "UNDERSIZE" ); + i.set_flag( flag_UNDERSIZE ); test_encumbrance_items( { i }, "TORSO", longshirt_e, add_trait( "SMALL2" ) ); } }