Skip to content

Commit

Permalink
Move more string consts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramza13 committed Feb 19, 2020
1 parent 1d23fcc commit d181b0c
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 127 deletions.
6 changes: 3 additions & 3 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,9 @@ static void set_up_butchery( player_activity &act, player &u, butcher_type actio
// applies to all butchery actions
const bool is_human = corpse.id == mtype_id::NULL_ID() || ( corpse.in_species( HUMAN ) &&
!corpse.in_species( ZOMBIE ) );
if( is_human && !( u.has_trait_flag( trait_flag_CANNIBAL ) ||
u.has_trait_flag( trait_flag_PSYCHOPATH ) ||
u.has_trait_flag( trait_flag_SAPIOVORE ) ) ) {
if( is_human && !( u.has_trait_flag( flag_CANNIBAL ) ||
u.has_trait_flag( flag_PSYCHOPATH ) ||
u.has_trait_flag( flag_SAPIOVORE ) ) ) {

if( u.is_player() ) {
if( query_yn( _( "Would you dare desecrate the mortal remains of a fellow human being?" ) ) ) {
Expand Down
26 changes: 16 additions & 10 deletions src/cata_string_consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ static const efftype_id effect_weed_high( "weed_high" );
static const efftype_id effect_winded( "winded" );
static const efftype_id effect_zapped( "zapped" );


static const trait_id trait_ACIDBLOOD( "ACIDBLOOD" );
static const trait_id trait_ACIDPROOF( "ACIDPROOF" );
static const trait_id trait_ADDICTIVE( "ADDICTIVE" );
Expand Down Expand Up @@ -719,11 +720,6 @@ static const trait_id trait_WOOLALLERGY( "WOOLALLERGY" );
static const trait_id trait_XS( "XS" );
static const trait_id trait_XXXL( "XXXL" );

static const trait_id debug_nodmg( "DEBUG_NODMG" );

static const std::string trait_flag_CANNIBAL( "CANNIBAL" );
static const std::string trait_flag_PSYCHOPATH( "PSYCHOPATH" );
static const std::string trait_flag_SAPIOVORE( "SAPIOVORE" );

static const mongroup_id GROUP_BLOB( "GROUP_BLOB" );
static const mongroup_id GROUP_BREATHER( "GROUP_BREATHER" );
Expand Down Expand Up @@ -966,6 +962,7 @@ static const std::string flag_CAMERA( "CAMERA" );
static const std::string flag_CAMERA_CONTROL( "CAMERA_CONTROL" );
static const std::string flag_CAMERA_PRO( "CAMERA_PRO" );
static const std::string flag_CAN_SIT( "CAN_SIT" );
static const std::string flag_CANNIBAL( "CANNIBAL" );
static const std::string flag_CANNIBALISM( "CANNIBALISM" );
static const std::string flag_CARNIVORE_OK( "CARNIVORE_OK" );
static const std::string flag_CASING( "CASING" );
Expand Down Expand Up @@ -1146,9 +1143,14 @@ static const std::string flag_PLOWABLE( "PLOWABLE" );
static const std::string flag_POCKETS( "POCKETS" );
static const std::string flag_POWERARMOR_COMPATIBLE( "POWERARMOR_COMPATIBLE" );
static const std::string flag_POWERED( "POWERED" );
static const std::string flag_PRED1( "PRED1" );
static const std::string flag_PRED2( "PRED2" );
static const std::string flag_PRED3( "PRED3" );
static const std::string flag_PRED4( "PRED4" );
static const std::string flag_PRIMITIVE_RANGED_WEAPON( "PRIMITIVE_RANGED_WEAPON" );
static const std::string flag_PROCESSING( "PROCESSING" );
static const std::string flag_PROCESSING_RESULT( "PROCESSING_RESULT" );
static const std::string flag_PSYCHOPATH( "PSYCHOPATH" );
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" );
Expand Down Expand Up @@ -1186,6 +1188,7 @@ 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" );
static const std::string flag_SAPIOVORE( "SAPIOVORE" );
static const std::string flag_SEALED( "SEALED" );
static const std::string flag_SECRET( "SECRET" );
static const std::string flag_SEMITANGIBLE( "SEMITANGIBLE" );
Expand Down Expand Up @@ -1383,11 +1386,14 @@ static const species_id ROBOT( "ROBOT" );
static const species_id SPIDER( "SPIDER" );
static const species_id ZOMBIE( "ZOMBIE" );

static const matec_id tec_none( "tec_none" );
static const matec_id WBLOCK_1( "WBLOCK_1" );
static const matec_id WBLOCK_2( "WBLOCK_2" );
static const matec_id WBLOCK_3( "WBLOCK_3" );
static const matec_id WHIP_DISARM( "WHIP_DISARM" );
static const matec_id matec_no_technique_id( "" );
static const matec_id matec_RAPID( "RAPID" );
static const matec_id matec_tec_none( "tec_none" );
static const matec_id matec_VORPAL( "VORPAL" );
static const matec_id matec_WBLOCK_1( "WBLOCK_1" );
static const matec_id matec_WBLOCK_2( "WBLOCK_2" );
static const matec_id matec_WBLOCK_3( "WBLOCK_3" );
static const matec_id matec_WHIP_DISARM( "WHIP_DISARM" );

static const ter_str_id ter_dirt( "t_dirt" );
static const ter_str_id ter_grass_dead( "t_grass_dead" );
Expand Down
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5376,7 +5376,7 @@ nc_color Character::symbol_color() const
bool Character::is_immune_field( const field_type_id &fid ) const
{
// Obviously this makes us invincible
if( has_trait( debug_nodmg ) ) {
if( has_trait( trait_DEBUG_NODMG ) ) {
return true;
}
// Check to see if we are immune
Expand Down
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ void item::food_info( const item *food_item, std::vector<iteminfo> &info,

if( food_item->has_flag( flag_CANNIBALISM ) &&
parts->test( iteminfo_parts::FOOD_CANNIBALISM ) ) {
if( !g->u.has_trait_flag( trait_flag_CANNIBAL ) ) {
if( !g->u.has_trait_flag( flag_CANNIBAL ) ) {
info.emplace_back( "DESCRIPTION",
_( "* This food contains <bad>human flesh</bad>." ) );
} else {
Expand Down
Loading

0 comments on commit d181b0c

Please sign in to comment.