diff --git a/src/action.cpp b/src/action.cpp index 7198ab827d5f0..f455ff306e702 100644 --- a/src/action.cpp +++ b/src/action.cpp @@ -31,6 +31,7 @@ #include "ret_val.h" #include "type_id.h" #include "point.h" +#include "cata_string_consts.h" class inventory; @@ -577,8 +578,8 @@ int hotkey_for_action( action_id action, const bool restrict_to_printable ) bool can_butcher_at( const tripoint &p ) { // TODO: unify this with game::butcher - const int factor = g->u.max_quality( quality_id( "BUTCHER" ) ); - const int factorD = g->u.max_quality( quality_id( "CUT_FINE" ) ); + const int factor = g->u.max_quality( qual_BUTCHER ); + const int factorD = g->u.max_quality( qual_CUT_FINE ); auto items = g->m.i_at( p ); bool has_item = false; bool has_corpse = false; @@ -599,18 +600,18 @@ bool can_butcher_at( const tripoint &p ) bool can_move_vertical_at( const tripoint &p, int movez ) { // TODO: unify this with game::move_vertical - if( g->m.has_flag( "SWIMMABLE", p ) && g->m.has_flag( TFLAG_DEEP_WATER, p ) ) { + if( g->m.has_flag( flag_SWIMMABLE, p ) && g->m.has_flag( TFLAG_DEEP_WATER, p ) ) { if( movez == -1 ) { - return !g->u.is_underwater() && !g->u.worn_with_flag( "FLOTATION" ); + return !g->u.is_underwater() && !g->u.worn_with_flag( flag_FLOTATION ); } else { return g->u.swim_speed() < 500 || g->u.is_wearing( "swim_fins" ); } } if( movez == -1 ) { - return g->m.has_flag( "GOES_DOWN", p ); + return g->m.has_flag( flag_GOES_DOWN, p ); } else { - return g->m.has_flag( "GOES_UP", p ); + return g->m.has_flag( flag_GOES_UP, p ); } } @@ -619,7 +620,7 @@ bool can_examine_at( const tripoint &p ) if( g->m.veh_at( p ) ) { return true; } - if( g->m.has_flag( "CONSOLE", p ) ) { + if( g->m.has_flag( flag_CONSOLE, p ) ) { return true; } if( g->m.has_items( p ) ) { @@ -701,7 +702,7 @@ action_id handle_action_menu() action_weightings[ACTION_CYCLE_MOVE] = 400; } // Only prioritize fire weapon options if we're wielding a ranged weapon. - if( g->u.weapon.is_gun() || g->u.weapon.has_flag( "REACH_ATTACK" ) ) { + if( g->u.weapon.is_gun() || g->u.weapon.has_flag( flag_REACH_ATTACK ) ) { action_weightings[ACTION_FIRE] = 350; } } diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 249509f36e6a0..566dd08d0a9e6 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -965,7 +965,7 @@ static void butchery_drops_harvest( item *corpse_item, const mtype &mt, player & ruined_parts.set_mtype( &mt ); ruined_parts.set_item_temperature( 0.00001 * corpse_item->temperature ); ruined_parts.set_rot( corpse_item->get_rot() ); - if( !p.backlog.empty() && p.backlog.front().id() == activity_id( "ACT_MULTIPLE_BUTCHER" ) ) { + if( !p.backlog.empty() && p.backlog.front().id() == ACT_MULTIPLE_BUTCHER ) { ruined_parts.set_var( "activity_var", p.name ); } g->m.add_item_or_charges( p.pos(), ruined_parts ); @@ -1846,7 +1846,7 @@ void activity_handlers::reload_finish( player_activity *act, player *p ) item &ammo = *act->targets[1]; const int qty = act->index; const bool is_speedloader = ammo.has_flag( flag_SPEEDLOADER ); - const bool is_bolt = ammo.ammo_type() == ammotype( "bolt" ); + const bool is_bolt = ammo.ammo_type() == ammo_bolt; if( !reloadable.reload( *p, std::move( act->targets[ 1 ] ), qty ) ) { add_msg( m_info, _( "Can't reload the %s." ), reloadable.tname() ); @@ -2793,7 +2793,7 @@ void activity_handlers::travel_do_turn( player_activity *act, player *p ) const auto route_to = g->m.route( p->pos(), centre_sub, p->get_pathfinding_settings(), p->get_path_avoid() ); if( !route_to.empty() ) { - const activity_id act_travel = activity_id( "ACT_TRAVELLING" ); + const activity_id act_travel = ACT_TRAVELLING; p->set_destination( route_to, player_activity( act_travel ) ); } else { p->add_msg_if_player( _( "You cannot reach that destination" ) ); @@ -3008,7 +3008,7 @@ void activity_handlers::find_mount_do_turn( player_activity *act, player *p ) } else { p->activity = player_activity(); mon->add_effect( effect_controlled, 40_turns ); - p->set_destination( route, player_activity( activity_id( "ACT_FIND_MOUNT" ) ) ); + p->set_destination( route, player_activity( ACT_FIND_MOUNT ) ); } } } @@ -3129,7 +3129,7 @@ void activity_handlers::operation_do_turn( player_activity *act, player *p ) const bionic_id upbid( act->str_values[upgraded_cbm_id] ); const bool autodoc = act->str_values[is_autodoc] == "true"; const bool u_see = g->u.sees( p->pos() ) && ( !g->u.has_effect( effect_narcosis ) || - g->u.has_bionic( bionic_id( "bio_painkiller" ) ) || g->u.has_trait( trait_id( "NOPAIN" ) ) ); + g->u.has_bionic( bio_painkiller ) || g->u.has_trait( trait_NOPAIN ) ); const int difficulty = act->values.front(); @@ -3810,9 +3810,9 @@ void activity_handlers::dig_finish( player_activity *act, player *p ) if( grave ) { if( one_in( 10 ) ) { static const std::array monids = { { - mtype_id( "mon_zombie" ), mtype_id( "mon_zombie_fat" ), - mtype_id( "mon_zombie_rot" ), mtype_id( "mon_skeleton" ), - mtype_id( "mon_zombie_crawler" ) + mon_zombie, mon_zombie_fat, + mon_zombie_rot, mon_skeleton, + mon_zombie_crawler } }; @@ -4236,7 +4236,7 @@ static hack_result hack_attempt( player &p ) } const bool using_electrohack = p.has_charges( "electrohack", 25 ) && query_yn( _( "Use electrohack?" ) ); - const bool using_fingerhack = !using_electrohack && p.has_bionic( bionic_id( "bio_fingerhack" ) ) && + const bool using_fingerhack = !using_electrohack && p.has_bionic( bio_fingerhack ) && p.get_power_level() > 24_kJ && query_yn( _( "Use fingerhack?" ) ); if( !( using_electrohack || using_fingerhack ) ) { diff --git a/src/addiction.cpp b/src/addiction.cpp index 92cc7f537f988..3d35f9e6ac8a6 100644 --- a/src/addiction.cpp +++ b/src/addiction.cpp @@ -203,7 +203,7 @@ void addict_effect( Character &u, addiction &add ) } case ADD_MUTAGEN: - if( u.has_trait( trait_id( "MUT_JUNKIE" ) ) ) { + if( u.has_trait( trait_MUT_JUNKIE ) ) { if( one_in( 600 - 50 * in ) ) { u.add_msg_if_player( m_warning, rng( 0, 6 ) < in ? _( "You so miss the exquisite rainbow of post-humanity." ) : diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index b03c63c394e0f..adfc5e8eb861a 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -2,6 +2,7 @@ #include "auto_pickup.h" #include "avatar.h" +#include "cata_string_consts.h" #include "cata_utility.h" #include "catacharset.h" #include "debug.h" @@ -933,7 +934,7 @@ bool advanced_inventory::move_all_items( bool nested_call ) g->u.drop( dropped, g->u.pos() + darea.off ); } else { if( dpane.get_area() == AIM_INVENTORY || dpane.get_area() == AIM_WORN ) { - g->u.assign_activity( activity_id( "ACT_PICKUP" ) ); + g->u.assign_activity( ACT_PICKUP ); g->u.activity.coords.push_back( g->u.pos() ); } else { // Vehicle and map destinations are handled the same. @@ -943,7 +944,7 @@ bool advanced_inventory::move_all_items( bool nested_call ) return false; } - g->u.assign_activity( activity_id( "ACT_MOVE_ITEMS" ) ); + g->u.assign_activity( ACT_MOVE_ITEMS ); // store whether the destination is a vehicle g->u.activity.values.push_back( dpane.in_vehicle() ); // Stash the destination @@ -1244,7 +1245,7 @@ void advanced_inventory::display() // make sure advanced inventory is reopened after activity completion. do_return_entry(); - g->u.assign_activity( activity_id( "ACT_WEAR" ) ); + g->u.assign_activity( ACT_WEAR ); g->u.activity.targets.emplace_back( g->u, sitem->items.front() ); g->u.activity.values.push_back( amount_to_move ); @@ -1269,7 +1270,7 @@ void advanced_inventory::display() } else { // important if item is worn if( g->u.can_unwield( g->u.i_at( idx ) ).success() ) { - g->u.assign_activity( activity_id( "ACT_DROP" ) ); + g->u.assign_activity( ACT_DROP ); g->u.activity.placement = squares[destarea].off; // incase there is vehicle cargo space at dest but the player wants to drop to ground @@ -1290,13 +1291,13 @@ void advanced_inventory::display() do_return_entry(); if( destarea == AIM_INVENTORY ) { - g->u.assign_activity( activity_id( "ACT_PICKUP" ) ); + g->u.assign_activity( ACT_PICKUP ); g->u.activity.coords.push_back( g->u.pos() ); } else if( destarea == AIM_WORN ) { - g->u.assign_activity( activity_id( "ACT_WEAR" ) ); + g->u.assign_activity( ACT_WEAR ); } else { // Vehicle and map destinations are handled similarly. - g->u.assign_activity( activity_id( "ACT_MOVE_ITEMS" ) ); + g->u.assign_activity( ACT_MOVE_ITEMS ); // store whether the destination is a vehicle g->u.activity.values.push_back( to_vehicle ); // Stash the destination @@ -1402,10 +1403,10 @@ void advanced_inventory::display() // If examining the item did not create a new activity, we have to remove // "return to AIM". do_return_entry(); - assert( g->u.has_activity( activity_id( "ACT_ADV_INVENTORY" ) ) ); + assert( g->u.has_activity( ACT_ADV_INVENTORY ) ); ret = g->inventory_item_menu( loc, info_startx, info_width, src == advanced_inventory::side::left ? game::LEFT_OF_INFO : game::RIGHT_OF_INFO ); - if( !g->u.has_activity( activity_id( "ACT_ADV_INVENTORY" ) ) ) { + if( !g->u.has_activity( ACT_ADV_INVENTORY ) ) { exit = true; } else { g->u.cancel_activity(); @@ -1682,7 +1683,7 @@ bool advanced_inventory::query_charges( aim_location destarea, const advanced_in // Inventory has a weight capacity, map and vehicle don't have that if( destarea == AIM_INVENTORY || destarea == AIM_WORN ) { const units::mass unitweight = it.weight() / ( by_charges ? it.charges : 1 ); - const units::mass max_weight = g->u.has_trait( trait_id( "DEBUG_STORAGE" ) ) ? + const units::mass max_weight = g->u.has_trait( trait_DEBUG_STORAGE ) ? units::mass_max : g->u.weight_capacity() * 4 - g->u.weight_carried(); if( unitweight > 0_gram && unitweight * amount > max_weight ) { const int weightmax = max_weight / unitweight; @@ -1836,7 +1837,7 @@ void advanced_inventory::do_return_entry() { // only save pane settings save_settings( true ); - g->u.assign_activity( activity_id( "ACT_ADV_INVENTORY" ) ); + g->u.assign_activity( ACT_ADV_INVENTORY ); g->u.activity.auto_resume = true; uistate.adv_inv_exit_code = exit_re_entry; } diff --git a/src/advanced_inv_pane.cpp b/src/advanced_inv_pane.cpp index 9b8e2161d28c6..f402408cf9f8a 100644 --- a/src/advanced_inv_pane.cpp +++ b/src/advanced_inv_pane.cpp @@ -38,6 +38,8 @@ #include #include #include +#include "cata_string_consts.h" + #if defined(__ANDROID__) # include #endif @@ -49,7 +51,7 @@ bool advanced_inventory_pane::is_filtered( const advanced_inv_listitem &it ) con bool advanced_inventory_pane::is_filtered( const item &it ) const { - if( it.has_flag( "HIDDEN_ITEM" ) ) { + if( it.has_flag( flag_HIDDEN_ITEM ) ) { return true; } if( filter.empty() ) { diff --git a/src/armor_layers.cpp b/src/armor_layers.cpp index 74b4fb46fd758..a8dc810618923 100644 --- a/src/armor_layers.cpp +++ b/src/armor_layers.cpp @@ -19,6 +19,7 @@ #include "translations.h" #include "debug.h" #include "enums.h" +#include "cata_string_consts.h" namespace { @@ -71,7 +72,7 @@ item_penalties get_item_penalties( std::list::const_iterator worn_item_it, } const int num_items = std::count_if( c.worn.begin(), c.worn.end(), [layer, bp]( const item & i ) { - return i.get_layer() == layer && i.covers( bp ) && !i.has_flag( "SEMITANGIBLE" ); + return i.get_layer() == layer && i.covers( bp ) && !i.has_flag( flag_SEMITANGIBLE ); } ); if( num_items > 1 ) { body_parts_with_stacking_penalty.push_back( bp ); @@ -247,17 +248,17 @@ std::string clothing_layer( const item &worn_item ) { std::string layer; - if( worn_item.has_flag( "PERSONAL" ) ) { + if( worn_item.has_flag( flag_PERSONAL ) ) { layer = _( "This is in your personal aura." ); - } else if( worn_item.has_flag( "SKINTIGHT" ) ) { + } else if( worn_item.has_flag( flag_SKINTIGHT ) ) { layer = _( "This is worn next to the skin." ); - } else if( worn_item.has_flag( "WAIST" ) ) { + } else if( worn_item.has_flag( flag_WAIST ) ) { layer = _( "This is worn on or around your waist." ); - } else if( worn_item.has_flag( "OUTER" ) ) { + } else if( worn_item.has_flag( flag_OUTER ) ) { layer = _( "This is worn over your other clothes." ); - } else if( worn_item.has_flag( "BELTED" ) ) { + } else if( worn_item.has_flag( flag_BELTED ) ) { layer = _( "This is strapped onto you." ); - } else if( worn_item.has_flag( "AURA" ) ) { + } else if( worn_item.has_flag( flag_AURA ) ) { layer = _( "This is an aura around you." ); } @@ -308,40 +309,40 @@ std::vector clothing_flags_description( const item &worn_item ) { std::vector description_stack; - if( worn_item.has_flag( "FIT" ) ) { + if( worn_item.has_flag( flag_FIT ) ) { description_stack.push_back( _( "It fits you well." ) ); } else if( worn_item.has_flag( "VARSIZE" ) ) { description_stack.push_back( _( "It could be refitted." ) ); } - if( worn_item.has_flag( "HOOD" ) ) { + if( worn_item.has_flag( flag_HOOD ) ) { description_stack.push_back( _( "It has a hood." ) ); } - if( worn_item.has_flag( "POCKETS" ) ) { + if( worn_item.has_flag( flag_POCKETS ) ) { description_stack.push_back( _( "It has pockets." ) ); } - if( worn_item.has_flag( "WATERPROOF" ) ) { + if( worn_item.has_flag( flag_WATERPROOF ) ) { description_stack.push_back( _( "It is waterproof." ) ); } - if( worn_item.has_flag( "WATER_FRIENDLY" ) ) { + if( worn_item.has_flag( flag_WATER_FRIENDLY ) ) { description_stack.push_back( _( "It is water friendly." ) ); } - if( worn_item.has_flag( "FANCY" ) ) { + if( worn_item.has_flag( flag_FANCY ) ) { description_stack.push_back( _( "It looks fancy." ) ); } - if( worn_item.has_flag( "SUPER_FANCY" ) ) { + if( worn_item.has_flag( flag_SUPER_FANCY ) ) { description_stack.push_back( _( "It looks really fancy." ) ); } - if( worn_item.has_flag( "FLOTATION" ) ) { + if( worn_item.has_flag( flag_FLOTATION ) ) { description_stack.push_back( _( "You will not drown today." ) ); } - if( worn_item.has_flag( "OVERSIZE" ) ) { + if( worn_item.has_flag( flag_OVERSIZE ) ) { description_stack.push_back( _( "It is very bulky." ) ); } - if( worn_item.has_flag( "SWIM_GOGGLES" ) ) { + if( worn_item.has_flag( flag_SWIM_GOGGLES ) ) { description_stack.push_back( _( "It helps you to see clearly underwater." ) ); } - if( worn_item.has_flag( "SEMITANGIBLE" ) ) { + if( worn_item.has_flag( flag_SEMITANGIBLE ) ) { description_stack.push_back( _( "It can occupy the same space as other things." ) ); } @@ -491,7 +492,7 @@ void player::sort_armor() ctxt.register_action( "HELP_KEYBINDINGS" ); auto do_return_entry = []() { - g->u.assign_activity( activity_id( "ACT_ARMOR_LAYERS" ), 0 ); + g->u.assign_activity( ACT_ARMOR_LAYERS, 0 ); g->u.activity.auto_resume = true; g->u.activity.moves_left = INT_MAX; }; @@ -795,7 +796,7 @@ void player::sort_armor() do_return_entry(); // remove the item, asking to drop it if necessary takeoff( *tmp_worn[leftListIndex] ); - if( !g->u.has_activity( activity_id( "ACT_ARMOR_LAYERS" ) ) ) { + if( !g->u.has_activity( ACT_ARMOR_LAYERS ) ) { // An activity has been created to take off the item; // we must surrender control until it is done. return; diff --git a/src/avatar.cpp b/src/avatar.cpp index 9e0ddea969cd5..1d9d836f186fa 100644 --- a/src/avatar.cpp +++ b/src/avatar.cpp @@ -788,7 +788,7 @@ void avatar::do_read( item &book ) } if( ( skill_level == reading->level || !skill_level.can_train() ) || - ( ( learner->has_trait( trait_id( "SCHIZOPHRENIC" ) ) || + ( ( learner->has_trait( trait_SCHIZOPHRENIC ) || learner->has_artifact_with( AEP_SCHIZO ) ) && one_in( 25 ) ) ) { if( learner->is_player() ) { add_msg( m_info, _( "You can no longer learn from %s." ), book.type_name() ); @@ -958,7 +958,7 @@ int avatar::calc_focus_equilibrium( bool ignore_pain ) const { int focus_equilibrium = 100; - if( activity.id() == activity_id( "ACT_READ" ) ) { + if( activity.id() == ACT_READ ) { const item &book = *activity.targets[0].get_item(); if( book.is_book() && get_item_position( &book ) != INT_MIN ) { auto &bt = *book.type->book; @@ -1059,7 +1059,7 @@ void avatar::update_mental_focus() focus_pool += calc_focus_change(); // Moved from calc_focus_equilibrium, because it is now const - if( activity.id() == activity_id( "ACT_READ" ) ) { + if( activity.id() == ACT_READ ) { const item *book = activity.targets[0].get_item(); if( get_item_position( book ) == INT_MIN || !book->is_book() ) { add_msg_if_player( m_bad, _( "You lost your book! You stop reading." ) ); diff --git a/src/avatar_action.cpp b/src/avatar_action.cpp index a2c229fadcd0b..107285c4825fa 100644 --- a/src/avatar_action.cpp +++ b/src/avatar_action.cpp @@ -81,7 +81,7 @@ bool avatar_action::move( avatar &you, map &m, int dx, int dy, int dz ) get_option( "AUTO_FEATURES" ) && get_option( "AUTO_MINING" ) && !m.veh_at( dest_loc ) && !you.is_underwater() && !you.has_effect( effect_stunned ) && !you.is_mounted() ) { - if( you.weapon.has_flag( "DIG_TOOL" ) ) { + if( you.weapon.has_flag( flag_DIG_TOOL ) ) { if( you.weapon.type->can_use( "JACKHAMMER" ) && you.weapon.ammo_sufficient() ) { you.invoke_item( &you.weapon, "JACKHAMMER", dest_loc ); // don't move into the tile until done mining @@ -310,9 +310,9 @@ bool avatar_action::move( avatar &you, map &m, int dx, int dy, int dz ) } } - bool toSwimmable = m.has_flag( "SWIMMABLE", dest_loc ); + bool toSwimmable = m.has_flag( flag_SWIMMABLE, dest_loc ); bool toDeepWater = m.has_flag( TFLAG_DEEP_WATER, dest_loc ); - bool fromSwimmable = m.has_flag( "SWIMMABLE", you.pos() ); + bool fromSwimmable = m.has_flag( flag_SWIMMABLE, you.pos() ); bool fromDeepWater = m.has_flag( TFLAG_DEEP_WATER, you.pos() ); bool fromBoat = veh0 != nullptr && veh0->is_in_water(); bool toBoat = veh1 != nullptr && veh1->is_in_water(); @@ -662,7 +662,7 @@ bool avatar_action::fire_check( avatar &you, const map &m, const targeting_data if( !is_mech_weapon ) { if( !( you.has_charges( "UPS_off", ups_drain ) || you.has_charges( "adv_UPS_off", adv_ups_drain ) || - ( you.has_active_bionic( bionic_id( "bio_ups" ) ) && + ( you.has_active_bionic( bio_ups ) && you.get_power_level() >= units::from_kilojoule( ups_drain ) ) ) ) { messages.push_back( string_format( _( "You need a UPS with at least %2$d charges or an advanced UPS with at least %3$d charges to fire the %1$s!" ), diff --git a/src/ballistics.cpp b/src/ballistics.cpp index 92605966b17d7..5542ad775570d 100644 --- a/src/ballistics.cpp +++ b/src/ballistics.cpp @@ -33,8 +33,7 @@ #include "units.h" #include "type_id.h" #include "point.h" - -static const efftype_id effect_bounced( "bounced" ); +#include "cata_string_consts.h" static void drop_or_embed_projectile( const dealt_projectile_attack &attack ) { @@ -126,7 +125,7 @@ static void drop_or_embed_projectile( const dealt_projectile_attack &attack ) } if( effects.count( "HEAVY_HIT" ) ) { - if( g->m.has_flag( "LIQUID", pt ) ) { + if( g->m.has_flag( flag_LIQUID, pt ) ) { sounds::sound( pt, 10, sounds::sound_t::combat, _( "splash!" ), false, "bullet_hit", "hit_water" ); } else { sounds::sound( pt, 8, sounds::sound_t::combat, _( "thud." ), false, "bullet_hit", "hit_wall" ); diff --git a/src/basecamp.cpp b/src/basecamp.cpp index 4e3a7f2f78e1e..2223f36e4c935 100644 --- a/src/basecamp.cpp +++ b/src/basecamp.cpp @@ -36,8 +36,7 @@ #include "type_id.h" #include "flat_set.h" #include "line.h" - -static const zone_type_id z_camp_storage( "CAMP_STORAGE" ); +#include "cata_string_consts.h" const std::map base_camps::all_directions = { // direction, direction id, tab order, direction abbreviation with bracket, direction tab title diff --git a/src/behavior_oracle.cpp b/src/behavior_oracle.cpp index 1de6dae2ec112..6544b806de24a 100644 --- a/src/behavior_oracle.cpp +++ b/src/behavior_oracle.cpp @@ -14,6 +14,7 @@ #include "item.h" #include "optional.h" #include "ret_val.h" +#include "cata_string_consts.h" namespace behavior { @@ -77,7 +78,7 @@ status_t character_oracle_t::can_make_fire() const bool fuel = false; for( const auto &i : subject->inv.const_slice() ) { const item &candidate = i->front(); - if( candidate.has_flag( "FIRESTARTER" ) ) { + if( candidate.has_flag( flag_FIRESTARTER ) ) { tool = true; if( fuel ) { return running; diff --git a/src/bionics.cpp b/src/bionics.cpp index 6dfc765c76b14..58db0ada33c11 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -810,7 +810,7 @@ bool Character::burn_fuel( int b, bool start ) const itype_id remote_fuel = find_remote_fuel(); if( !remote_fuel.empty() ) { fuel_available.emplace_back( remote_fuel ); - if( remote_fuel == itype_sun_light ) { + if( remote_fuel == fuel_type_sun_light ) { // basic solar panel produces 50W = 1 charge/20_seconds = 180 charges/hour(3600) if( is_wearing( "solarpack_on" ) ) { effective_efficiency = 0.05; @@ -887,12 +887,12 @@ bool Character::burn_fuel( int b, bool start ) mod_stored_kcal( -kcal_consumed ); mod_power_level( power_gain ); } else if( is_perpetual_fuel ) { - if( fuel == itype_sun_light && g->is_in_sunlight( pos() ) ) { + if( fuel == fuel_type_sun_light && g->is_in_sunlight( pos() ) ) { const weather_type &wtype = current_weather( pos() ); const float tick_sunlight = incident_sunlight( wtype, calendar::turn ); const double intensity = tick_sunlight / default_daylight_level(); mod_power_level( units::from_kilojoule( fuel_energy ) * intensity * effective_efficiency ); - } else if( fuel == itype_wind ) { + } else if( fuel == fuel_type_wind ) { int vehwindspeed = 0; const optional_vpart_position vp = g->m.veh_at( pos() ); if( vp ) { @@ -969,10 +969,10 @@ void Character::passive_power_gen( int b ) continue; } - if( fuel == itype_sun_light ) { + if( fuel == fuel_type_sun_light ) { const double modifier = g->natural_light_level( pos().z ) / default_daylight_level(); mod_power_level( units::from_kilojoule( fuel_energy ) * modifier * effective_passive_efficiency ); - } else if( fuel == itype_wind ) { + } else if( fuel == fuel_type_wind ) { int vehwindspeed = 0; const optional_vpart_position vp = g->m.veh_at( pos() ); if( vp ) { @@ -1010,7 +1010,7 @@ itype_id Character::find_remote_fuel( bool look_only ) if( !look_only ) { set_value( "sunlight", "1" ); } - remote_fuel = itype_sun_light; + remote_fuel = fuel_type_sun_light; } if( cable->get_var( "state" ) == "UPS_link" ) { @@ -1028,7 +1028,7 @@ itype_id Character::find_remote_fuel( bool look_only ) set_value( "rem_battery", std::to_string( 0 ) ); } } - remote_fuel = itype_battery; + remote_fuel = fuel_type_battery; } continue; } @@ -1037,10 +1037,10 @@ itype_id Character::find_remote_fuel( bool look_only ) continue; } if( !look_only ) { - set_value( "rem_battery", std::to_string( vp->vehicle().fuel_left( itype_battery, + set_value( "rem_battery", std::to_string( vp->vehicle().fuel_left( fuel_type_battery, true ) ) ); } - remote_fuel = itype_battery; + remote_fuel = fuel_type_battery; } return remote_fuel; @@ -1082,7 +1082,7 @@ int Character::consume_remote_fuel( int amount ) void Character::reset_remote_fuel() { - if( get_bionic_fueled_with( item( itype_sun_light ) ).empty() ) { + if( get_bionic_fueled_with( item( fuel_type_sun_light ) ).empty() ) { remove_value( "sunlight" ); } remove_value( "rem_battery" ); diff --git a/src/bionics_ui.cpp b/src/bionics_ui.cpp index cf45c13ae4e04..aca36b3645c36 100644 --- a/src/bionics_ui.cpp +++ b/src/bionics_ui.cpp @@ -12,6 +12,7 @@ #include "translations.h" #include "options.h" #include "string_id.h" +#include "cata_string_consts.h" // '!', '-' and '=' are uses as default bindings in the menu const invlet_wrapper @@ -66,7 +67,7 @@ static void draw_bionics_titlebar( const catacurses::window &window, player *p, for( const itype_id &fuel : p->get_fuel_available( bio.id ) ) { found_fuel = true; const item temp_fuel( fuel ); - if( temp_fuel.has_flag( "PERPETUAL" ) ) { + if( temp_fuel.has_flag( flag_PERPETUAL ) ) { if( fuel == itype_id( "sunlight" ) && !g->is_in_sunlight( p->pos() ) ) { continue; } @@ -80,7 +81,7 @@ static void draw_bionics_titlebar( const catacurses::window &window, player *p, const itype_id rem_fuel = p->find_remote_fuel( true ); if( !rem_fuel.empty() ) { const item tmp_rem_fuel( rem_fuel ); - if( tmp_rem_fuel.has_flag( "PERPETUAL" ) ) { + if( tmp_rem_fuel.has_flag( flag_PERPETUAL ) ) { fuel_string += colorize( tmp_rem_fuel.tname(), c_green ) + " "; } else { fuel_string += tmp_rem_fuel.tname() + ": " + colorize( p->get_value( "rem_" + rem_fuel ), @@ -171,7 +172,7 @@ static std::string build_bionic_poweronly_string( const bionic &bio ) if( bio.incapacitated_time > 0_turns ) { properties.push_back( _( "(incapacitated)" ) ); } - if( !bio.has_flag( "SAFE_FUEL_OFF" ) && ( !bio.info().fuel_opts.empty() || + if( !bio.has_flag( flag_SAFE_FUEL_OFF ) && ( !bio.info().fuel_opts.empty() || bio.info().is_remote_fueled ) ) { properties.push_back( _( "(fuel saving ON)" ) ); } diff --git a/src/cata_string_consts.h b/src/cata_string_consts.h index d44d8b00512fa..02d899e5c1d97 100644 --- a/src/cata_string_consts.h +++ b/src/cata_string_consts.h @@ -2,137 +2,162 @@ #ifndef STRING_CONSTS_H #define STRING_CONSTS_H -static const activity_id ACT_BURROW( "ACT_BURROW" ); -static const activity_id ACT_CRAFT( "ACT_CRAFT" ); -static const activity_id ACT_FILL_LIQUID( "ACT_FILL_LIQUID" ); -static const activity_id ACT_PICKAXE( "ACT_PICKAXE" ); -static const activity_id ACT_DROP( "ACT_DROP" ); -static const activity_id ACT_STASH( "ACT_STASH" ); -static const activity_id ACT_PULP( "ACT_PULP" ); -static const activity_id ACT_GAME( "ACT_GAME" ); -static const activity_id ACT_GENERIC_GAME( "ACT_GENERIC_GAME" ); -static const activity_id ACT_START_FIRE( "ACT_START_FIRE" ); -static const activity_id ACT_VIBE( "ACT_VIBE" ); -static const activity_id ACT_HAND_CRANK( "ACT_HAND_CRANK" ); -static const activity_id ACT_OXYTORCH( "ACT_OXYTORCH" ); -static const activity_id ACT_AIM( "ACT_AIM" ); -static const activity_id ACT_WEAR( "ACT_WEAR" ); -static const activity_id ACT_MULTIPLE_FISH( "ACT_MULTIPLE_FISH" ); -static const activity_id ACT_MULTIPLE_CONSTRUCTION( "ACT_MULTIPLE_CONSTRUCTION" ); -static const activity_id ACT_MULTIPLE_BUTCHER( "ACT_MULTIPLE_BUTCHER" ); -static const activity_id ACT_MULTIPLE_FARM( "ACT_MULTIPLE_FARM" ); -static const activity_id ACT_FETCH_REQUIRED( "ACT_FETCH_REQUIRED" ); -static const activity_id ACT_BUILD( "ACT_BUILD" ); -static const activity_id ACT_EAT_MENU( "ACT_EAT_MENU" ); -static const activity_id ACT_VEHICLE_DECONSTRUCTION( "ACT_VEHICLE_DECONSTRUCTION" ); -static const activity_id ACT_VEHICLE_REPAIR( "ACT_VEHICLE_REPAIR" ); -static const activity_id ACT_MULTIPLE_CHOP_TREES( "ACT_MULTIPLE_CHOP_TREES" ); -static const activity_id ACT_CONSUME_FOOD_MENU( "ACT_CONSUME_FOOD_MENU" ); -static const activity_id ACT_CONSUME_DRINK_MENU( "ACT_CONSUME_DRINK_MENU" ); -static const activity_id ACT_CONSUME_MEDS_MENU( "ACT_CONSUME_MEDS_MENU" ); -static const activity_id ACT_MOVE_ITEMS( "ACT_MOVE_ITEMS" ); -static const activity_id ACT_MOVE_LOOT( "ACT_MOVE_LOOT" ); +#include "type_id.h" +#include "player_activity.h" + + static const activity_id ACT_ADV_INVENTORY( "ACT_ADV_INVENTORY" ); +static const activity_id ACT_AIM( "ACT_AIM" ); static const activity_id ACT_ARMOR_LAYERS( "ACT_ARMOR_LAYERS" ); static const activity_id ACT_ATM( "ACT_ATM" ); -static const activity_id ACT_CRACKING( "ACT_CRACKING" ); -static const activity_id ACT_FISH( "ACT_FISH" ); -static const activity_id ACT_REPAIR_ITEM( "ACT_REPAIR_ITEM" ); +static const activity_id ACT_AUTODRIVE( "ACT_AUTODRIVE" ); +static const activity_id ACT_BUILD( "ACT_BUILD" ); +static const activity_id ACT_BURROW( "ACT_BURROW" ); static const activity_id ACT_BUTCHER( "ACT_BUTCHER" ); static const activity_id ACT_BUTCHER_FULL( "ACT_BUTCHER_FULL" ); -static const activity_id ACT_TRAVELLING( "ACT_TRAVELLING" ); -static const activity_id ACT_AUTODRIVE( "ACT_AUTODRIVE" ); -static const activity_id ACT_FIELD_DRESS( "ACT_FIELD_DRESS" ); -static const activity_id ACT_SKIN( "ACT_SKIN" ); -static const activity_id ACT_QUARTER( "ACT_QUARTER" ); -static const activity_id ACT_DISMEMBER( "ACT_DISMEMBER" ); -static const activity_id ACT_DISSECT( "ACT_DISSECT" ); -static const activity_id ACT_HACKSAW( "ACT_HACKSAW" ); -static const activity_id ACT_CHOP_TREE( "ACT_CHOP_TREE" ); static const activity_id ACT_CHOP_LOGS( "ACT_CHOP_LOGS" ); -static const activity_id ACT_TIDY_UP( "ACT_TIDY_UP" ); static const activity_id ACT_CHOP_PLANKS( "ACT_CHOP_PLANKS" ); -static const activity_id ACT_JACKHAMMER( "ACT_JACKHAMMER" ); -static const activity_id ACT_FIND_MOUNT( "ACT_FIND_MOUNT" ); +static const activity_id ACT_CHOP_TREE( "ACT_CHOP_TREE" ); +static const activity_id ACT_CHURN( "ACT_CHURN" ); +static const activity_id ACT_CLEAR_RUBBLE( "ACT_CLEAR_RUBBLE" ); +static const activity_id ACT_CONSUME_DRINK_MENU( "ACT_CONSUME_DRINK_MENU" ); +static const activity_id ACT_CONSUME_FOOD_MENU( "ACT_CONSUME_FOOD_MENU" ); +static const activity_id ACT_CONSUME_MEDS_MENU( "ACT_CONSUME_MEDS_MENU" ); +static const activity_id ACT_CRACKING( "ACT_CRACKING" ); +static const activity_id ACT_CRAFT( "ACT_CRAFT" ); static const activity_id ACT_DIG( "ACT_DIG" ); static const activity_id ACT_DIG_CHANNEL( "ACT_DIG_CHANNEL" ); -static const activity_id ACT_FILL_PIT( "ACT_FILL_PIT" ); -static const activity_id ACT_MULTIPLE_CHOP_PLANKS( "ACT_MULTIPLE_CHOP_PLANKS" ); +static const activity_id ACT_DISASSEMBLE( "ACT_DISASSEMBLE" ); +static const activity_id ACT_DISMEMBER( "ACT_DISMEMBER" ); +static const activity_id ACT_DISSECT( "ACT_DISSECT" ); +static const activity_id ACT_DROP( "ACT_DROP" ); +static const activity_id ACT_EAT_MENU( "ACT_EAT_MENU" ); static const activity_id ACT_FERTILIZE_PLOT( "ACT_FERTILIZE_PLOT" ); -static const activity_id ACT_TRY_SLEEP( "ACT_TRY_SLEEP" ); -static const activity_id ACT_OPERATION( "ACT_OPERATION" ); -static const activity_id ACT_ROBOT_CONTROL( "ACT_ROBOT_CONTROL" ); -static const activity_id ACT_TREE_COMMUNION( "ACT_TREE_COMMUNION" ); -static const activity_id ACT_READ( "ACT_READ" ); -static const activity_id ACT_WAIT_STAMINA( "ACT_WAIT_STAMINA" ); -static const activity_id ACT_STUDY_SPELL( "ACT_STUDY_SPELL" ); -static const activity_id ACT_PICKUP( "ACT_PICKUP" ); +static const activity_id ACT_FETCH_REQUIRED( "ACT_FETCH_REQUIRED" ); +static const activity_id ACT_FIELD_DRESS( "ACT_FIELD_DRESS" ); +static const activity_id ACT_FILL_LIQUID( "ACT_FILL_LIQUID" ); +static const activity_id ACT_FILL_PIT( "ACT_FILL_PIT" ); +static const activity_id ACT_FIND_MOUNT( "ACT_FIND_MOUNT" ); static const activity_id ACT_FIRSTAID( "ACT_FIRSTAID" ); +static const activity_id ACT_FISH( "ACT_FISH" ); static const activity_id ACT_FORAGE( "ACT_FORAGE" ); +static const activity_id ACT_GAME( "ACT_GAME" ); +static const activity_id ACT_GENERIC_GAME( "ACT_GENERIC_GAME" ); +static const activity_id ACT_GUNMOD_ADD( "ACT_GUNMOD_ADD" ); +static const activity_id ACT_HACKING( "ACT_HACKING" ); +static const activity_id ACT_HACKSAW( "ACT_HACKSAW" ); +static const activity_id ACT_HAIRCUT( "ACT_HAIRCUT" ); +static const activity_id ACT_HAND_CRANK( "ACT_HAND_CRANK" ); +static const activity_id ACT_HEATING( "ACT_HEATING" ); static const activity_id ACT_HOTWIRE_CAR( "ACT_HOTWIRE_CAR" ); +static const activity_id ACT_JACKHAMMER( "ACT_JACKHAMMER" ); static const activity_id ACT_LONGSALVAGE( "ACT_LONGSALVAGE" ); static const activity_id ACT_MAKE_ZLAVE( "ACT_MAKE_ZLAVE" ); +static const activity_id ACT_MEDITATE( "ACT_MEDITATE" ); +static const activity_id ACT_MEND_ITEM( "ACT_MEND_ITEM" ); +static const activity_id ACT_MIND_SPLICER( "ACT_MIND_SPLICER" ); +static const activity_id ACT_MOVE_ITEMS( "ACT_MOVE_ITEMS" ); +static const activity_id ACT_MOVE_LOOT( "ACT_MOVE_LOOT" ); +static const activity_id ACT_MULTIPLE_BUTCHER( "ACT_MULTIPLE_BUTCHER" ); +static const activity_id ACT_MULTIPLE_CHOP_PLANKS( "ACT_MULTIPLE_CHOP_PLANKS" ); +static const activity_id ACT_MULTIPLE_CHOP_TREES( "ACT_MULTIPLE_CHOP_TREES" ); +static const activity_id ACT_MULTIPLE_CONSTRUCTION( "ACT_MULTIPLE_CONSTRUCTION" ); +static const activity_id ACT_MULTIPLE_FARM( "ACT_MULTIPLE_FARM" ); +static const activity_id ACT_MULTIPLE_FISH( "ACT_MULTIPLE_FISH" ); +static const activity_id ACT_NULL( "ACT_NULL" ); +static const activity_id ACT_OPEN_GATE( "ACT_OPEN_GATE" ); +static const activity_id ACT_OPERATION( "ACT_OPERATION" ); +static const activity_id ACT_OXYTORCH( "ACT_OXYTORCH" ); +static const activity_id ACT_PICKAXE( "ACT_PICKAXE" ); +static const activity_id ACT_PICKUP( "ACT_PICKUP" ); +static const activity_id ACT_PLAY_WITH_PET( "ACT_PLAY_WITH_PET" ); +static const activity_id ACT_PULP( "ACT_PULP" ); +static const activity_id ACT_QUARTER( "ACT_QUARTER" ); +static const activity_id ACT_READ( "ACT_READ" ); static const activity_id ACT_RELOAD( "ACT_RELOAD" ); -static const activity_id ACT_TRAIN( "ACT_TRAIN" ); -static const activity_id ACT_CHURN( "ACT_CHURN" ); -static const activity_id ACT_VEHICLE( "ACT_VEHICLE" ); +static const activity_id ACT_REPAIR_ITEM( "ACT_REPAIR_ITEM" ); +static const activity_id ACT_ROBOT_CONTROL( "ACT_ROBOT_CONTROL" ); +static const activity_id ACT_SHAVE( "ACT_SHAVE" ); +static const activity_id ACT_SKIN( "ACT_SKIN" ); +static const activity_id ACT_SOCIALIZE( "ACT_SOCIALIZE" ); +static const activity_id ACT_SPELLCASTING( "ACT_SPELLCASTING" ); static const activity_id ACT_START_ENGINES( "ACT_START_ENGINES" ); -static const activity_id ACT_OPEN_GATE( "ACT_OPEN_GATE" ); -static const activity_id ACT_HEATING( "ACT_HEATING" ); -static const activity_id ACT_MEND_ITEM( "ACT_MEND_ITEM" ); -static const activity_id ACT_GUNMOD_ADD( "ACT_GUNMOD_ADD" ); +static const activity_id ACT_START_FIRE( "ACT_START_FIRE" ); +static const activity_id ACT_STASH( "ACT_STASH" ); +static const activity_id ACT_STUDY_SPELL( "ACT_STUDY_SPELL" ); +static const activity_id ACT_TIDY_UP( "ACT_TIDY_UP" ); static const activity_id ACT_TOOLMOD_ADD( "ACT_TOOLMOD_ADD" ); -static const activity_id ACT_MEDITATE( "ACT_MEDITATE" ); -static const activity_id ACT_SPELLCASTING( "ACT_SPELLCASTING" ); -static const activity_id ACT_HACKING( "ACT_HACKING" ); -static const activity_id ACT_CLEAR_RUBBLE( "ACT_CLEAR_RUBBLE" ); +static const activity_id ACT_TRAIN( "ACT_TRAIN" ); +static const activity_id ACT_TRAVELLING( "ACT_TRAVELLING" ); +static const activity_id ACT_TREE_COMMUNION( "ACT_TREE_COMMUNION" ); +static const activity_id ACT_TRY_SLEEP( "ACT_TRY_SLEEP" ); +static const activity_id ACT_UNLOAD_MAG( "ACT_TRAIN" ); +static const activity_id ACT_VEHICLE( "ACT_VEHICLE" ); +static const activity_id ACT_VEHICLE_DECONSTRUCTION( "ACT_VEHICLE_DECONSTRUCTION" ); +static const activity_id ACT_VEHICLE_REPAIR( "ACT_VEHICLE_REPAIR" ); +static const activity_id ACT_VIBE( "ACT_VIBE" ); static const activity_id ACT_WAIT( "ACT_WAIT" ); -static const activity_id ACT_WAIT_WEATHER( "ACT_WAIT_WEATHER" ); static const activity_id ACT_WAIT_NPC( "ACT_WAIT_NPC" ); -static const activity_id ACT_SOCIALIZE( "ACT_SOCIALIZE" ); -static const activity_id ACT_DISASSEMBLE( "ACT_DISASSEMBLE" ); +static const activity_id ACT_WAIT_STAMINA( "ACT_WAIT_STAMINA" ); +static const activity_id ACT_WAIT_WEATHER( "ACT_WAIT_WEATHER" ); static const activity_id ACT_WASH( "ACT_WASH" ); -static const activity_id ACT_PLAY_WITH_PET( "ACT_PLAY_WITH_PET" ); -static const activity_id ACT_SHAVE( "ACT_SHAVE" ); -static const activity_id ACT_HAIRCUT( "ACT_HAIRCUT" ); -static const activity_id ACT_UNLOAD_MAG( "ACT_UNLOAD_MAG" ); -static const activity_id ACT_MIND_SPLICER( "ACT_MIND_SPLICER" ); +static const activity_id ACT_WEAR( "ACT_WEAR" ); + static const bionic_id bio_adrenaline( "bio_adrenaline" ); static const bionic_id bio_ads( "bio_ads" ); static const bionic_id bio_advreactor( "bio_advreactor" ); +static const bionic_id bio_alarm( "bio_alarm" ); +static const bionic_id bio_ankles( "bio_ankles" ); static const bionic_id bio_armor_arms( "bio_armor_arms" ); static const bionic_id bio_armor_eyes( "bio_armor_eyes" ); static const bionic_id bio_armor_head( "bio_armor_head" ); static const bionic_id bio_armor_legs( "bio_armor_legs" ); static const bionic_id bio_armor_torso( "bio_armor_torso" ); +static const bionic_id bio_batteries( "bio_batteries" ); +static const bionic_id bio_blade( "bio_blade" ); static const bionic_id bio_blade_weapon( "bio_blade_weapon" ); static const bionic_id bio_blaster( "bio_blaster" ); +static const bionic_id bio_blindfold( "bio_blindfold" ); static const bionic_id bio_blood_anal( "bio_blood_anal" ); static const bionic_id bio_blood_filter( "bio_blood_filter" ); static const bionic_id bio_carbon( "bio_carbon" ); +static const bionic_id bio_claws( "bio_claws" ); static const bionic_id bio_claws_weapon( "bio_claws_weapon" ); static const bionic_id bio_climate( "bio_climate" ); static const bionic_id bio_cloak( "bio_cloak" ); static const bionic_id bio_cqb( "bio_cqb" ); +static const bionic_id bio_deformity( "bio_deformity" ); static const bionic_id bio_digestion( "bio_digestion" ); +static const bionic_id bio_dis_acid( "bio_dis_acid" ); +static const bionic_id bio_dis_shock( "bio_dis_shock" ); +static const bionic_id bio_drain( "bio_drain" ); static const bionic_id bio_earplugs( "bio_earplugs" ); static const bionic_id bio_ears( "bio_ears" ); static const bionic_id bio_emp( "bio_emp" ); static const bionic_id bio_evap( "bio_evap" ); static const bionic_id bio_eye_optic( "bio_eye_optic" ); +static const bionic_id bio_face_mask( "bio_face_mask" ); static const bionic_id bio_faraday( "bio_faraday" ); +static const bionic_id bio_fingerhack( "bio_fingerhack" ); static const bionic_id bio_flashbang( "bio_flashbang" ); static const bionic_id bio_flashlight( "bio_flashlight" ); static const bionic_id bio_furnace( "bio_furnace" ); -static const bionic_id bio_ground_sonar( "bio_ground_sonar" ); static const bionic_id bio_geiger( "bio_geiger" ); static const bionic_id bio_gills( "bio_gills" ); +static const bionic_id bio_glowy( "bio_glowy" ); +static const bionic_id bio_ground_sonar( "bio_ground_sonar" ); +static const bionic_id bio_heat_absorb( "bio_heat_absorb" ); static const bionic_id bio_heatsink( "bio_heatsink" ); static const bionic_id bio_hydraulics( "bio_hydraulics" ); +static const bionic_id bio_infrared( "bio_infrared" ); +static const bionic_id bio_itchy( "bio_itchy" ); static const bionic_id bio_jointservo( "bio_jointservo" ); static const bionic_id bio_laser( "bio_laser" ); +static const bionic_id bio_leaky( "bio_leaky" ); +static const bionic_id bio_leukocyte( "bio_leukocyte" ); static const bionic_id bio_lighter( "bio_lighter" ); +static const bionic_id bio_lightning( "bio_chain_lightning" ); static const bionic_id bio_lockpick( "bio_lockpick" ); static const bionic_id bio_magnet( "bio_magnet" ); static const bionic_id bio_membrane( "bio_membrane" ); @@ -140,32 +165,54 @@ static const bionic_id bio_memory( "bio_memory" ); static const bionic_id bio_meteorologist( "bio_meteorologist" ); static const bionic_id bio_nanobots( "bio_nanobots" ); static const bionic_id bio_night( "bio_night" ); +static const bionic_id bio_night_vision( "bio_night_vision" ); +static const bionic_id bio_noise( "bio_noise" ); +static const bionic_id bio_ods( "bio_ods" ); static const bionic_id bio_painkiller( "bio_painkiller" ); +static const bionic_id bio_plut_filter( "bio_plut_filter" ); +static const bionic_id bio_plutdump( "bio_plutdump" ); +static const bionic_id bio_plutfilter( "bio_plutfilter" ); +static const bionic_id bio_power_storage( "bio_power_storage" ); +static const bionic_id bio_power_storage_mkII( "bio_power_storage_mkII" ); +static const bionic_id bio_power_weakness( "bio_power_weakness" ); +static const bionic_id bio_probability_travel( "bio_probability_travel" ); static const bionic_id bio_radscrubber( "bio_radscrubber" ); +static const bionic_id bio_railgun( "bio_railgun" ); +static const bionic_id bio_razors( "bio_razors" ); static const bionic_id bio_reactor( "bio_reactor" ); static const bionic_id bio_recycler( "bio_recycler" ); static const bionic_id bio_remote( "bio_remote" ); static const bionic_id bio_resonator( "bio_resonator" ); +static const bionic_id bio_scent_mask( "bio_scent_mask" ); +static const bionic_id bio_scent_vision( "bio_scent_vision" ); +static const bionic_id bio_shakes( "bio_shakes" ); +static const bionic_id bio_shock( "bio_shock" ); +static const bionic_id bio_shock_absorber( "bio_shock_absorber" ); static const bionic_id bio_shockwave( "bio_shockwave" ); +static const bionic_id bio_sleepy( "bio_sleepy" ); static const bionic_id bio_soporific( "bio_soporific" ); +static const bionic_id bio_spasm( "bio_spasm" ); static const bionic_id bio_speed( "bio_speed" ); +static const bionic_id bio_storage( "bio_storage" ); +static const bionic_id bio_sunglasses( "bio_sunglasses" ); static const bionic_id bio_synaptic_regen( "bio_synaptic_regen" ); static const bionic_id bio_syringe( "bio_syringe" ); -static const bionic_id bio_power_storage( "bio_power_storage" ); -static const bionic_id bio_power_storage_mkII( "bio_power_storage_mkII" ); -static const bionic_id bio_plutdump( "bio_plutdump" ); +static const bionic_id bio_targeting( "bio_targeting" ); static const bionic_id bio_taste_blocker( "bio_taste_blocker" ); static const bionic_id bio_tattoo_led( "bio_tattoo_led" ); static const bionic_id bio_teleport( "bio_teleport" ); static const bionic_id bio_time_freeze( "bio_time_freeze" ); static const bionic_id bio_tools( "bio_tools" ); -static const bionic_id bionic_TOOLS_EXTEND( "bio_tools_extend" ); static const bionic_id bio_torsionratchet( "bio_torsionratchet" ); -static const bionic_id bio_ups( "bio_ups" ); +static const bionic_id bio_trip( "bio_trip" ); static const bionic_id bio_uncanny_dodge( "bio_uncanny_dodge" ); +static const bionic_id bio_ups( "bio_ups" ); +static const bionic_id bio_voice( "bio_voice" ); static const bionic_id bio_watch( "bio_watch" ); static const bionic_id bio_water_extractor( "bio_water_extractor" ); - +static const bionic_id bionic_TOOLS_EXTEND( "bio_tools_extend" ); +static const bionic_id str_bio_cloak( "bio_cloak" ); +static const bionic_id str_bio_night( "bio_night" ); // Aftershock stuff! static const bionic_id afs_bio_linguistic_coprocessor( "afs_bio_linguistic_coprocessor" ); static const bionic_id afs_bio_dopamine_stimulators( "afs_bio_dopamine_stimulators" ); @@ -173,9 +220,19 @@ static const bionic_id afs_bio_dopamine_stimulators( "afs_bio_dopamine_stimulato static const efftype_id effect_adrenaline( "adrenaline" ); static const efftype_id effect_adrenaline_mycus( "adrenaline_mycus" ); static const efftype_id effect_alarm_clock( "alarm_clock" ); +static const efftype_id effect_allow_sleep( "allow_sleep" ); static const efftype_id effect_amigara( "amigara" ); -static const efftype_id effect_asthma( "asthma" ); +static const efftype_id effect_antibiotic( "antibiotic" ); +static const efftype_id effect_antibiotic_visible( "antibiotic_visible" ); +static const efftype_id effect_asked_for_item( "asked_for_item" ); +static const efftype_id effect_asked_personal_info( "asked_personal_info" ); +static const efftype_id effect_asked_to_follow( "asked_to_follow" ); +static const efftype_id effect_asked_to_lead( "asked_to_lead" ); +static const efftype_id effect_asked_to_train( "asked_to_train" ); static const efftype_id effect_assisted( "assisted" ); +static const efftype_id effect_asthma( "asthma" ); +static const efftype_id effect_attention( "attention" ); +static const efftype_id effect_badpoison( "badpoison" ); static const efftype_id effect_bandaged( "bandaged" ); static const efftype_id effect_beartrap( "beartrap" ); static const efftype_id effect_bite( "bite" ); @@ -184,7 +241,10 @@ static const efftype_id effect_blind( "blind" ); static const efftype_id effect_blisters( "blisters" ); static const efftype_id effect_bloodworms( "bloodworms" ); static const efftype_id effect_boomered( "boomered" ); +static const efftype_id effect_bouldering( "bouldering" ); +static const efftype_id effect_bounced( "bounced" ); static const efftype_id effect_brainworms( "brainworms" ); +static const efftype_id effect_catch_up( "catch_up" ); static const efftype_id effect_cig( "cig" ); static const efftype_id effect_cold( "cold" ); static const efftype_id effect_common_cold( "common_cold" ); @@ -192,102 +252,182 @@ static const efftype_id effect_contacts( "contacts" ); static const efftype_id effect_controlled( "controlled" ); static const efftype_id effect_corroding( "corroding" ); static const efftype_id effect_cough_suppress( "cough_suppress" ); -static const efftype_id effect_recently_coughed( "recently_coughed" ); +static const efftype_id effect_countdown( "countdown" ); static const efftype_id effect_crushed( "crushed" ); +static const efftype_id effect_cureall( "cureall" ); +static const efftype_id effect_currently_busy( "currently_busy" ); static const efftype_id effect_darkness( "darkness" ); static const efftype_id effect_datura( "datura" ); +static const efftype_id effect_dazed( "dazed" ); static const efftype_id effect_deaf( "deaf" ); static const efftype_id effect_depressants( "depressants" ); static const efftype_id effect_dermatik( "dermatik" ); +static const efftype_id effect_disabled( "disabled" ); static const efftype_id effect_disinfected( "disinfected" ); +static const efftype_id effect_docile( "docile" ); static const efftype_id effect_downed( "downed" ); +static const efftype_id effect_dragging( "dragging" ); static const efftype_id effect_drunk( "drunk" ); static const efftype_id effect_earphones( "earphones" ); +static const efftype_id effect_emp( "emp" ); +static const efftype_id effect_evil( "evil" ); +static const efftype_id effect_fearparalyze( "fearparalyze" ); static const efftype_id effect_flu( "flu" ); +static const efftype_id effect_flushot( "flushot" ); static const efftype_id effect_foodpoison( "foodpoison" ); +static const efftype_id effect_formication( "formication" ); static const efftype_id effect_frostbite( "frostbite" ); static const efftype_id effect_frostbite_recovery( "frostbite_recovery" ); static const efftype_id effect_fungus( "fungus" ); +static const efftype_id effect_gave_quest_item( "gave_quest_item" ); +static const efftype_id effect_glare( "glare" ); static const efftype_id effect_glowing( "glowing" ); +static const efftype_id effect_glowing_led( "glowy_led" ); static const efftype_id effect_glowy_led( "glowy_led" ); static const efftype_id effect_got_checked( "got_checked" ); static const efftype_id effect_grabbed( "grabbed" ); static const efftype_id effect_grabbing( "grabbing" ); +static const efftype_id effect_grown_of_fuse( "grown_of_fuse" ); static const efftype_id effect_hallu( "hallu" ); static const efftype_id effect_happy( "happy" ); static const efftype_id effect_harnessed( "harnessed" ); +static const efftype_id effect_has_bag( "has_bag" ); +static const efftype_id effect_haslight( "haslight" ); static const efftype_id effect_heating_bionic( "heating_bionic" ); static const efftype_id effect_heavysnare( "heavysnare" ); static const efftype_id effect_high( "high" ); +static const efftype_id effect_hit_by_player( "hit_by_player" ); static const efftype_id effect_hot( "hot" ); static const efftype_id effect_hot_speed( "hot_speed" ); -static const efftype_id effect_infected( "infected" ); static const efftype_id effect_in_pit( "in_pit" ); +static const efftype_id effect_infected( "infected" ); +static const efftype_id effect_infection( "infection" ); static const efftype_id effect_iodine( "iodine" ); static const efftype_id effect_irradiated( "irradiated" ); static const efftype_id effect_jetinjector( "jetinjector" ); 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_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" ); +static const efftype_id effect_monster_armor( "monster_armor" ); +static const efftype_id effect_motor_seizure( "motor_seizure" ); +static const efftype_id effect_music( "music" ); static const efftype_id effect_narcosis( "narcosis" ); static const efftype_id effect_nausea( "nausea" ); +static const efftype_id effect_no_ammo( "no_ammo" ); static const efftype_id effect_no_sight( "no_sight" ); +static const efftype_id effect_npc_fire_bad( "npc_fire_bad" ); +static const efftype_id effect_npc_flee_player( "npc_flee_player" ); +static const efftype_id effect_npc_player_looking( "npc_player_still_looking" ); +static const efftype_id effect_npc_run_away( "npc_run_away" ); +static const efftype_id effect_npc_suspend( "npc_suspend" ); +static const efftype_id effect_on_roof( "on_roof" ); static const efftype_id effect_onfire( "onfire" ); static const efftype_id effect_operating( "operating" ); +static const efftype_id effect_pacified( "pacified" ); +static const efftype_id effect_paid( "paid" ); static const efftype_id effect_paincysts( "paincysts" ); -static const efftype_id effect_pet( "pet" ); +static const efftype_id effect_panacea( "panacea" ); +static const efftype_id effect_paralyzepoison( "paralyzepoison" ); static const efftype_id effect_pblue( "pblue" ); +static const efftype_id effect_pet( "pet" ); static const efftype_id effect_pkill( "pkill" ); static const efftype_id effect_pkill_l( "pkill_l" ); static const efftype_id effect_pkill1( "pkill1" ); static const efftype_id effect_pkill2( "pkill2" ); static const efftype_id effect_pkill3( "pkill3" ); +static const efftype_id effect_playing_instrument( "playing_instrument" ); static const efftype_id effect_poison( "poison" ); +static const efftype_id effect_pushed( "pushed" ); +static const efftype_id effect_raising( "raising" ); +static const efftype_id effect_rat( "rat" ); +static const efftype_id effect_recently_coughed( "recently_coughed" ); static const efftype_id effect_recover( "recover" ); static const efftype_id effect_relax_gas( "relax_gas" ); static const efftype_id effect_ridden( "ridden" ); static const efftype_id effect_riding( "riding" ); +static const efftype_id effect_run( "run" ); static const efftype_id effect_sad( "sad" ); +static const efftype_id effect_saddled( "monster_saddled" ); +static const efftype_id effect_sap( "sap" ); +static const efftype_id effect_shakes( "shakes" ); +static const efftype_id effect_shrieking( "shrieking" ); static const efftype_id effect_sleep( "sleep" ); static const efftype_id effect_sleep_deprived( "sleep_deprived" ); static const efftype_id effect_slept_through_alarm( "slept_through_alarm" ); -static const efftype_id effect_shakes( "shakes" ); +static const efftype_id effect_slimed( "slimed" ); +static const efftype_id effect_smoke( "smoke" ); +static const efftype_id effect_snow_glare( "snow_glare" ); +static const efftype_id effect_spores( "spores" ); static const efftype_id effect_stim( "stim" ); static const efftype_id effect_stim_overdose( "stim_overdose" ); +static const efftype_id effect_stimpack( "stimpack" ); +static const efftype_id effect_strong_antibiotic( "strong_antibiotic" ); +static const efftype_id effect_strong_antibiotic_visible( "strong_antibiotic_visible" ); static const efftype_id effect_stung( "stung" ); static const efftype_id effect_stunned( "stunned" ); +static const efftype_id effect_supercharged( "supercharged" ); static const efftype_id effect_tapeworm( "tapeworm" ); +static const efftype_id effect_targeted( "targeted" ); +static const efftype_id effect_teargas( "teargas" ); static const efftype_id effect_teleglow( "teleglow" ); static const efftype_id effect_tetanus( "tetanus" ); static const efftype_id effect_tied( "tied" ); +static const efftype_id effect_took_anticonvulsant_visible( "took_anticonvulsant_visible" ); static const efftype_id effect_took_flumed( "took_flumed" ); static const efftype_id effect_took_prozac( "took_prozac" ); static const efftype_id effect_took_prozac_bad( "took_prozac_bad" ); +static const efftype_id effect_took_prozac_visible( "took_prozac_visible" ); +static const efftype_id effect_took_thorazine( "took_thorazine" ); +static const efftype_id effect_took_thorazine_bad( "took_thorazine_bad" ); static const efftype_id effect_took_xanax( "took_xanax" ); +static const efftype_id effect_took_xanax_visible( "took_xanax_visible" ); +static const efftype_id effect_toxin_buildup( "toxin_buildup" ); static const efftype_id effect_under_op( "under_operation" ); +static const efftype_id effect_valium( "valium" ); +static const efftype_id effect_visuals( "visuals" ); +static const efftype_id effect_was_laserlocked( "was_laserlocked" ); +static const efftype_id effect_weak_antibiotic( "weak_antibiotic" ); +static const efftype_id effect_weak_antibiotic_visible( "weak_antibiotic_visible" ); static const efftype_id effect_webbed( "webbed" ); static const efftype_id effect_weed_high( "weed_high" ); static const efftype_id effect_winded( "winded" ); -static const efftype_id effect_visuals( "visuals" ); +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" ); static const trait_id trait_ADRENALINE( "ADRENALINE" ); +static const trait_id trait_ALBINO( "ALBINO" ); +static const trait_id trait_ALCMET( "ALCMET" ); static const trait_id trait_AMORPHOUS( "AMORPHOUS" ); +static const trait_id trait_ANIMALDISCORD( "ANIMALDISCORD" ); +static const trait_id trait_ANIMALDISCORD2( "ANIMALDISCORD2" ); +static const trait_id trait_ANIMALEMPATH( "ANIMALEMPATH" ); +static const trait_id trait_ANIMALEMPATH2( "ANIMALEMPATH2" ); +static const trait_id trait_ANTENNAE( "ANTENNAE" ); static const trait_id trait_ANTIFRUIT( "ANTIFRUIT" ); static const trait_id trait_ANTIJUNK( "ANTIJUNK" ); static const trait_id trait_ANTIWHEAT( "ANTIWHEAT" ); -static const trait_id trait_ANTENNAE( "ANTENNAE" ); static const trait_id trait_ANTLERS( "ANTLERS" ); static const trait_id trait_ARACHNID_ARMS( "ARACHNID_ARMS" ); static const trait_id trait_ARACHNID_ARMS_OK( "ARACHNID_ARMS_OK" ); +static const trait_id trait_ARM_TENTACLES( "ARM_TENTACLES" ); +static const trait_id trait_ARM_TENTACLES_4( "ARM_TENTACLES_4" ); +static const trait_id trait_ARM_TENTACLES_8( "ARM_TENTACLES_8" ); +static const trait_id trait_ASTHMA( "ASTHMA" ); static const trait_id trait_BADBACK( "BADBACK" ); +static const trait_id trait_BADKNEES( "BADKNEES" ); +static const trait_id trait_BADTEMPER( "BADTEMPER" ); static const trait_id trait_BARK( "BARK" ); static const trait_id trait_BEAK_HUM( "BEAK_HUM" ); +static const trait_id trait_BEAK_PECK( "BEAK_PECK" ); +static const trait_id trait_BEE( "BEE" ); static const trait_id trait_BIRD_EYE( "BIRD_EYE" ); static const trait_id trait_BURROW( "BURROW" ); static const trait_id trait_CANNIBAL( "CANNIBAL" ); @@ -296,41 +436,62 @@ static const trait_id trait_CENOBITE( "CENOBITE" ); static const trait_id trait_CEPH_EYES( "CEPH_EYES" ); static const trait_id trait_CEPH_VISION( "CEPH_VISION" ); static const trait_id trait_CF_HAIR( "CF_HAIR" ); -static const trait_id trait_CHITIN2( "CHITIN2" ); -static const trait_id trait_CHITIN3( "CHITIN3" ); +static const trait_id trait_CHAOTIC( "CHAOTIC" ); +static const trait_id trait_CHAOTIC_BAD( "CHAOTIC_BAD" ); +static const trait_id trait_CHEMIMBALANCE( "CHEMIMBALANCE" ); static const trait_id trait_CHITIN_FUR( "CHITIN_FUR" ); static const trait_id trait_CHITIN_FUR2( "CHITIN_FUR2" ); static const trait_id trait_CHITIN_FUR3( "CHITIN_FUR3" ); +static const trait_id trait_CHITIN2( "CHITIN2" ); +static const trait_id trait_CHITIN3( "CHITIN3" ); static const trait_id trait_CHLOROMORPH( "CHLOROMORPH" ); +static const trait_id trait_CLAWS( "CLAWS" ); +static const trait_id trait_CLAWS_RAT( "CLAWS_RAT" ); +static const trait_id trait_CLAWS_RETRACT( "CLAWS_RETRACT" ); +static const trait_id trait_CLAWS_ST( "CLAWS_ST" ); +static const trait_id trait_CLAWS_TENTACLE( "CLAWS_TENTACLE" ); static const trait_id trait_CLUMSY( "CLUMSY" ); static const trait_id trait_COLDBLOOD4( "COLDBLOOD4" ); static const trait_id trait_COMPOUND_EYES( "COMPOUND_EYES" ); static const trait_id trait_DEAF( "DEAF" ); static const trait_id trait_DEBUG_BIONIC_POWER( "DEBUG_BIONIC_POWER" ); +static const trait_id trait_DEBUG_BIONIC_POWERGEN( "DEBUG_BIONIC_POWERGEN" ); static const trait_id trait_DEBUG_BIONICS( "DEBUG_BIONICS" ); static const trait_id trait_DEBUG_CLOAK( "DEBUG_CLOAK" ); +static const trait_id trait_DEBUG_HS( "DEBUG_HS" ); +static const trait_id trait_DEBUG_LS( "DEBUG_LS" ); +static const trait_id trait_DEBUG_MIND_CONTROL( "DEBUG_MIND_CONTROL" ); static const trait_id trait_DEBUG_NIGHTVISION( "DEBUG_NIGHTVISION" ); static const trait_id trait_DEBUG_NODMG( "DEBUG_NODMG" ); +static const trait_id trait_DEBUG_NOSCENT( "DEBUG_NOSCENT" ); static const trait_id trait_DEBUG_NOTEMP( "DEBUG_NOTEMP" ); -static const trait_id trait_DEBUG_HS( "DEBUG_HS" ); -static const trait_id trait_DEBUG_LS( "DEBUG_LS" ); +static const trait_id trait_DEBUG_SILENT( "DEBUG_SILENT" ); +static const trait_id trait_DEBUG_STORAGE( "DEBUG_STORAGE" ); static const trait_id trait_DEFT( "DEFT" ); +static const trait_id trait_DEX_ALPHA( "DEX_ALPHA" ); static const trait_id trait_DISORGANIZED( "DISORGANIZED" ); static const trait_id trait_DISRESISTANT( "DISRESISTANT" ); static const trait_id trait_DOWN( "DOWN" ); +static const trait_id trait_DRUNKEN( "DRUNKEN" ); static const trait_id trait_EASYSLEEPER( "EASYSLEEPER" ); static const trait_id trait_EASYSLEEPER2( "EASYSLEEPER2" ); static const trait_id trait_EATDEAD( "EATDEAD" ); static const trait_id trait_EATHEALTH( "EATHEALTH" ); static const trait_id trait_EATPOISON( "EATPOISON" ); static const trait_id trait_ELECTRORECEPTORS( "ELECTRORECEPTORS" ); +static const trait_id trait_ELFA_EARS( "ELFA_EARS" ); static const trait_id trait_ELFA_FNV( "ELFA_FNV" ); static const trait_id trait_ELFA_NV( "ELFA_NV" ); static const trait_id trait_FANGS_SPIDER( "FANGS_SPIDER" ); +static const trait_id trait_FASTHEALER( "FASTHEALER" ); +static const trait_id trait_FASTHEALER2( "FASTHEALER2" ); static const trait_id trait_FASTLEARNER( "FASTLEARNER" ); static const trait_id trait_FAT( "FAT" ); +static const trait_id trait_FEATHERS( "FEATHERS" ); static const trait_id trait_FEL_NV( "FEL_NV" ); static const trait_id trait_FELINE_FUR( "FELINE_FUR" ); +static const trait_id trait_FLOWERS( "FLOWERS" ); +static const trait_id trait_FRESHWATEROSMOSIS( "FRESHWATEROSMOSIS" ); static const trait_id trait_FUR( "FUR" ); static const trait_id trait_GILLS( "GILLS" ); static const trait_id trait_GILLS_CEPH( "GILLS_CEPH" ); @@ -338,57 +499,94 @@ static const trait_id trait_GIZZARD( "GIZZARD" ); static const trait_id trait_GLASSJAW( "GLASSJAW" ); static const trait_id trait_GOURMAND( "GOURMAND" ); static const trait_id trait_GRAZER( "GRAZER" ); +static const trait_id trait_HALLUCINATION( "HALLUCINATION" ); static const trait_id trait_HATES_BOOKS( "HATES_BOOKS" ); -static const trait_id trait_HIBERNATE( "HIBERNATE" ); static const trait_id trait_HEAVYSLEEPER( "HEAVYSLEEPER" ); static const trait_id trait_HEAVYSLEEPER2( "HEAVYSLEEPER2" ); static const trait_id trait_HERBIVORE( "HERBIVORE" ); -static const trait_id trait_HOOVES( "HOOVES" ); -static const trait_id trait_HORNS_POINTED( "HORNS_POINTED" ); +static const trait_id trait_HIBERNATE( "HIBERNATE" ); static const trait_id trait_HOARDER( "HOARDER" ); static const trait_id trait_HOLLOW_BONES( "HOLLOW_BONES" ); +static const trait_id trait_HOOVES( "HOOVES" ); +static const trait_id trait_HORNS_POINTED( "HORNS_POINTED" ); static const trait_id trait_HUGE( "HUGE" ); static const trait_id trait_HUGE_OK( "HUGE_OK" ); static const trait_id trait_HYPEROPIC( "HYPEROPIC" ); static const trait_id trait_ILLITERATE( "ILLITERATE" ); static const trait_id trait_INFIMMUNE( "INFIMMUNE" ); +static const trait_id trait_INFRARED( "INFRARED" ); +static const trait_id trait_INFRESIST( "INFRESIST" ); static const trait_id trait_INSECT_ARMS( "INSECT_ARMS" ); static const trait_id trait_INSECT_ARMS_OK( "INSECT_ARMS_OK" ); static const trait_id trait_INSOMNIA( "INSOMNIA" ); +static const trait_id trait_INT_ALPHA( "INT_ALPHA" ); static const trait_id trait_INT_SLIME( "INT_SLIME" ); +static const trait_id trait_JITTERY( "JITTERY" ); +static const trait_id trait_KILLER( "KILLER" ); static const trait_id trait_LACTOSE( "LACTOSE" ); static const trait_id trait_LARGE( "LARGE" ); static const trait_id trait_LARGE_OK( "LARGE_OK" ); -static const trait_id trait_LEG_TENTACLES( "LEG_TENTACLES" ); +static const trait_id trait_LEAVES( "LEAVES" ); +static const trait_id trait_LEAVES2( "LEAVES2" ); +static const trait_id trait_LEAVES3( "LEAVES3" ); static const trait_id trait_LEG_TENT_BRACE( "LEG_TENT_BRACE" ); +static const trait_id trait_LEG_TENTACLES( "LEG_TENTACLES" ); static const trait_id trait_LIGHT_BONES( "LIGHT_BONES" ); static const trait_id trait_LIGHTFUR( "LIGHTFUR" ); static const trait_id trait_LIGHTSTEP( "LIGHTSTEP" ); +static const trait_id trait_LIGHTWEIGHT( "LIGHTWEIGHT" ); +static const trait_id trait_LIZ_IR( "LIZ_IR" ); static const trait_id trait_LOVES_BOOKS( "LOVES_BOOKS" ); static const trait_id trait_LUPINE_FUR( "LUPINE_FUR" ); +static const trait_id trait_M_BLOOM( "M_BLOOM" ); +static const trait_id trait_M_BLOSSOMS( "M_BLOSSOMS" ); +static const trait_id trait_M_DEFENDER( "M_DEFENDER" ); +static const trait_id trait_M_DEPENDENT( "M_DEPENDENT" ); +static const trait_id trait_M_FERTILE( "M_FERTILE" ); +static const trait_id trait_M_IMMUNE( "M_IMMUNE" ); +static const trait_id trait_M_PROVENANCE( "M_PROVENANCE" ); +static const trait_id trait_M_SKIN2( "M_SKIN2" ); +static const trait_id trait_M_SKIN3( "M_SKIN3" ); +static const trait_id trait_M_SPORES( "M_SPORES" ); static const trait_id trait_MANDIBLES( "MANDIBLES" ); +static const trait_id trait_MARLOSS( "MARLOSS" ); +static const trait_id trait_MARLOSS_AVOID( "MARLOSS_AVOID" ); +static const trait_id trait_MARLOSS_BLUE( "MARLOSS_BLUE" ); +static const trait_id trait_MARLOSS_YELLOW( "MARLOSS_YELLOW" ); static const trait_id trait_MASOCHIST( "MASOCHIST" ); static const trait_id trait_MASOCHIST_MED( "MASOCHIST_MED" ); static const trait_id trait_MEATARIAN( "MEATARIAN" ); static const trait_id trait_MEMBRANE( "MEMBRANE" ); +static const trait_id trait_MOODSWINGS( "MOODSWINGS" ); static const trait_id trait_MOREPAIN( "MORE_PAIN" ); static const trait_id trait_MOREPAIN2( "MORE_PAIN2" ); static const trait_id trait_MOREPAIN3( "MORE_PAIN3" ); static const trait_id trait_MOUTH_TENTACLES( "MOUTH_TENTACLES" ); +static const trait_id trait_MUT_JUNKIE( "MUT_JUNKIE" ); +static const trait_id trait_MUTAGEN_AVOID( "MUTAGEN_AVOID" ); +static const trait_id trait_MUTE( "MUTE" ); +static const trait_id trait_MYCUS_FRIEND( "MYCUS_FRIEND" ); +static const trait_id trait_MYCUS_THRESH( "MYCUS_THRESH" ); static const trait_id trait_MYOPIC( "MYOPIC" ); -static const trait_id trait_M_DEPENDENT( "M_DEPENDENT" ); -static const trait_id trait_M_IMMUNE( "M_IMMUNE" ); -static const trait_id trait_M_SKIN2( "M_SKIN2" ); -static const trait_id trait_M_SKIN3( "M_SKIN3" ); +static const trait_id trait_NAILS( "NAILS" ); +static const trait_id trait_NARCOLEPTIC( "NARCOLEPTIC" ); static const trait_id trait_NAUSEA( "NAUSEA" ); static const trait_id trait_NIGHTVISION( "NIGHTVISION" ); static const trait_id trait_NIGHTVISION2( "NIGHTVISION2" ); static const trait_id trait_NIGHTVISION3( "NIGHTVISION3" ); +static const trait_id trait_NO_THIRST( "NO_THIRST" ); static const trait_id trait_NOMAD( "NOMAD" ); static const trait_id trait_NOMAD2( "NOMAD2" ); static const trait_id trait_NOMAD3( "NOMAD3" ); +static const trait_id trait_NONADDICTIVE( "NONADDICTIVE" ); +static const trait_id trait_NONE( "NONE" ); static const trait_id trait_NOPAIN( "NOPAIN" ); -static const trait_id trait_NO_THIRST( "NO_THIRST" ); +static const trait_id trait_NPC_CONSTRUCTION_LEV_1( "NPC_CONSTRUCTION_LEV_1" ); +static const trait_id trait_NPC_CONSTRUCTION_LEV_2( "NPC_CONSTRUCTION_LEV_2" ); +static const trait_id trait_NPC_MISSION_LEV_1( "NPC_MISSION_LEV_1" ); +static const trait_id trait_NPC_STARTING_NPC( "NPC_STARTING_NPC" ); +static const trait_id trait_NPC_STATIC_NPC( "NPC_STATIC_NPC" ); +static const trait_id trait_OPTIMISTIC( "OPTIMISTIC" ); static const trait_id trait_PACIFIST( "PACIFIST" ); static const trait_id trait_PACKMULE( "PACKMULE" ); static const trait_id trait_PADDED_FEET( "PADDED_FEET" ); @@ -398,20 +596,40 @@ static const trait_id trait_PARAIMMUNE( "PARAIMMUNE" ); static const trait_id trait_PARKOUR( "PARKOUR" ); static const trait_id trait_PAWS( "PAWS" ); static const trait_id trait_PAWS_LARGE( "PAWS_LARGE" ); +static const trait_id trait_PER_ALPHA( "PER_ALPHA" ); static const trait_id trait_PER_SLIME( "PER_SLIME" ); static const trait_id trait_PER_SLIME_OK( "PER_SLIME_OK" ); +static const trait_id trait_PHEROMONE_INSECT( "PHEROMONE_INSECT" ); +static const trait_id trait_PHEROMONE_MAMMAL( "PHEROMONE_MAMMAL" ); +static const trait_id trait_PLANT( "PLANT" ); +static const trait_id trait_POISONOUS( "POISONOUS" ); +static const trait_id trait_POISONOUS2( "POISONOUS2" ); static const trait_id trait_PROBOSCIS( "PROBOSCIS" ); static const trait_id trait_PROF_AUTODOC( "PROF_AUTODOC" ); +static const trait_id trait_PROF_CHURL( "PROF_CHURL" ); +static const trait_id trait_PROF_CYBERCO( "PROF_CYBERCO" ); static const trait_id trait_PROF_DICEMASTER( "PROF_DICEMASTER" ); +static const trait_id trait_PROF_FED( "PROF_FED" ); static const trait_id trait_PROF_FOODP( "PROF_FOODP" ); static const trait_id trait_PROF_MED( "PROF_MED" ); +static const trait_id trait_PROF_PD_DET( "PROF_PD_DET" ); +static const trait_id trait_PROF_POLICE( "PROF_POLICE" ); static const trait_id trait_PROF_SKATER( "PROF_SKATER" ); +static const trait_id trait_PROF_SWAT( "PROF_SWAT" ); static const trait_id trait_PROJUNK( "PROJUNK" ); static const trait_id trait_PROJUNK2( "PROJUNK2" ); static const trait_id trait_PSYCHOPATH( "PSYCHOPATH" ); static const trait_id trait_PYROMANIA( "PYROMANIA" ); +static const trait_id trait_QUICK( "QUICK" ); static const trait_id trait_QUILLS( "QUILLS" ); +static const trait_id trait_RADIOACTIVE1( "RADIOACTIVE1" ); +static const trait_id trait_RADIOACTIVE2( "RADIOACTIVE2" ); +static const trait_id trait_RADIOACTIVE3( "RADIOACTIVE3" ); static const trait_id trait_RADIOGENIC( "RADIOGENIC" ); +static const trait_id trait_REGEN( "REGEN" ); +static const trait_id trait_REGEN_LIZ( "REGEN_LIZ" ); +static const trait_id trait_ROBUST( "ROBUST" ); +static const trait_id trait_ROOTS1( "ROOTS1" ); static const trait_id trait_ROOTS2( "ROOTS2" ); static const trait_id trait_ROOTS3( "ROOTS3" ); static const trait_id trait_RUMINANT( "RUMINANT" ); @@ -426,47 +644,79 @@ static const trait_id trait_SELFAWARE( "SELFAWARE" ); static const trait_id trait_SHARKTEETH( "SHARKTEETH" ); static const trait_id trait_SHELL( "SHELL" ); static const trait_id trait_SHELL2( "SHELL2" ); +static const trait_id trait_SHOUT1( "SHOUT1" ); static const trait_id trait_SHOUT2( "SHOUT2" ); static const trait_id trait_SHOUT3( "SHOUT3" ); static const trait_id trait_SLIMESPAWNER( "SLIMESPAWNER" ); static const trait_id trait_SLIMY( "SLIMY" ); +static const trait_id trait_SLOWHEALER( "SLOWHEALER" ); static const trait_id trait_SLOWLEARNER( "SLOWLEARNER" ); +static const trait_id trait_SMALL( "SMALL" ); +static const trait_id trait_SMALL_OK( "SMALL_OK" ); +static const trait_id trait_SMALL2( "SMALL2" ); +static const trait_id trait_SMELLY( "SMELLY" ); +static const trait_id trait_SORES( "SORES" ); static const trait_id trait_SPINES( "SPINES" ); static const trait_id trait_SPIRITUAL( "SPIRITUAL" ); static const trait_id trait_SQUEAMISH( "SQUEAMISH" ); static const trait_id trait_STIMBOOST( "STIMBOOST" ); static const trait_id trait_STOCKY_TROGLO( "STOCKY_TROGLO" ); +static const trait_id trait_STR_ALPHA( "STR_ALPHA" ); static const trait_id trait_STRONGSTOMACH( "STRONGSTOMACH" ); +static const trait_id trait_STYLISH( "STYLISH" ); +static const trait_id trait_SUNBURN( "SUNBURN" ); static const trait_id trait_SUNLIGHT_DEPENDENT( "SUNLIGHT_DEPENDENT" ); static const trait_id trait_TABLEMANNERS( "TABLEMANNERS" ); +static const trait_id trait_TAIL_CATTLE( "TAIL_CATTLE" ); +static const trait_id trait_TALONS( "TALONS" ); +static const trait_id trait_TERRIFYING( "TERRIFYING" ); static const trait_id trait_THICK_SCALES( "THICK_SCALES" ); static const trait_id trait_THORNS( "THORNS" ); static const trait_id trait_THRESH_BIRD( "THRESH_BIRD" ); static const trait_id trait_THRESH_CATTLE( "THRESH_CATTLE" ); -static const trait_id trait_THRESH_FELINE( "THRESH_FELINE" ); -static const trait_id trait_THRESH_LUPINE( "THRESH_LUPINE" ); -static const trait_id trait_THRESH_SPIDER( "THRESH_SPIDER" ); -static const trait_id trait_THRESH_URSINE( "THRESH_URSINE" ); static const trait_id trait_THRESH_CEPHALOPOD( "THRESH_CEPHALOPOD" ); +static const trait_id trait_THRESH_FELINE( "THRESH_FELINE" ); static const trait_id trait_THRESH_INSECT( "THRESH_INSECT" ); +static const trait_id trait_THRESH_LUPINE( "THRESH_LUPINE" ); +static const trait_id trait_THRESH_MARLOSS( "THRESH_MARLOSS" ); static const trait_id trait_THRESH_MEDICAL( "THRESH_MEDICAL" ); +static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" ); static const trait_id trait_THRESH_PLANT( "THRESH_PLANT" ); +static const trait_id trait_THRESH_SPIDER( "THRESH_SPIDER" ); +static const trait_id trait_THRESH_URSINE( "THRESH_URSINE" ); +static const trait_id trait_TOLERANCE( "TOLERANCE" ); static const trait_id trait_TOUGH_FEET( "TOUGH_FEET" ); +static const trait_id trait_TOXICFLESH( "TOXICFLESH" ); static const trait_id trait_TRANSPIRATION( "TRANSPIRATION" ); +static const trait_id trait_TREE_COMMUNION( "TREE_COMMUNION" ); +static const trait_id trait_TROGLO( "TROGLO" ); +static const trait_id trait_TROGLO2( "TROGLO2" ); +static const trait_id trait_TROGLO3( "TROGLO3" ); +static const trait_id trait_UNSTABLE( "UNSTABLE" ); static const trait_id trait_URSINE_EYE( "URSINE_EYE" ); static const trait_id trait_URSINE_FUR( "URSINE_FUR" ); static const trait_id trait_VEGETARIAN( "VEGETARIAN" ); +static const trait_id trait_VINES2( "VINES2" ); +static const trait_id trait_VINES3( "VINES3" ); static const trait_id trait_VISCOUS( "VISCOUS" ); static const trait_id trait_VOMITOUS( "VOMITOUS" ); static const trait_id trait_WATERSLEEP( "WATERSLEEP" ); +static const trait_id trait_WAYFARER( "WAYFARER" ); +static const trait_id trait_WEAKSCENT( "WEAKSCENT" ); static const trait_id trait_WEAKSTOMACH( "WEAKSTOMACH" ); -static const trait_id trait_WEBBED( "WEBBED" ); +static const trait_id trait_WEB_RAPPEL( "WEB_RAPPEL" ); static const trait_id trait_WEB_SPINNER( "WEB_SPINNER" ); static const trait_id trait_WEB_WALKER( "WEB_WALKER" ); static const trait_id trait_WEB_WEAVER( "WEB_WEAVER" ); +static const trait_id trait_WEBBED( "WEBBED" ); static const trait_id trait_WHISKERS( "WHISKERS" ); static const trait_id trait_WHISKERS_RAT( "WHISKERS_RAT" ); +static const trait_id trait_WINGS_BIRD( "WINGS_BIRD" ); +static const trait_id trait_WINGS_BUTTERFLY( "WINGS_BUTTERFLY" ); +static const trait_id trait_WINGS_INSECT( "WINGS_INSECT" ); 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" ); @@ -474,159 +724,667 @@ 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 species_id HUMAN( "HUMAN" ); -static const species_id ROBOT( "ROBOT" ); -static const species_id ZOMBIE( "ZOMBIE" ); +static const mongroup_id GROUP_BLOB( "GROUP_BLOB" ); +static const mongroup_id GROUP_BREATHER( "GROUP_BREATHER" ); +static const mongroup_id GROUP_BREATHER_HUB( "GROUP_BREATHER_HUB" ); +static const mongroup_id GROUP_CAVE( "GROUP_CAVE" ); +static const mongroup_id GROUP_CHUD( "GROUP_CHUD" ); +static const mongroup_id GROUP_DARK_WYRM( "GROUP_DARK_WYRM" ); +static const mongroup_id GROUP_DOG_THING( "GROUP_DOG_THING" ); +static const mongroup_id GROUP_FISH( "GROUP_FISH" ); +static const mongroup_id GROUP_FOREST( "GROUP_FOREST" ); +static const mongroup_id GROUP_FUNGI_FUNGALOID( "GROUP_FUNGI_FUNGALOID" ); +static const mongroup_id GROUP_HAZMATBOT( "GROUP_HAZMATBOT" ); +static const mongroup_id GROUP_LAB( "GROUP_LAB" ); +static const mongroup_id GROUP_LAB_CYBORG( "GROUP_LAB_CYBORG" ); +static const mongroup_id GROUP_LAB_FEMA( "GROUP_LAB_FEMA" ); +static const mongroup_id GROUP_MAYBE_MIL( "GROUP_MAYBE_MIL" ); +static const mongroup_id GROUP_MI_GO_CAMP_OM( "GROUP_MI-GO_CAMP_OM" ); +static const mongroup_id GROUP_MIL_WEAK( "GROUP_MIL_WEAK" ); +static const mongroup_id GROUP_NETHER( "GROUP_NETHER" ); +static const mongroup_id GROUP_NETHER_CAPTURED( "GROUP_NETHER_CAPTURED" ); +static const mongroup_id GROUP_NETHER_PORTAL( "GROUP_NETHER_PORTAL" ); +static const mongroup_id GROUP_PLAIN( "GROUP_PLAIN" ); +static const mongroup_id GROUP_RIVER( "GROUP_RIVER" ); +static const mongroup_id GROUP_ROBOT( "GROUP_ROBOT" ); +static const mongroup_id GROUP_ROBOT_SECUBOT( "GROUP_ROBOT_SECUBOT" ); +static const mongroup_id GROUP_SEWER( "GROUP_SEWER" ); +static const mongroup_id GROUP_SPIDER( "GROUP_SPIDER" ); +static const mongroup_id GROUP_SPIRAL( "GROUP_SPIRAL" ); +static const mongroup_id GROUP_STRAY_DOGS( "GROUP_STRAY_DOGS" ); +static const mongroup_id GROUP_SWAMP( "GROUP_SWAMP" ); +static const mongroup_id GROUP_TRIFFID( "GROUP_TRIFFID" ); +static const mongroup_id GROUP_TRIFFID_HEART( "GROUP_TRIFFID_HEART" ); +static const mongroup_id GROUP_TRIFFID_OUTER( "GROUP_TRIFFID_OUTER" ); +static const mongroup_id GROUP_TURRET( "GROUP_TURRET" ); +static const mongroup_id GROUP_VANILLA( "GROUP_VANILLA" ); +static const mongroup_id GROUP_WORM( "GROUP_WORM" ); +static const mongroup_id GROUP_ZOMBIE( "GROUP_ZOMBIE" ); +static const mongroup_id GROUP_ZOMBIE_COP( "GROUP_ZOMBIE_COP" ); +static const mtype_id mon_amigara_horror( "mon_amigara_horror" ); +static const mtype_id mon_ant( "mon_ant" ); +static const mtype_id mon_ant_acid_larva( "mon_ant_acid_larva" ); +static const mtype_id mon_ant_acid_queen( "mon_ant_acid_queen" ); +static const mtype_id mon_ant_fungus( "mon_ant_fungus" ); +static const mtype_id mon_ant_larva( "mon_ant_larva" ); +static const mtype_id mon_ant_queen( "mon_ant_queen" ); +static const mtype_id mon_ant_soldier( "mon_ant_soldier" ); +static const mtype_id mon_bat( "mon_bat" ); +static const mtype_id mon_bear( "mon_bear" ); +static const mtype_id mon_beaver( "mon_beaver" ); +static const mtype_id mon_bee( "mon_bee" ); +static const mtype_id mon_beekeeper( "mon_beekeeper" ); +static const mtype_id mon_biollante( "mon_biollante" ); +static const mtype_id mon_black_rat( "mon_black_rat" ); +static const mtype_id mon_blob( "mon_blob" ); +static const mtype_id mon_blob_brain( "mon_blob_brain" ); +static const mtype_id mon_blob_large( "mon_blob_large" ); +static const mtype_id mon_blob_small( "mon_blob_small" ); +static const mtype_id mon_boomer( "mon_boomer" ); +static const mtype_id mon_boomer_fungus( "mon_boomer_fungus" ); +static const mtype_id mon_boomer_huge( "mon_boomer_huge" ); +static const mtype_id mon_breather( "mon_breather" ); +static const mtype_id mon_breather_hub( "mon_breather_hub" ); +static const mtype_id mon_chicken( "mon_chicken" ); +static const mtype_id mon_chipmunk( "mon_chipmunk" ); +static const mtype_id mon_cockatrice( "mon_cockatrice" ); +static const mtype_id mon_copbot( "mon_copbot" ); +static const mtype_id mon_cougar( "mon_cougar" ); +static const mtype_id mon_cow( "mon_cow" ); +static const mtype_id mon_coyote( "mon_coyote" ); +static const mtype_id mon_creeper_hub( "mon_creeper_hub" ); +static const mtype_id mon_creeper_vine( "mon_creeper_vine" ); +static const mtype_id mon_crows_m240( "mon_crows_m240" ); +static const mtype_id mon_dark_wyrm( "mon_dark_wyrm" ); +static const mtype_id mon_deer( "mon_deer" ); +static const mtype_id mon_defective_robot_nurse( "mon_nursebot_defective" ); +static const mtype_id mon_dermatik( "mon_dermatik" ); +static const mtype_id mon_dermatik_larva( "mon_dermatik_larva" ); +static const mtype_id mon_dispatch( "mon_dispatch" ); +static const mtype_id mon_dog( "mon_dog" ); +static const mtype_id mon_dog_thing( "mon_dog_thing" ); +static const mtype_id mon_duck( "mon_duck" ); +static const mtype_id mon_eyebot( "mon_eyebot" ); +static const mtype_id mon_fly( "mon_fly" ); +static const mtype_id mon_fox_gray( "mon_fox_gray" ); +static const mtype_id mon_fox_red( "mon_fox_red" ); +static const mtype_id mon_fungal_blossom( "mon_fungal_blossom" ); +static const mtype_id mon_fungal_hedgerow( "mon_fungal_hedgerow" ); +static const mtype_id mon_fungal_tendril( "mon_fungal_tendril" ); +static const mtype_id mon_fungal_wall( "mon_fungal_wall" ); +static const mtype_id mon_fungaloid( "mon_fungaloid" ); +static const mtype_id mon_fungaloid_young( "mon_fungaloid_young" ); +static const mtype_id mon_generator( "mon_generator" ); +static const mtype_id mon_giant_cockroach_nymph( "mon_giant_cockroach_nymph" ); +static const mtype_id mon_groundhog( "mon_groundhog" ); +static const mtype_id mon_grouse( "mon_grouse" ); +static const mtype_id mon_halfworm( "mon_halfworm" ); +static const mtype_id mon_hallu_multicooker( "mon_hallu_multicooker" ); +static const mtype_id mon_hare( "mon_hare" ); +static const mtype_id mon_headless_dog_thing( "mon_headless_dog_thing" ); +static const mtype_id mon_hologram( "mon_hologram" ); +static const mtype_id mon_horse( "mon_horse" ); +static const mtype_id mon_hound_tindalos_afterimage( "mon_hound_tindalos_afterimage" ); +static const mtype_id mon_jabberwock( "mon_jabberwock" ); +static const mtype_id mon_leech_blossom( "mon_leech_blossom" ); +static const mtype_id mon_leech_root_drone( "mon_leech_root_drone" ); +static const mtype_id mon_leech_root_runner( "mon_leech_root_runner" ); +static const mtype_id mon_leech_stalk( "mon_leech_stalk" ); +static const mtype_id mon_lemming( "mon_lemming" ); +static const mtype_id mon_manhack( "mon_manhack" ); +static const mtype_id mon_marloss_zealot_f( "mon_marloss_zealot_f" ); +static const mtype_id mon_marloss_zealot_m( "mon_marloss_zealot_m" ); +static const mtype_id mon_mink( "mon_mink" ); +static const mtype_id mon_moose( "mon_moose" ); +static const mtype_id mon_muskrat( "mon_muskrat" ); +static const mtype_id mon_opossum( "mon_opossum" ); +static const mtype_id mon_otter( "mon_otter" ); +static const mtype_id mon_pheasant( "mon_pheasant" ); +static const mtype_id mon_pig( "mon_pig" ); static const mtype_id mon_player_blob( "mon_player_blob" ); +static const mtype_id mon_rabbit( "mon_rabbit" ); +static const mtype_id mon_rat_king( "mon_rat_king" ); +static const mtype_id mon_riotbot( "mon_riotbot" ); +static const mtype_id mon_secubot( "mon_secubot" ); +static const mtype_id mon_sewer_rat( "mon_sewer_rat" ); +static const mtype_id mon_sewer_snake( "mon_sewer_snake" ); +static const mtype_id mon_shadow( "mon_shadow" ); static const mtype_id mon_shadow_snake( "mon_shadow_snake" ); +static const mtype_id mon_shia( "mon_shia" ); +static const mtype_id mon_skeleton( "mon_skeleton" ); +static const mtype_id mon_skeleton_brute( "mon_skeleton_brute" ); +static const mtype_id mon_skeleton_hulk( "mon_skeleton_hulk" ); +static const mtype_id mon_skeleton_hulk_fungus( "mon_skeleton_hulk_fungus" ); +static const mtype_id mon_spider_cellar_giant( "mon_spider_cellar_giant" ); +static const mtype_id mon_spider_cellar_giant_s( "mon_spider_cellar_giant_s" ); +static const mtype_id mon_spider_fungus( "mon_spider_fungus" ); +static const mtype_id mon_spider_web( "mon_spider_web" ); +static const mtype_id mon_spider_web_s( "mon_spider_web_s" ); +static const mtype_id mon_spider_widow_giant( "mon_spider_widow_giant" ); +static const mtype_id mon_spider_widow_giant_s( "mon_spider_widow_giant_s" ); +static const mtype_id mon_spore( "mon_spore" ); +static const mtype_id mon_squirrel( "mon_squirrel" ); +static const mtype_id mon_thing( "mon_thing" ); +static const mtype_id mon_triffid( "mon_triffid" ); +static const mtype_id mon_triffid_queen( "mon_triffid_queen" ); +static const mtype_id mon_triffid_young( "mon_triffid_young" ); +static const mtype_id mon_turkey( "mon_turkey" ); +static const mtype_id mon_turret_bmg( "mon_turret_bmg" ); +static const mtype_id mon_turret_rifle( "mon_turret_rifle" ); +static const mtype_id mon_turret_riot( "mon_turret_riot" ); +static const mtype_id mon_turret_searchlight( "mon_turret_searchlight" ); +static const mtype_id mon_vortex( "mon_vortex" ); +static const mtype_id mon_wasp( "mon_wasp" ); +static const mtype_id mon_weasel( "mon_weasel" ); +static const mtype_id mon_wolf( "mon_wolf" ); +static const mtype_id mon_zombie( "mon_zombie" ); +static const mtype_id mon_zombie_anklebiter( "mon_zombie_anklebiter" ); +static const mtype_id mon_zombie_bio_op( "mon_zombie_bio_op" ); +static const mtype_id mon_zombie_brute( "mon_zombie_brute" ); +static const mtype_id mon_zombie_brute_shocker( "mon_zombie_brute_shocker" ); +static const mtype_id mon_zombie_child( "mon_zombie_child" ); +static const mtype_id mon_zombie_child_fungus( "mon_zombie_child_fungus" ); +static const mtype_id mon_zombie_cop( "mon_zombie_cop" ); +static const mtype_id mon_zombie_crawler( "mon_zombie_crawler" ); +static const mtype_id mon_zombie_creepy( "mon_zombie_creepy" ); +static const mtype_id mon_zombie_dancer( "mon_zombie_dancer" ); +static const mtype_id mon_zombie_dog( "mon_zombie_dog" ); +static const mtype_id mon_zombie_electric( "mon_zombie_electric" ); +static const mtype_id mon_zombie_fat( "mon_zombie_fat" ); +static const mtype_id mon_zombie_fireman( "mon_zombie_fireman" ); +static const mtype_id mon_zombie_fungus( "mon_zombie_fungus" ); +static const mtype_id mon_zombie_gasbag( "mon_zombie_gasbag" ); +static const mtype_id mon_zombie_gasbag_crawler( "mon_zombie_gasbag_crawler" ); +static const mtype_id mon_zombie_gasbag_fungus( "mon_zombie_gasbag_fungus" ); +static const mtype_id mon_zombie_gasbag_impaler( "mon_zombie_gasbag_impaler" ); +static const mtype_id mon_zombie_grabber( "mon_zombie_grabber" ); +static const mtype_id mon_zombie_hazmat( "mon_zombie_hazmat" ); +static const mtype_id mon_zombie_hulk( "mon_zombie_hulk" ); +static const mtype_id mon_zombie_hunter( "mon_zombie_hunter" ); +static const mtype_id mon_zombie_jackson( "mon_zombie_jackson" ); +static const mtype_id mon_zombie_master( "mon_zombie_master" ); +static const mtype_id mon_zombie_military_pilot( "mon_zombie_military_pilot" ); +static const mtype_id mon_zombie_necro( "mon_zombie_necro" ); +static const mtype_id mon_zombie_rot( "mon_zombie_rot" ); +static const mtype_id mon_zombie_scientist( "mon_zombie_scientist" ); +static const mtype_id mon_zombie_shrieker( "mon_zombie_shrieker" ); +static const mtype_id mon_zombie_shriekling( "mon_zombie_shriekling" ); +static const mtype_id mon_zombie_skeltal_minion( "mon_zombie_skeltal_minion" ); +static const mtype_id mon_zombie_smoker( "mon_zombie_smoker" ); +static const mtype_id mon_zombie_smoker_fungus( "mon_zombie_smoker_fungus" ); +static const mtype_id mon_zombie_snotgobbler( "mon_zombie_snotgobbler" ); +static const mtype_id mon_zombie_soldier( "mon_zombie_soldier" ); +static const mtype_id mon_zombie_spitter( "mon_zombie_spitter" ); +static const mtype_id mon_zombie_sproglodyte( "mon_zombie_sproglodyte" ); +static const mtype_id mon_zombie_survivor( "mon_zombie_survivor" ); +static const mtype_id mon_zombie_swimmer( "mon_zombie_swimmer" ); +static const mtype_id mon_zombie_technician( "mon_zombie_technician" ); +static const mtype_id mon_zombie_tough( "mon_zombie_tough" ); +static const mtype_id mon_zombie_waif( "mon_zombie_waif" ); -static const skill_id skill_cooking( "cooking" ); -static const skill_id skill_computer( "computer" ); -static const skill_id skill_dodge( "dodge" ); -static const skill_id skill_electronics( "electronics" ); -static const skill_id skill_firstaid( "firstaid" ); -static const skill_id skill_mechanics( "mechanics" ); -static const skill_id skill_throw( "throw" ); -static const skill_id skill_gun( "gun" ); -static const skill_id skill_swimming( "swimming" ); -static const skill_id skill_survival( "survival" ); +static const std::string flag_ACID( "ACID" ); +static const std::string flag_ACT_IN_FIRE( "ACT_IN_FIRE" ); +static const std::string flag_ACTIVE_CLOAKING( "ACTIVE_CLOAKING" ); +static const std::string flag_ALARMED( "ALARMED" ); static const std::string flag_ALLERGEN_EGG( "ALLERGEN_EGG" ); static const std::string flag_ALLERGEN_FRUIT( "ALLERGEN_FRUIT" ); static const std::string flag_ALLERGEN_JUNK( "ALLERGEN_JUNK" ); static const std::string flag_ALLERGEN_MEAT( "ALLERGEN_MEAT" ); static const std::string flag_ALLERGEN_MILK( "ALLERGEN_MILK" ); -static const std::string flag_ALLERGEN_WHEAT( "ALLERGEN_WHEAT" ); static const std::string flag_ALLERGEN_VEGGY( "ALLERGEN_VEGGY" ); +static const std::string flag_ALLERGEN_WHEAT( "ALLERGEN_WHEAT" ); static const std::string flag_ALLOWS_NATURAL_ATTACKS( "ALLOWS_NATURAL_ATTACKS" ); static const std::string flag_ALLOWS_REMOTE_USE( "ALLOWS_REMOTE_USE" ); +static const std::string flag_ALWAYS_TWOHAND( "ALWAYS_TWOHAND" ); static const std::string flag_ANESTHESIA( "ANESTHESIA" ); static const std::string flag_AURA( "AURA" ); +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_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_BELTED( "BELTED" ); +static const std::string flag_BIPOD( "BIPOD" ); static const std::string flag_BIRD( "BIRD" ); +static const std::string flag_BLIND( "BLIND" ); static const std::string flag_BLIND_EASY( "BLIND_EASY" ); static const std::string flag_BLIND_HARD( "BLIND_HARD" ); +static const std::string flag_BLOCK_WHILE_WORN( "BLOCK_WHILE_WORN" ); +static const std::string flag_BLOCKSDOOR( "BLOCKSDOOR" ); +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_CAN_SIT( "CAN_SIT" ); static const std::string flag_CANNIBALISM( "CANNIBALISM" ); static const std::string flag_CARNIVORE_OK( "CARNIVORE_OK" ); +static const std::string flag_CASING( "CASING" ); static const std::string flag_CATTLE( "CATTLE" ); -static const std::string flag_COOKED( "COOKED" ); +static const std::string flag_CHALLENGE( "CHALLENGE" ); +static const std::string flag_CHARGEDIM( "CHARGEDIM" ); +static const std::string flag_CITY_START( "CITY_START" ); +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_COLLAPSES( "COLLAPSES" ); +static const std::string flag_COLLAPSIBLE_STOCK( "COLLAPSIBLE_STOCK" ); +static const std::string flag_CONDUCTIVE( "CONDUCTIVE" ); +static const std::string flag_CONSOLE( "CONSOLE" ); +static const std::string flag_CONSUMABLE( "CONSUMABLE" ); +static const std::string flag_CONTAINER( "CONTAINER" ); +static const std::string flag_COOKED( "COOKED" ); static const std::string flag_CORPSE( "CORPSE" ); +static const std::string flag_CURRENT( "CURRENT" ); +static const std::string flag_DANGEROUS( "DANGEROUS" ); +static const std::string flag_DEAF( "DEAF" ); +static const std::string flag_DEEP_WATER( "DEEP_WATER" ); +static const std::string flag_DESTROY_ITEM( "DESTROY_ITEM" ); +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_DIMENSIONAL_ANCHOR( "DIMENSIONAL_ANCHOR" ); +static const std::string flag_DISABLE_SIGHTS( "DISABLE_SIGHTS" ); +static const std::string flag_DONT_REMOVE_ROTTEN( "DONT_REMOVE_ROTTEN" ); +static const std::string flag_DROP_ACTION_ONLY_IF_LIQUID( "DROP_ACTION_ONLY_IF_LIQUID" ); +static const std::string flag_DURABLE_MELEE( "DURABLE_MELEE" ); +static const std::string flag_EASY_DECONSTRUCT( "EASY_DECONSTRUCT" ); static const std::string flag_EATEN_COLD( "EATEN_COLD" ); -static const std::string flag_EDIBLE_FROZEN( "EDIBLE_FROZEN" ); static const std::string flag_EATEN_HOT( "EATEN_HOT" ); +static const std::string flag_EDIBLE_FROZEN( "EDIBLE_FROZEN" ); +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_EMITTER( "EMITTER" ); static const std::string flag_ETHEREAL_ITEM( "ETHEREAL_ITEM" ); -static const std::string flag_INEDIBLE( "INEDIBLE" ); -static const std::string flag_FERTILIZER( "FERTILIZER" ); +static const std::string flag_FAKE_MILL( "FAKE_MILL" ); +static const std::string flag_FAKE_SMOKE( "FAKE_SMOKE" ); +static const std::string flag_FANCY( "FANCY" ); static const std::string flag_FELINE( "FELINE" ); +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_FIRE( "FIRE" ); +static const std::string flag_FIRE_100( "FIRE_100" ); +static const std::string flag_FIRE_20( "FIRE_20" ); +static const std::string flag_FIRE_50( "FIRE_50" ); +static const std::string flag_FIRE_CONTAINER( "FIRE_CONTAINER" ); +static const std::string flag_FIRE_START( "FIRE_START" ); +static const std::string flag_FIRE_TWOHAND( "FIRE_TWOHAND" ); +static const std::string flag_FIRESTARTER( "FIRESTARTER" ); +static const std::string flag_FIREWOOD( "FIREWOOD" ); static const std::string flag_FISH_GOOD( "FISH_GOOD" ); static const std::string flag_FISH_POOR( "FISH_POOR" ); +static const std::string flag_FISHABLE( "FISHABLE" ); static const std::string flag_FIT( "FIT" ); +static const std::string flag_FIX_FARSIGHT( "FIX_FARSIGHT" ); +static const std::string flag_FIX_NEARSIGHT( "FIX_NEARSIGHT" ); +static const std::string flag_FLAMING( "FLAMING" ); +static const std::string flag_FLAMMABLE( "FLAMMABLE" ); +static const std::string flag_FLAMMABLE_ASH( "FLAMMABLE_ASH" ); +static const std::string flag_FLASH_PROTECTION( "FLASH_PROTECTION" ); +static const std::string flag_FLAT( "FLAT" ); static const std::string flag_FLAT_SURF( "FLAT_SURF" ); -static const std::string flag_FROZEN( "FROZEN" ); +static const std::string flag_FLOTATION( "FLOTATION" ); +static const std::string flag_FLOWER( "FLOWER" ); static const std::string flag_FORAGE_HALLU( "FORAGE_HALLU" ); static const std::string flag_FORAGE_POISON( "FORAGE_POISON" ); +static const std::string flag_FRAGILE_MELEE( "FRAGILE_MELEE" ); +static const std::string flag_FREEZERBURN( "FREEZERBURN" ); +static const std::string flag_FROZEN( "FROZEN" ); +static const std::string flag_FULL_MAGAZINE( "FULL_MAGAZINE" ); static const std::string flag_FUNGAL_VECTOR( "FUNGAL_VECTOR" ); +static const std::string flag_FUNGUS( "FUNGUS" ); +static const std::string flag_GAS_DISCOUNT( "GAS_DISCOUNT" ); +static const std::string flag_GAS_PROOF( "GAS_PROOF" ); +static const std::string flag_GIBBED( "GIBBED" ); +static const std::string flag_GNV_EFFECT( "GNV_EFFECT" ); +static const std::string flag_GOES_DOWN( "GOES_DOWN" ); +static const std::string flag_GOES_UP( "GOES_UP" ); +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_HELI_CRASH( "HELI_CRASH" ); +static const std::string flag_HELMET_COMPAT( "HELMET_COMPAT" ); static const std::string flag_HIDDEN_HALLU( "HIDDEN_HALLU" ); +static const std::string flag_HIDDEN_ITEM( "HIDDEN_ITEM" ); 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_GIBBED( "GIBBED" ); -static const std::string flag_FISHABLE( "FISHABLE" ); -static const std::string flag_FIX_FARSIGHT( "FIX_FARSIGHT" ); +static const std::string flag_HURT_WHEN_WIELDED( "HURT_WHEN_WIELDED" ); +static const std::string flag_IN_CBM( "IN_CBM" ); +static const std::string flag_INDOORS( "INDOORS" ); +static const std::string flag_INEDIBLE( "INEDIBLE" ); +static const std::string flag_INFECTED( "INFECTED" ); +static const std::string flag_INITIAL_PART( "INITIAL_PART" ); +static const std::string flag_IR_EFFECT( "IR_EFFECT" ); +static const std::string flag_IRREMOVABLE( "IRREMOVABLE" ); +static const std::string flag_IS_ARMOR( "IS_ARMOR" ); +static const std::string flag_IS_PET_ARMOR( "IS_PET_ARMOR" ); +static const std::string flag_IS_UPS( "IS_UPS" ); static const std::string flag_KITCHEN( "KITCHEN" ); +static const std::string flag_LADDER( "LADDER" ); +static const std::string flag_LEAK_ALWAYS( "LEAK_ALWAYS" ); +static const std::string flag_LEAK_DAM( "LEAK_DAM" ); +static const std::string flag_LIQUID( "LIQUID" ); +static const std::string flag_LIQUIDCONT( "LIQUIDCONT" ); +static const std::string flag_LITCIG( "LITCIG" ); +static const std::string flag_LOCKED( "LOCKED" ); +static const std::string flag_LONE_START( "LONE_START" ); static const std::string flag_LUPINE( "LUPINE" ); +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_MELTS( "MELTS" ); static const std::string flag_MESSY( "MESSY" ); +static const std::string flag_MILLABLE( "MILLABLE" ); +static const std::string flag_MOUNTABLE( "MOUNTABLE" ); +static const std::string flag_MOUNTED_GUN( "MOUNTED_GUN" ); static const std::string flag_MUSHY( "MUSHY" ); static const std::string flag_MYCUS_OK( "MYCUS_OK" ); -static const std::string flag_SAFECRACK( "SAFECRACK" ); -static const std::string flag_SUPPORTS_ROOF( "SUPPORTS_ROOF" ); -static const std::string flag_FIELD_DRESS_FAILED( "FIELD_DRESS_FAILED" ); -static const std::string flag_FIELD_DRESS( "FIELD_DRESS" ); -static const std::string flag_FIRE_TWOHAND( "FIRE_TWOHAND" ); -static const std::string flag_FULL_MAGAZINE( "FULL_MAGAZINE" ); -static const std::string flag_GROWTH_HARVEST( "GROWTH_HARVEST" ); -static const std::string flag_MOUNTED_GUN( "MOUNTED_GUN" ); +static const std::string flag_NANOFAB_TEMPLATE( "NANOFAB_TEMPLATE" ); +static const std::string flag_NEED_ACTIVE_TO_MELEE( "NEED_ACTIVE_TO_MELEE" ); +static const std::string flag_NEEDS_NO_LUBE( "NEEDS_NO_LUBE" ); +static const std::string flag_NEEDS_UNFOLD( "NEEDS_UNFOLD" ); 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_CVD( "NO_CVD" ); +static const std::string flag_NO_DISPLAY( "NO_DISPLAY" ); +static const std::string flag_NO_DROP( "NO_DROP" ); 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_RELOAD( "NO_RELOAD" ); +static const std::string flag_NO_REPAIR( "NO_REPAIR" ); static const std::string flag_NO_RESIZE( "NO_RESIZE" ); +static const std::string flag_NO_SALVAGE( "NO_SALVAGE" ); static const std::string flag_NO_STERILE( "NO_STERILE" ); 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" ); +static const std::string flag_NOITEM( "NOITEM" ); +static const std::string flag_NON_FOULING( "NON-FOULING" ); +static const std::string flag_NONCONDUCTIVE( "NONCONDUCTIVE" ); +static const std::string flag_NPC_SAFE( "NPC_SAFE" ); static const std::string flag_NUTRIENT_OVERRIDE( "NUTRIENT_OVERRIDE" ); +static const std::string flag_ONLY_ONE( "ONLY_ONE" ); +static const std::string flag_OPENCLOSE_INSIDE( "OPENCLOSE_INSIDE" ); +static const std::string flag_ORGANIC( "ORGANIC" ); +static const std::string flag_OUTER( "OUTER" ); +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_PLANT( "PLANT" ); static const std::string flag_PLANTABLE( "PLANTABLE" ); 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_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_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_RESIST( "RAD_RESIST" ); +static const std::string flag_RADIO_ACTIVATION( "RADIO_ACTIVATION" ); +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_RAW( "RAW" ); +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" ); +static const std::string flag_RAIN_PROTECT( "RAIN_PROTECT" ); 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_RECHARGE( "RECHARGE" ); +static const std::string flag_REDUCED_BASHING( "REDUCED_BASHING" ); +static const std::string flag_REDUCED_WEIGHT( "REDUCED_WEIGHT" ); 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_RESTRICT_HANDS( "RESTRICT_HANDS" ); 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" ); +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_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_SEALED( "SEALED" ); +static const std::string flag_SECRET( "SECRET" ); static const std::string flag_SEMITANGIBLE( "SEMITANGIBLE" ); +static const std::string flag_SHARP( "SHARP" ); +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_SLOW_WIELD( "SLOW_WIELD" ); +static const std::string flag_SMOKABLE( "SMOKABLE" ); +static const std::string flag_SMOKED( "SMOKED" ); +static const std::string flag_SPEAR( "SPEAR" ); static const std::string flag_SPEEDLOADER( "SPEEDLOADER" ); +static const std::string flag_SPR_START( "SPR_START" ); +static const std::string flag_STR_DRAW( "STR_DRAW" ); +static const std::string flag_STURDY( "STURDY" ); +static const std::string flag_SUM_ADV_START( "SUM_ADV_START" ); +static const std::string flag_SUM_START( "SUM_START" ); +static const std::string flag_SUN_GLASSES( "SUN_GLASSES" ); +static const std::string flag_SUPER_FANCY( "SUPER_FANCY" ); +static const std::string flag_SUPPORTS_ROOF( "SUPPORTS_ROOF" ); +static const std::string flag_SUR_START( "SUR_START" ); +static const std::string flag_SWIM_GOGGLES( "SWIM_GOGGLES" ); static const std::string flag_SWIMMABLE( "SWIMMABLE" ); +static const std::string flag_THERMOMETER( "THERMOMETER" ); +static const std::string flag_THIN_OBSTACLE( "THIN_OBSTACLE" ); +static const std::string flag_TINDER( "TINDER" ); +static const std::string flag_TINY( "TINY" ); +static const std::string flag_TOBACCO( "TOBACCO" ); +static const std::string flag_TRANSPARENT( "TRANSPARENT" ); static const std::string flag_TREE( "TREE" ); +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" ); +static const std::string flag_UNCRAFT_LIQUIDS_CONTAINED( "UNCRAFT_LIQUIDS_CONTAINED" ); static const std::string flag_UNCRAFT_SINGLE_CHARGE( "UNCRAFT_SINGLE_CHARGE " ); -static const std::string flag_USE_EAT_VERB( "USE_EAT_VERB" ); +static const std::string flag_UNDERSIZE( "UNDERSIZE" ); +static const std::string flag_UNDERWATER_GUN( "UNDERWATER_GUN" ); +static const std::string flag_UNSTABLE( "UNSTABLE" ); static const std::string flag_URSINE_HONEY( "URSINE_HONEY" ); -static const std::string flag_UNCRAFT_LIQUIDS_CONTAINED( "UNCRAFT_LIQUIDS_CONTAINED" ); +static const std::string flag_USABLE_FIRE( "USABLE_FIRE" ); +static const std::string flag_USE_EAT_VERB( "USE_EAT_VERB" ); +static const std::string flag_USE_UPS( "USE_UPS" ); +static const std::string flag_USES_BIONIC_POWER( "USES_BIONIC_POWER" ); static const std::string flag_VARSIZE( "VARSIZE" ); +static const std::string flag_VEHICLE( "VEHICLE" ); +static const std::string flag_WAIST( "WAIST" ); +static const std::string flag_WALL( "WALL" ); +static const std::string flag_WATER_EXTINGUISH( "WATER_EXTINGUISH" ); +static const std::string flag_WATER_FRIENDLY( "WATER_FRIENDLY" ); +static const std::string flag_WATERPROOF( "WATERPROOF" ); +static const std::string flag_WATERPROOF_GUN( "WATERPROOF_GUN" ); +static const std::string flag_WET( "WET" ); +static const std::string flag_WHIP( "WHIP" ); +static const std::string flag_WIN_START( "WIN_START" ); +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" ); +static const skill_id skill_computer( "computer" ); +static const skill_id skill_cooking( "cooking" ); +static const skill_id skill_cutting( "cutting" ); +static const skill_id skill_dodge( "dodge" ); +static const skill_id skill_driving( "driving" ); +static const skill_id skill_electronics( "electronics" ); +static const skill_id skill_fabrication( "fabrication" ); +static const skill_id skill_firstaid( "firstaid" ); +static const skill_id skill_gun( "gun" ); +static const skill_id skill_launcher( "launcher" ); +static const skill_id skill_mechanics( "mechanics" ); +static const skill_id skill_melee( "melee" ); +static const skill_id skill_pistol( "pistol" ); +static const skill_id skill_rifle( "rifle" ); +static const skill_id skill_shotgun( "shotgun" ); +static const skill_id skill_smg( "smg" ); +static const skill_id skill_speech( "speech" ); +static const skill_id skill_stabbing( "stabbing" ); +static const skill_id skill_survival( "survival" ); +static const skill_id skill_swimming( "swimming" ); +static const skill_id skill_tailor( "tailor" ); +static const skill_id skill_throw( "throw" ); +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_FISHING( "FISHING" ); -static const quality_id qual_SAW_W( "SAW_W" ); +static const quality_id qual_JACK( "JACK" ); +static const quality_id qual_LIFT( "LIFT" ); static const quality_id qual_SAW_M( "SAW_M" ); +static const quality_id qual_SAW_W( "SAW_W" ); +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" ); static const zone_type_id zone_type_CONSTRUCTION_BLUEPRINT( "CONSTRUCTION_BLUEPRINT" ); static const zone_type_id zone_type_FARM_PLOT( "FARM_PLOT" ); +static const zone_type_id zone_type_FISHING_SPOT( "FISHING_SPOT" ); +static const zone_type_id zone_type_LOOT_CORPSE( "LOOT_CORPSE" ); static const zone_type_id zone_type_LOOT_IGNORE( "LOOT_IGNORE" ); static const zone_type_id zone_type_LOOT_UNSORTED( "LOOT_UNSORTED" ); +static const zone_type_id zone_type_LOOT_WOOD( "LOOT_WOOD" ); static const zone_type_id zone_type_VEHICLE_DECONSTRUCT( "VEHICLE_DECONSTRUCT" ); static const zone_type_id zone_type_VEHICLE_REPAIR( "VEHICLE_REPAIR" ); -static const zone_type_id zone_type_LOOT_CORPSE( "LOOT_CORPSE" ); -static const zone_type_id zone_type_LOOT_WOOD( "LOOT_WOOD" ); -static const zone_type_id zone_type_FISHING_SPOT( "FISHING_SPOT" ); -static const zone_type_id zone_source_firewood( "SOURCE_FIREWOOD" ); +static const zone_type_id z_camp_food( "CAMP_FOOD" ); +static const zone_type_id z_camp_storage( "CAMP_STORAGE" ); static const zone_type_id z_loot_unsorted( "LOOT_UNSORTED" ); +static const zone_type_id zone_source_firewood( "SOURCE_FIREWOOD" ); static const trap_str_id tr_firewood_source( "tr_firewood_source" ); +static const trap_str_id tr_practice_target( "tr_practice_target" ); static const trap_str_id tr_unfinished_construction( "tr_unfinished_construction" ); -static const itype_id itype_battery( "battery" ); -static const itype_id itype_sun_light( "sunlight" ); -static const itype_id itype_wind( "wind" ); +static const itype_id fuel_type_animal( "animal" ); +static const itype_id fuel_type_battery( "battery" ); +static const itype_id fuel_type_muscle( "muscle" ); +static const itype_id fuel_type_none( "null" ); +static const itype_id fuel_type_plutonium_cell( "plut_cell" ); +static const itype_id fuel_type_sun_light( "sunlight" ); +static const itype_id fuel_type_wind( "wind" ); +static const fault_id fault_belt( "fault_engine_belt_drive" ); static const fault_id fault_bionic_salvaged( "fault_bionic_salvaged" ); +static const fault_id fault_diesel( "fault_engine_pump_diesel" ); +static const fault_id fault_filter_air( "fault_engine_filter_air" ); +static const fault_id fault_filter_fuel( "fault_engine_filter_fuel" ); +static const fault_id fault_glowplug( "fault_engine_glow_plug" ); +static const fault_id fault_gun_blackpowder( "fault_gun_blackpowder" ); +static const fault_id fault_gun_chamber_spent( "fault_gun_chamber_spent" ); +static const fault_id fault_gun_dirt( "fault_gun_dirt" ); +static const fault_id fault_gun_unlubricated( "fault_gun_unlubricated" ); +static const fault_id fault_immobiliser( "fault_engine_immobiliser" ); +static const fault_id fault_pump( "fault_engine_pump_fuel" ); +static const fault_id fault_starter( "fault_engine_starter" ); -static const std::string comesttype_FOOD( "FOOD" ); static const std::string comesttype_DRINK( "DRINK" ); +static const std::string comesttype_FOOD( "FOOD" ); -static const matype_id style_none( "style_none" ); +static const matype_id style_aikido( "style_aikido" ); +static const matype_id style_biojutsu( "style_biojutsu" ); +static const matype_id style_boxing( "style_boxing" ); +static const matype_id style_capoeira( "style_capoeira" ); +static const matype_id style_crane( "style_crane" ); +static const matype_id style_dragon( "style_dragon" ); +static const matype_id style_judo( "style_judo" ); +static const matype_id style_karate( "style_karate" ); static const matype_id style_kicks( "style_kicks" ); +static const matype_id style_krav_maga( "style_krav_maga" ); +static const matype_id style_leopard( "style_leopard" ); +static const matype_id style_muay_thai( "style_muay_thai" ); +static const matype_id style_ninjutsu( "style_ninjutsu" ); +static const matype_id style_none( "style_none" ); +static const matype_id style_pankration( "style_pankration" ); +static const matype_id style_snake( "style_snake" ); +static const matype_id style_taekwondo( "style_taekwondo" ); +static const matype_id style_tai_chi( "style_tai_chi" ); +static const matype_id style_tiger( "style_tiger" ); +static const matype_id style_wingchun( "style_wingchun" ); +static const matype_id style_zui_quan( "style_zui_quan" ); + +static const species_id ABERRATION( "ABERRATION" ); +static const species_id BLOB( "BLOB" ); +static const species_id FISH( "FISH" ); +static const species_id FUNGUS( "FUNGUS" ); +static const species_id HALLUCINATION( "HALLUCINATION" ); +static const species_id HUMAN( "HUMAN" ); +static const species_id INSECT( "INSECT" ); +static const species_id LEECH_PLANT( "LEECH_PLANT" ); +static const species_id MAMMAL( "MAMMAL" ); +static const species_id MOLLUSK( "MOLLUSK" ); +static const species_id PLANT( "PLANT" ); +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 ter_str_id ter_dirt( "t_dirt" ); +static const ter_str_id ter_grass_dead( "t_grass_dead" ); +static const ter_str_id ter_stump( "t_stump" ); +static const ter_str_id ter_tree_dead( "t_tree_dead" ); +static const ter_str_id ter_tree_deadpine( "t_tree_deadpine" ); +static const ter_str_id ter_tree_birch_harvested( "t_tree_birch_harvested" ); +static const ter_str_id ter_tree_willow_harvested( "t_tree_willow_harvested" ); +static const ter_str_id ter_tree_hickory_dead( "t_tree_hickory_dead" ); +static const ter_str_id ter_trunk( "t_trunk" ); + +static const std::string part_location_structure( "structure" ); +static const std::string part_location_center( "center" ); +static const std::string part_location_onroof( "on_roof" ); + +static const std::string GUN_MODE_VAR_NAME( "item::mode" ); +static const std::string CLOTHING_MOD_VAR_PREFIX( "clothing_mod_" ); + +static const faction_id your_followers( "your_followers" ); +static const faction_id no_faction( "no_faction" ); + +static const std::string errstring( "ERROR" ); + +static const ammotype ammo_bolt( "bolt" ); +static const ammotype ammo_battery( "ammo_battery" ); +static const ammotype ammo_reactor_slurry( "reactor_slurry" ); +static const ammotype ammo_plutonium( "plutonium" ); + +const vitamin_id vitamin_iron( "iron" ); + +static const std::string null_item_id( "null" ); #endif // STRING_CONSTS_H diff --git a/src/cata_tiles.cpp b/src/cata_tiles.cpp index 98d1a6add8c17..ccd046a9817ae 100644 --- a/src/cata_tiles.cpp +++ b/src/cata_tiles.cpp @@ -62,6 +62,7 @@ #include "translations.h" #include "type_id.h" #include "game_constants.h" +#include "cata_string_consts.h" #define dbg(x) DebugLog((x),D_SDL) << __FILE__ << ":" << __LINE__ << ": " @@ -82,7 +83,6 @@ static const std::array multitile_keys = {{ extern int fontwidth; extern int fontheight; -static const efftype_id effect_ridden( "ridden" ); static const std::string empty_string; static const std::array TILE_CATEGORY_IDS = {{ "", // C_NONE, diff --git a/src/clzones.cpp b/src/clzones.cpp index a38ad5bf16b64..a339d6189d80b 100644 --- a/src/clzones.cpp +++ b/src/clzones.cpp @@ -34,6 +34,7 @@ #include "player.h" #include "vpart_position.h" #include "faction.h" +#include "cata_string_consts.h" zone_manager::zone_manager() { @@ -783,7 +784,7 @@ zone_type_id zone_manager::get_near_zone_type_for_item( const item &it, return zone_type_id( "LOOT_CUSTOM" ); } } - if( it.has_flag( "FIREWOOD" ) ) { + if( it.has_flag( flag_FIREWOOD ) ) { if( has_near( zone_type_id( "LOOT_WOOD" ), where, range ) ) { return zone_type_id( "LOOT_WOOD" ); } diff --git a/src/computer_session.cpp b/src/computer_session.cpp index 504991271587a..6bdb08a48b142 100644 --- a/src/computer_session.cpp +++ b/src/computer_session.cpp @@ -50,19 +50,7 @@ #include "translations.h" #include "trap.h" #include "type_id.h" - -static const mtype_id mon_manhack( "mon_manhack" ); -static const mtype_id mon_secubot( "mon_secubot" ); -static const mtype_id mon_turret_rifle( "mon_turret_rifle" ); -static const mtype_id mon_turret_bmg( "mon_turret_bmg" ); -static const mtype_id mon_crows_m240( "mon_crows_m240" ); - -static const skill_id skill_computer( "computer" ); - -static const species_id ZOMBIE( "ZOMBIE" ); -static const species_id HUMAN( "HUMAN" ); - -static const efftype_id effect_amigara( "amigara" ); +#include "cata_string_consts.h" static catacurses::window init_window() { @@ -1198,7 +1186,7 @@ void computer_session::failure_shutdown() { bool found_tile = false; for( const tripoint &p : g->m.points_in_radius( g->u.pos(), 1 ) ) { - if( g->m.has_flag( "CONSOLE", p ) ) { + if( g->m.has_flag( flag_CONSOLE, p ) ) { g->m.ter_set( p, t_console_broken ); add_msg( m_bad, _( "The console shuts down." ) ); found_tile = true; @@ -1208,7 +1196,7 @@ void computer_session::failure_shutdown() return; } for( const tripoint &p : g->m.points_on_zlevel() ) { - if( g->m.has_flag( "CONSOLE", p ) ) { + if( g->m.has_flag( flag_CONSOLE, p ) ) { g->m.ter_set( p, t_console_broken ); add_msg( m_bad, _( "The console shuts down." ) ); } diff --git a/src/condition.cpp b/src/condition.cpp index bed739ea36b68..1fc9d43d65cfd 100644 --- a/src/condition.cpp +++ b/src/condition.cpp @@ -28,8 +28,7 @@ #include "type_id.h" #include "vehicle.h" #include "vpart_position.h" - -static const efftype_id effect_currently_busy( "currently_busy" ); +#include "cata_string_consts.h" // throws an error on failure, so no need to return std::string get_talk_varname( const JsonObject &jo, const std::string &member, bool check_value ) diff --git a/src/construction.cpp b/src/construction.cpp index 6cd7efa6a7621..f81b7577f7852 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -52,21 +52,10 @@ #include "mtype.h" #include "point.h" #include "units.h" +#include "cata_string_consts.h" class inventory; -static const skill_id skill_fabrication( "fabrication" ); -static const skill_id skill_electronics( "electronics" ); - -static const trait_id trait_DEBUG_HS( "DEBUG_HS" ); -static const trait_id trait_PAINRESIST_TROGLO( "PAINRESIST_TROGLO" ); -static const trait_id trait_STOCKY_TROGLO( "STOCKY_TROGLO" ); -static const trait_id trait_SPIRITUAL( "SPIRITUAL" ); - -static const trap_str_id tr_firewood_source( "tr_firewood_source" ); -static const trap_str_id tr_practice_target( "tr_practice_target" ); -static const trap_str_id tr_unfinished_construction( "tr_unfinished_construction" ); - // Construction functions. namespace construct { @@ -832,7 +821,7 @@ void place_construction( const std::string &desc ) for( const auto &it : con.requirements->get_tools() ) { g->u.consume_tools( it ); } - g->u.assign_activity( activity_id( "ACT_BUILD" ) ); + g->u.assign_activity( ACT_BUILD ); g->u.activity.placement = g->m.getabs( pnt ); } @@ -923,15 +912,15 @@ void complete_construction( player *p ) built.post_special( terp ); // npcs will automatically resume backlog, players wont. if( p->is_player() && !p->backlog.empty() && - p->backlog.front().id() == activity_id( "ACT_MULTIPLE_CONSTRUCTION" ) ) { + p->backlog.front().id() == ACT_MULTIPLE_CONSTRUCTION ) { p->backlog.clear(); - p->assign_activity( activity_id( "ACT_MULTIPLE_CONSTRUCTION" ) ); + p->assign_activity( ACT_MULTIPLE_CONSTRUCTION ); } } bool construct::check_empty( const tripoint &p ) { - return ( g->m.has_flag( "FLAT", p ) && !g->m.has_furn( p ) && + return ( g->m.has_flag( flag_FLAT, p ) && !g->m.has_furn( p ) && g->is_empty( p ) && g->m.tr_at( p ).is_null() && g->m.i_at( p ).empty() && !g->m.veh_at( p ) ); } @@ -954,7 +943,7 @@ bool construct::check_support( const tripoint &p ) } int num_supports = 0; for( const tripoint &nb : get_orthogonal_neighbors( p ) ) { - if( g->m.has_flag( "SUPPORTS_ROOF", nb ) ) { + if( g->m.has_flag( flag_SUPPORTS_ROOF, nb ) ) { num_supports++; } } @@ -1032,7 +1021,7 @@ void construct::done_grave( const tripoint &p ) g->u.getID(), it.get_mtype()->id, it.get_corpse_name() ); } } - if( g->u.has_quality( quality_id( "CUT" ) ) ) { + if( g->u.has_quality( qual_CUT ) ) { iuse::handle_ground_graffiti( g->u, nullptr, _( "Inscribe something on the grave?" ), p ); } else { add_msg( m_neutral, @@ -1046,7 +1035,7 @@ static vpart_id vpart_from_item( const std::string &item_id ) { for( const auto &e : vpart_info::all() ) { const vpart_info &vp = e.second; - if( vp.item == item_id && vp.has_flag( "INITIAL_PART" ) ) { + if( vp.item == item_id && vp.has_flag( flag_INITIAL_PART ) ) { return vp.get_id(); } } @@ -1529,7 +1518,7 @@ void finalize_constructions() std::vector frame_items; for( const auto &e : vpart_info::all() ) { const vpart_info &vp = e.second; - if( !vp.has_flag( "INITIAL_PART" ) ) { + if( !vp.has_flag( flag_INITIAL_PART ) ) { continue; } frame_items.push_back( item_comp( vp.item, 1 ) ); diff --git a/src/consumption.cpp b/src/consumption.cpp index 3d9529349c287..86c2b2a840105 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -843,12 +843,12 @@ bool player::eat( item &food, bool force ) bool has_table_nearby = false; bool has_chair_nearby = false; for( const tripoint &pt : g->m.points_in_radius( pos(), 1 ) ) { - if( g->m.has_flag_furn( "FLAT_SURF", pt ) || g->m.has_flag( "FLAT_SURF", pt ) || + if( g->m.has_flag_furn( flag_FLAT_SURF, pt ) || g->m.has_flag( flag_FLAT_SURF, pt ) || ( g->m.veh_at( pt ) && ( g->m.veh_at( pt )->vehicle().has_part( "KITCHEN" ) || g->m.veh_at( pt )->vehicle().has_part( "FLAT_SURF" ) ) ) ) { has_table_nearby = true; } - if( g->m.has_flag_furn( "CAN_SIT", pt ) || g->m.has_flag( "CAN_SIT", pt ) || + if( g->m.has_flag_furn( flag_CAN_SIT, pt ) || g->m.has_flag( flag_CAN_SIT, pt ) || ( g->m.veh_at( pt ) && ( g->m.veh_at( pt )->vehicle().has_part( "SEAT" ) ) ) ) { has_chair_nearby = true; } diff --git a/src/craft_command.cpp b/src/craft_command.cpp index aee928dd36ef7..3cd4ff5d5379d 100644 --- a/src/craft_command.cpp +++ b/src/craft_command.cpp @@ -20,8 +20,7 @@ #include "translations.h" #include "uistate.h" #include "type_id.h" - -static const trait_id trait_DEBUG_HS( "DEBUG_HS" ); +#include "cata_string_consts.h" template std::string comp_selection::nname() const diff --git a/src/crafting.cpp b/src/crafting.cpp index 7cec55fba8e1a..647ae4f228835 100644 --- a/src/crafting.cpp +++ b/src/crafting.cpp @@ -742,7 +742,7 @@ void player::start_craft( craft_command &command, const tripoint &loc ) uilist amenu; amenu.text = string_format( pgettext( "in progress craft", "What to do with the %s?" ), craft.display_name() ); - amenu.addentry( WIELD_CRAFT, !weapon.has_flag( "NO_UNWIELD" ), '1', + amenu.addentry( WIELD_CRAFT, !weapon.has_flag( flag_NO_UNWIELD ), '1', _( "Dispose of your wielded %s and start working." ), weapon.tname() ); amenu.addentry( DROP_CRAFT, true, '2', _( "Put it down and start working." ) ); const bool can_stash = can_pickVolume( craft ) && @@ -870,12 +870,12 @@ double player::crafting_success_roll( const recipe &making ) const // farsightedness can impose a penalty on electronics and tailoring success // it's equivalent to a 2-rank electronics penalty, 1-rank tailoring - if( has_trait( trait_id( "HYPEROPIC" ) ) && !worn_with_flag( "FIX_FARSIGHT" ) && + if( has_trait( trait_HYPEROPIC ) && !worn_with_flag( flag_FIX_FARSIGHT ) && !has_effect( effect_contacts ) ) { int main_rank_penalty = 0; - if( making.skill_used == skill_id( "electronics" ) ) { + if( making.skill_used == skill_electronics ) { main_rank_penalty = 2; - } else if( making.skill_used == skill_id( "tailor" ) ) { + } else if( making.skill_used == skill_tailor ) { main_rank_penalty = 1; } skill_dice -= main_rank_penalty * 4; diff --git a/src/crafting_gui.cpp b/src/crafting_gui.cpp index 49f20f2af2e78..878c305810c73 100644 --- a/src/crafting_gui.cpp +++ b/src/crafting_gui.cpp @@ -34,6 +34,7 @@ #include "item.h" #include "recipe.h" #include "type_id.h" +#include "cata_string_consts.h" class inventory; class npc; @@ -605,8 +606,8 @@ const recipe *select_crafting_recipe( int &batch_size ) print_colored_text( w_data, point( xpos, ypos++ ), col, col, string_format( _( "Dark craftable? %s" ), - current[line]->has_flag( "BLIND_EASY" ) ? _( "Easy" ) : - current[line]->has_flag( "BLIND_HARD" ) ? _( "Hard" ) : + current[line]->has_flag( flag_BLIND_EASY ) ? _( "Easy" ) : + current[line]->has_flag( flag_BLIND_HARD ) ? _( "Hard" ) : _( "Impossible" ) ) ); if( available[line].can_craft && !available[line].can_craft_non_rotten ) { ypos += fold_and_print( w_data, point( xpos, ypos ), pane, col, diff --git a/src/creature.cpp b/src/creature.cpp index e4d52c83775fa..170a7584db752 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -40,22 +40,7 @@ #include "player.h" #include "string_id.h" #include "point.h" - -static const efftype_id effect_blind( "blind" ); -static const efftype_id effect_bounced( "bounced" ); -static const efftype_id effect_downed( "downed" ); -static const efftype_id effect_onfire( "onfire" ); -static const efftype_id effect_npc_suspend( "npc_suspend" ); -static const efftype_id effect_sap( "sap" ); -static const efftype_id effect_sleep( "sleep" ); -static const efftype_id effect_stunned( "stunned" ); -static const efftype_id effect_zapped( "zapped" ); -static const efftype_id effect_lying_down( "lying_down" ); -static const efftype_id effect_no_sight( "no_sight" ); -static const efftype_id effect_riding( "riding" ); -static const efftype_id effect_ridden( "ridden" ); -static const efftype_id effect_tied( "tied" ); -static const efftype_id effect_paralyzepoison( "paralyzepoison" ); +#include "cata_string_consts.h" const std::map Creature::size_map = { {"TINY", MS_TINY}, {"SMALL", MS_SMALL}, {"MEDIUM", MS_MEDIUM}, diff --git a/src/debug_menu.cpp b/src/debug_menu.cpp index 9e913c7bf0e6a..688abf7a991c8 100644 --- a/src/debug_menu.cpp +++ b/src/debug_menu.cpp @@ -85,6 +85,7 @@ #include "units.h" #include "weather_gen.h" #include "monstergenerator.h" +#include "cata_string_consts.h" class vehicle; @@ -93,7 +94,6 @@ class vehicle; #endif #define dbg(x) DebugLog((x),D_GAME) << __FILE__ << ":" << __LINE__ << ": " -static const efftype_id effect_flu( "flu" ); namespace debug_menu { @@ -1314,7 +1314,7 @@ void debug() for( monster &critter : g->all_monsters() ) { // Use the normal death functions, useful for testing death // and for getting a corpse. - if( critter.type->id != mtype_id( "mon_generator" ) ) { + if( critter.type->id != mon_generator ) { critter.die( nullptr ); } } diff --git a/src/descriptions.cpp b/src/descriptions.cpp index 5ee3d7fe96791..050c6db1e8d47 100644 --- a/src/descriptions.cpp +++ b/src/descriptions.cpp @@ -15,10 +15,7 @@ #include "color.h" #include "translations.h" #include "string_id.h" - -static const skill_id skill_survival( "survival" ); - -static const trait_id trait_ILLITERATE( "ILLITERATE" ); +#include "cata_string_consts.h" enum class description_target : int { creature, diff --git a/src/dump.cpp b/src/dump.cpp index cd4925156e094..34c85d62329cd 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -30,6 +30,7 @@ #include "output.h" #include "flat_set.h" #include "item.h" +#include "cata_string_consts.h" bool game::dump_stats( const std::string &what, dump_mode mode, const std::vector &opts ) @@ -120,7 +121,7 @@ bool game::dump_stats( const std::string &what, dump_mode mode, if( e->armor ) { item obj( e ); if( bp == num_bp || obj.covers( bp ) ) { - if( obj.has_flag( "VARSIZE" ) ) { + if( obj.has_flag( flag_VARSIZE ) ) { obj.item_tags.insert( "FIT" ); } dump( obj ); diff --git a/src/effect.cpp b/src/effect.cpp index 917f2fe2d621c..9fbe7fd2b9c48 100644 --- a/src/effect.cpp +++ b/src/effect.cpp @@ -15,6 +15,7 @@ #include "color.h" #include "enums.h" #include "units.h" +#include "cata_string_consts.h" namespace { @@ -41,8 +42,6 @@ bool string_id::is_valid() const return effect_types.count( *this ) > 0; } -static const efftype_id effect_weed_high( "weed_high" ); - void weed_msg( player &p ) { const time_duration howhigh = p.get_effect_dur( effect_weed_high ); @@ -167,9 +166,9 @@ void weed_msg( player &p ) // Real Life p.add_msg_if_player( _( "Man, a cheeseburger sounds SO awesome right now." ) ); p.mod_hunger( 4 ); - if( p.has_trait( trait_id( "VEGETARIAN" ) ) ) { + if( p.has_trait( trait_VEGETARIAN ) ) { p.add_msg_if_player( _( "Eh… maybe not." ) ); - } else if( p.has_trait( trait_id( "LACTOSE" ) ) ) { + } else if( p.has_trait( trait_LACTOSE ) ) { p.add_msg_if_player( _( "I guess, maybe, without the cheese… yeah." ) ); } return; @@ -1190,15 +1189,15 @@ const effect_type *effect::get_effect_type() const // This contains all the effects checked in move_effects // It's here and not in json because it is hardcoded anyway static const std::unordered_set hardcoded_movement_impairing = {{ - efftype_id( "beartrap" ), - efftype_id( "crushed" ), - efftype_id( "downed" ), - efftype_id( "grabbed" ), - efftype_id( "heavysnare" ), - efftype_id( "in_pit" ), - efftype_id( "lightsnare" ), - efftype_id( "tied" ), - efftype_id( "webbed" ), + effect_beartrap, + effect_crushed, + effect_downed, + effect_grabbed, + effect_heavysnare, + effect_in_pit, + effect_lightsnare, + effect_tied, + effect_webbed, } }; diff --git a/src/explosion.cpp b/src/explosion.cpp index 9be3dee1c9969..d37a55d7f32da 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -59,9 +59,7 @@ #include "mtype.h" #include "point.h" #include "type_id.h" - -static const itype_id null_itype( "null" ); -static const species_id ROBOT( "ROBOT" ); +#include "cata_string_consts.h" // Global to smuggle data into shrapnel_calc() function without replicating it across entire map. // Mass in kg @@ -84,7 +82,7 @@ explosion_data load_explosion_data( const JsonObject &jo ) if( jo.has_int( "shrapnel" ) ) { ret.shrapnel.casing_mass = jo.get_int( "shrapnel" ); ret.shrapnel.recovery = 0; - ret.shrapnel.drop = null_itype; + ret.shrapnel.drop = fuel_type_none; } else if( jo.has_object( "shrapnel" ) ) { auto shr = jo.get_object( "shrapnel" ); ret.shrapnel = load_shrapnel_data( shr ); @@ -523,27 +521,24 @@ void explosion( const tripoint &p, const explosion_data &ex ) void flashbang( const tripoint &p, bool player_immune ) { - const efftype_id effect_blind( "blind" ); - const efftype_id effect_deaf( "deaf" ); - draw_explosion( p, 8, c_white ); int dist = rl_dist( g->u.pos(), p ); if( dist <= 8 && !player_immune ) { - if( !g->u.has_bionic( bionic_id( "bio_ears" ) ) && !g->u.is_wearing( "rm13_armor_on" ) ) { + if( !g->u.has_bionic( bio_ears ) && !g->u.is_wearing( "rm13_armor_on" ) ) { g->u.add_effect( effect_deaf, time_duration::from_turns( 40 - dist * 4 ) ); } if( g->m.sees( g->u.pos(), p, 8 ) ) { int flash_mod = 0; - if( g->u.has_trait( trait_id( "PER_SLIME" ) ) ) { + if( g->u.has_trait( trait_PER_SLIME ) ) { if( one_in( 2 ) ) { flash_mod = 3; // Yay, you weren't looking! } - } else if( g->u.has_trait( trait_id( "PER_SLIME_OK" ) ) ) { + } else if( g->u.has_trait( trait_PER_SLIME_OK ) ) { flash_mod = 8; // Just retract those and extrude fresh eyes - } else if( g->u.has_bionic( bionic_id( "bio_sunglasses" ) ) || + } else if( g->u.has_bionic( bio_sunglasses ) || g->u.is_wearing( "rm13_armor_on" ) ) { flash_mod = 6; - } else if( g->u.worn_with_flag( "BLIND" ) || g->u.worn_with_flag( "FLASH_PROTECTION" ) ) { + } else if( g->u.worn_with_flag( flag_BLIND ) || g->u.worn_with_flag( flag_FLASH_PROTECTION ) ) { flash_mod = 3; // Not really proper flash protection, but better than nothing } g->u.add_env_effect( effect_blind, bp_eyes, ( 12 - flash_mod - dist ) / 2, @@ -558,7 +553,7 @@ void flashbang( const tripoint &p, bool player_immune ) dist = rl_dist( critter.pos(), p ); if( dist <= 8 ) { if( dist <= 4 ) { - critter.add_effect( efftype_id( "stunned" ), time_duration::from_turns( 10 - dist ) ); + critter.add_effect( effect_stunned, time_duration::from_turns( 10 - dist ) ); } if( critter.has_flag( MF_SEES ) && g->m.sees( critter.pos(), p, 8 ) ) { critter.add_effect( effect_blind, time_duration::from_turns( 18 - dist ) ); @@ -600,7 +595,7 @@ void shockwave( const tripoint &p, int radius, int force, int stun, int dam_mult } } if( rl_dist( g->u.pos(), p ) <= radius && !ignore_player && - ( !g->u.has_trait( trait_id( "LEG_TENT_BRACE" ) ) || g->u.footwear_factor() == 1 || + ( !g->u.has_trait( trait_LEG_TENT_BRACE ) || g->u.footwear_factor() == 1 || ( g->u.footwear_factor() == .5 && one_in( 2 ) ) ) ) { add_msg( m_bad, _( "You're caught in the shockwave!" ) ); g->knockback( p, g->u.pos(), force, stun, dam_mult ); @@ -700,7 +695,6 @@ void emp_blast( const tripoint &p ) } } } else if( critter.has_flag( MF_ELECTRIC_FIELD ) ) { - const efftype_id effect_emp( "emp" ); if( sight && !critter.has_effect( effect_emp ) ) { add_msg( m_good, _( "The %s's electrical field momentarily goes out!" ), critter.name() ); critter.add_effect( effect_emp, 3_minutes ); @@ -750,7 +744,7 @@ void resonance_cascade( const tripoint &p ) if( maxglow > 0_turns ) { const time_duration minglow = std::max( 0_turns, time_duration::from_turns( 60 - 5 * trig_dist( p, g->u.pos() ) ) ); - g->u.add_effect( efftype_id( "teleglow" ), rng( minglow, maxglow ) * 100 ); + g->u.add_effect( effect_teleglow, rng( minglow, maxglow ) * 100 ); } int startx = ( p.x < 8 ? 0 : p.x - 8 ), endx = ( p.x + 8 >= SEEX * 3 ? SEEX * 3 - 1 : p.x + 8 ); int starty = ( p.y < 8 ? 0 : p.y - 8 ), endy = ( p.y + 8 >= SEEY * 3 ? SEEY * 3 - 1 : p.y + 8 ); @@ -807,7 +801,7 @@ void resonance_cascade( const tripoint &p ) case 13: case 14: case 15: - spawn_details = MonsterGroupManager::GetResultFromGroup( mongroup_id( "GROUP_NETHER" ) ); + spawn_details = MonsterGroupManager::GetResultFromGroup( GROUP_NETHER ); g->place_critter_at( spawn_details.name, dest ); break; case 16: diff --git a/src/faction_camp.cpp b/src/faction_camp.cpp index 9c21a2d24d1c1..fd3642b0dd0c8 100644 --- a/src/faction_camp.cpp +++ b/src/faction_camp.cpp @@ -73,25 +73,7 @@ #include "point.h" #include "vpart_position.h" #include "weather.h" - -static const skill_id skill_dodge( "dodge" ); -static const skill_id skill_gun( "gun" ); -static const skill_id skill_unarmed( "unarmed" ); -static const skill_id skill_cutting( "cutting" ); -static const skill_id skill_stabbing( "stabbing" ); -static const skill_id skill_bashing( "bashing" ); -static const skill_id skill_melee( "melee" ); -static const skill_id skill_fabrication( "fabrication" ); -static const skill_id skill_survival( "survival" ); -static const skill_id skill_mechanics( "mechanics" ); -static const skill_id skill_speech( "speech" ); -static const skill_id skill_traps( "traps" ); -static const skill_id skill_swimming( "swimming" ); - -static const trait_id trait_DEBUG_HS( "DEBUG_HS" ); - -static const zone_type_id z_camp_storage( "CAMP_STORAGE" ); -static const zone_type_id z_camp_food( "CAMP_FOOD" ); +#include "cata_string_consts.h" struct mass_volume { units::mass wgt; @@ -1702,7 +1684,7 @@ void basecamp::start_menial_labor() } validate_sort_points(); - comp->assign_activity( activity_id( "ACT_MOVE_LOOT" ) ); + comp->assign_activity( ACT_MOVE_LOOT ); popup( _( "%s goes off to clean toilets and sort loot." ), comp->disp_name() ); } @@ -2093,7 +2075,7 @@ static std::pair farm_action( const tripoint &omt_tgt, farm }; const auto is_unplowed = []( const tripoint & pos, tinymap & farm_map ) { const ter_id &farm_ter = farm_map.ter( pos ); - return farm_ter->has_flag( "PLOWABLE" ); + return farm_ter->has_flag( flag_PLOWABLE ); }; std::set plant_names; @@ -2880,42 +2862,42 @@ void basecamp::hunting_results( int skill, const std::string &task, int attempts { // no item groups for corpses, so we'll have to improvise weighted_int_list hunting_targets; - hunting_targets.add( mtype_id( "mon_beaver" ), 10 ); - hunting_targets.add( mtype_id( "mon_fox_red" ), 10 ); - hunting_targets.add( mtype_id( "mon_fox_gray" ), 10 ); - hunting_targets.add( mtype_id( "mon_mink" ), 5 ); - hunting_targets.add( mtype_id( "mon_muskrat" ), 10 ); - hunting_targets.add( mtype_id( "mon_otter" ), 10 ); - hunting_targets.add( mtype_id( "mon_duck" ), 10 ); - hunting_targets.add( mtype_id( "mon_cockatrice" ), 1 ); + hunting_targets.add( mon_beaver, 10 ); + hunting_targets.add( mon_fox_red, 10 ); + hunting_targets.add( mon_fox_gray, 10 ); + hunting_targets.add( mon_mink, 5 ); + hunting_targets.add( mon_muskrat, 10 ); + hunting_targets.add( mon_otter, 10 ); + hunting_targets.add( mon_duck, 10 ); + hunting_targets.add( mon_cockatrice, 1 ); if( task == "_faction_camp_trapping" ) { - hunting_targets.add( mtype_id( "mon_black_rat" ), 40 ); - hunting_targets.add( mtype_id( "mon_chipmunk" ), 30 ); - hunting_targets.add( mtype_id( "mon_groundhog" ), 30 ); - hunting_targets.add( mtype_id( "mon_hare" ), 20 ); - hunting_targets.add( mtype_id( "mon_lemming" ), 40 ); - hunting_targets.add( mtype_id( "mon_opossum" ), 10 ); - hunting_targets.add( mtype_id( "mon_rabbit" ), 20 ); - hunting_targets.add( mtype_id( "mon_squirrel" ), 20 ); - hunting_targets.add( mtype_id( "mon_weasel" ), 20 ); - hunting_targets.add( mtype_id( "mon_chicken" ), 10 ); - hunting_targets.add( mtype_id( "mon_grouse" ), 10 ); - hunting_targets.add( mtype_id( "mon_pheasant" ), 10 ); - hunting_targets.add( mtype_id( "mon_turkey" ), 20 ); + hunting_targets.add( mon_black_rat, 40 ); + hunting_targets.add( mon_chipmunk, 30 ); + hunting_targets.add( mon_groundhog, 30 ); + hunting_targets.add( mon_hare, 20 ); + hunting_targets.add( mon_lemming, 40 ); + hunting_targets.add( mon_opossum, 10 ); + hunting_targets.add( mon_rabbit, 20 ); + hunting_targets.add( mon_squirrel, 20 ); + hunting_targets.add( mon_weasel, 20 ); + hunting_targets.add( mon_chicken, 10 ); + hunting_targets.add( mon_grouse, 10 ); + hunting_targets.add( mon_pheasant, 10 ); + hunting_targets.add( mon_turkey, 20 ); } else if( task == "_faction_camp_hunting" ) { - hunting_targets.add( mtype_id( "mon_chicken" ), 20 ); + hunting_targets.add( mon_chicken, 20 ); // good luck hunting upland game birds without dogs - hunting_targets.add( mtype_id( "mon_grouse" ), 2 ); - hunting_targets.add( mtype_id( "mon_pheasant" ), 2 ); - hunting_targets.add( mtype_id( "mon_turkey" ), 10 ); - hunting_targets.add( mtype_id( "mon_bear" ), 1 ); - hunting_targets.add( mtype_id( "mon_cougar" ), 5 ); - hunting_targets.add( mtype_id( "mon_cow" ), 1 ); - hunting_targets.add( mtype_id( "mon_coyote" ), 15 ); - hunting_targets.add( mtype_id( "mon_deer" ), 2 ); - hunting_targets.add( mtype_id( "mon_moose" ), 1 ); - hunting_targets.add( mtype_id( "mon_pig" ), 1 ); - hunting_targets.add( mtype_id( "mon_wolf" ), 10 ); + hunting_targets.add( mon_grouse, 2 ); + hunting_targets.add( mon_pheasant, 2 ); + hunting_targets.add( mon_turkey, 10 ); + hunting_targets.add( mon_bear, 1 ); + hunting_targets.add( mon_cougar, 5 ); + hunting_targets.add( mon_cow, 1 ); + hunting_targets.add( mon_coyote, 15 ); + hunting_targets.add( mon_deer, 2 ); + hunting_targets.add( mon_moose, 1 ); + hunting_targets.add( mon_pig, 1 ); + hunting_targets.add( mon_wolf, 10 ); } for( int i = 0; i < attempts; i++ ) { if( skill > rng( 0, difficulty ) ) { @@ -3033,7 +3015,7 @@ int om_cutdown_trees( const tripoint &omt_tgt, int chance, bool estimate, bool f tripoint mapmin = tripoint( 0, 0, omt_tgt.z ); tripoint mapmax = tripoint( 2 * SEEX - 1, 2 * SEEY - 1, omt_tgt.z ); for( const tripoint &p : target_bay.points_in_rectangle( mapmin, mapmax ) ) { - if( target_bay.ter( p ).obj().has_flag( "TREE" ) && rng( 0, 100 ) < chance ) { + if( target_bay.ter( p ).obj().has_flag( flag_TREE ) && rng( 0, 100 ) < chance ) { total++; if( estimate ) { continue; diff --git a/src/fungal_effects.cpp b/src/fungal_effects.cpp index b69d942ed8fd4..5cb1c65ad39ad 100644 --- a/src/fungal_effects.cpp +++ b/src/fungal_effects.cpp @@ -28,14 +28,7 @@ #include "debug.h" #include "point.h" #include "string_formatter.h" - -static const mtype_id mon_fungal_blossom( "mon_fungal_blossom" ); -static const mtype_id mon_spore( "mon_spore" ); - -static const efftype_id effect_stunned( "stunned" ); -static const efftype_id effect_spores( "spores" ); - -static const species_id FUNGUS( "FUNGUS" ); +#include "cata_string_consts.h" fungal_effects::fungal_effects( game &g, map &mp ) : gm( g ), m( mp ) @@ -61,8 +54,8 @@ void fungal_effects::fungalize( const tripoint &p, Creature *origin, double spor ///\EFFECT_DEX increases chance of knocking fungal spores away with your TAIL_CATTLE ///\EFFECT_MELEE increases chance of knocking fungal sports away with your TAIL_CATTLE - if( pl.has_trait( trait_id( "TAIL_CATTLE" ) ) && - one_in( 20 - pl.dex_cur - pl.get_skill_level( skill_id( "melee" ) ) ) ) { + if( pl.has_trait( trait_TAIL_CATTLE ) && + one_in( 20 - pl.dex_cur - pl.get_skill_level( skill_melee ) ) ) { pl.add_msg_if_player( _( "The spores land on you, but you quickly swat them off with your tail!" ) ); return; @@ -84,7 +77,7 @@ void fungal_effects::fungalize( const tripoint &p, Creature *origin, double spor if( origin_mon != nullptr ) { spore->make_ally( *origin_mon ); } else if( origin != nullptr && origin->is_player() && - gm.u.has_trait( trait_id( "THRESH_MYCUS" ) ) ) { + gm.u.has_trait( trait_THRESH_MYCUS ) ) { spore->friendly = 1000; } } @@ -109,7 +102,7 @@ void fungal_effects::marlossify( const tripoint &p ) return; } for( int i = 0; i < 25; i++ ) { - bool is_fungi = m.has_flag_ter( "FUNGUS", p ); + bool is_fungi = m.has_flag_ter( flag_FUNGUS, p ); spread_fungus( p ); if( is_fungi ) { return; @@ -121,12 +114,12 @@ void fungal_effects::spread_fungus_one_tile( const tripoint &p, const int growth { bool converted = false; // Terrain conversion - if( m.has_flag_ter( "DIGGABLE", p ) ) { + if( m.has_flag_ter( flag_DIGGABLE, p ) ) { if( x_in_y( growth * 10, 100 ) ) { m.ter_set( p, t_fungus ); converted = true; } - } else if( m.has_flag( "FLAT", p ) ) { + } else if( m.has_flag( flag_FLAT, p ) ) { if( m.has_flag( TFLAG_INDOORS, p ) ) { if( x_in_y( growth * 10, 500 ) ) { m.ter_set( p, t_fungus_floor_in ); @@ -143,7 +136,7 @@ void fungal_effects::spread_fungus_one_tile( const tripoint &p, const int growth converted = true; } } - } else if( m.has_flag( "SHRUB", p ) ) { + } else if( m.has_flag( flag_SHRUB, p ) ) { if( x_in_y( growth * 10, 200 ) ) { m.ter_set( p, t_shrub_fungal ); converted = true; @@ -151,12 +144,12 @@ void fungal_effects::spread_fungus_one_tile( const tripoint &p, const int growth m.ter_set( p, t_marloss ); converted = true; } - } else if( m.has_flag( "THIN_OBSTACLE", p ) ) { + } else if( m.has_flag( flag_THIN_OBSTACLE, p ) ) { if( x_in_y( growth * 10, 150 ) ) { m.ter_set( p, t_fungus_mound ); converted = true; } - } else if( m.has_flag( "YOUNG", p ) ) { + } else if( m.has_flag( flag_YOUNG, p ) ) { if( x_in_y( growth * 10, 500 ) ) { if( m.get_field_intensity( p, fd_fungal_haze ) != 0 ) { if( x_in_y( growth * 10, 800 ) ) { // young trees are vulnerable @@ -172,7 +165,7 @@ void fungal_effects::spread_fungus_one_tile( const tripoint &p, const int growth } converted = true; } - } else if( m.has_flag( "TREE", p ) ) { + } else if( m.has_flag( flag_TREE, p ) ) { if( one_in( 10 ) ) { if( m.get_field_intensity( p, fd_fungal_haze ) != 0 ) { if( x_in_y( growth * 10, 100 ) ) { @@ -188,7 +181,7 @@ void fungal_effects::spread_fungus_one_tile( const tripoint &p, const int growth } converted = true; } - } else if( m.has_flag( "WALL", p ) && m.has_flag( "FLAMMABLE", p ) ) { + } else if( m.has_flag( flag_WALL, p ) && m.has_flag( flag_FLAMMABLE, p ) ) { if( x_in_y( growth * 10, 5000 ) ) { m.ter_set( p, t_fungus_wall ); converted = true; @@ -196,15 +189,15 @@ void fungal_effects::spread_fungus_one_tile( const tripoint &p, const int growth } // Furniture conversion if( converted ) { - if( m.has_flag( "FLOWER", p ) ) { + if( m.has_flag( flag_FLOWER, p ) ) { m.furn_set( p, f_flower_fungal ); - } else if( m.has_flag( "ORGANIC", p ) ) { + } else if( m.has_flag( flag_ORGANIC, p ) ) { if( m.furn( p ).obj().movecost == -10 ) { m.furn_set( p, f_fungal_mass ); } else { m.furn_set( p, f_fungal_clump ); } - } else if( m.has_flag( "PLANT", p ) ) { + } else if( m.has_flag( flag_PLANT, p ) ) { // Replace the (already existing) seed // Can't use item_stack::only_item() since there might be fertilizer map_stack items = m.i_at( p ); @@ -228,12 +221,12 @@ void fungal_effects::spread_fungus( const tripoint &p ) if( tmp == p ) { continue; } - if( m.has_flag( "FUNGUS", tmp ) ) { + if( m.has_flag( flag_FUNGUS, tmp ) ) { growth += 1; } } - if( !m.has_flag_ter( "FUNGUS", p ) ) { + if( !m.has_flag_ter( flag_FUNGUS, p ) ) { spread_fungus_one_tile( p, growth ); } else { // Everything is already fungus @@ -242,7 +235,7 @@ void fungal_effects::spread_fungus( const tripoint &p ) } for( const tripoint &dest : g->m.points_in_radius( p, 1 ) ) { // One spread on average - if( !m.has_flag( "FUNGUS", dest ) && one_in( 9 - growth ) ) { + if( !m.has_flag( flag_FUNGUS, dest ) && one_in( 9 - growth ) ) { //growth chance is 100 in X simplified spread_fungus_one_tile( dest, 10 ); } diff --git a/src/game_inventory.cpp b/src/game_inventory.cpp index a39167751147c..146967d8fa1aa 100644 --- a/src/game_inventory.cpp +++ b/src/game_inventory.cpp @@ -46,16 +46,7 @@ #include "units.h" #include "type_id.h" #include "point.h" - -static const efftype_id effect_assisted( "assisted" ); - -static const skill_id skill_computer( "computer" ); -static const skill_id skill_electronics( "electronics" ); -static const skill_id skill_firstaid( "firstaid" ); - -static const trait_id trait_NOPAIN( "NOPAIN" ); -static const trait_id trait_SAPROPHAGE( "SAPROPHAGE" ); -static const trait_id trait_SAPROVORE( "SAPROVORE" ); +#include "cata_string_consts.h" class Character; @@ -118,10 +109,10 @@ static item_location inv_internal( player &u, const inventory_selector_preset &p bool init_selection = false; const std::vector consuming { - activity_id( "ACT_EAT_MENU" ), - activity_id( "ACT_CONSUME_FOOD_MENU" ), - activity_id( "ACT_CONSUME_DRINK_MENU" ), - activity_id( "ACT_CONSUME_MEDS_MENU" ) }; + ACT_EAT_MENU, + ACT_CONSUME_FOOD_MENU, + ACT_CONSUME_DRINK_MENU, + ACT_CONSUME_MEDS_MENU }; if( u.has_activity( consuming ) && u.activity.values.size() >= 2 ) { init_pair.first = u.activity.values[0]; @@ -455,7 +446,7 @@ class comestible_inventory_preset : public inventory_selector_preset append_cell( [ &p, this ]( const item_location & loc ) { const item &it = get_consumable_item( loc ); - if( it.has_flag( "MUSHY" ) ) { + if( it.has_flag( flag_MUSHY ) ) { return highlight_good_bad_none( p.fun_for( get_consumable_item( loc ) ).first ); } else { return good_bad_none( p.fun_for( get_consumable_item( loc ) ).first ); @@ -548,7 +539,7 @@ class comestible_inventory_preset : public inventory_selector_preset const item &med = !( *loc ).is_container_empty() && ( *loc ).get_contained().is_medication() && ( *loc ).get_contained().type->has_use() ? ( *loc ).get_contained() : *loc; - if( loc->made_of_from_type( LIQUID ) && !g->m.has_flag( "LIQUIDCONT", loc.position() ) ) { + if( loc->made_of_from_type( LIQUID ) && !g->m.has_flag( flag_LIQUIDCONT, loc.position() ) ) { return _( "Can't drink spilt liquids" ); } @@ -685,8 +676,8 @@ static std::string get_consume_needs_hint( player &p ) item_location game_menus::inv::consume( player &p ) { - if( !g->u.has_activity( activity_id( "ACT_EAT_MENU" ) ) ) { - g->u.assign_activity( activity_id( "ACT_EAT_MENU" ) ); + if( !g->u.has_activity( ACT_EAT_MENU ) ) { + g->u.assign_activity( ACT_EAT_MENU ); } return inv_internal( p, comestible_inventory_preset( p ), @@ -712,13 +703,13 @@ class comestible_filtered_inventory_preset : public comestible_inventory_preset item_location game_menus::inv::consume_food( player &p ) { - if( !g->u.has_activity( activity_id( "ACT_CONSUME_FOOD_MENU" ) ) ) { - g->u.assign_activity( activity_id( "ACT_CONSUME_FOOD_MENU" ) ); + if( !g->u.has_activity( ACT_CONSUME_FOOD_MENU ) ) { + g->u.assign_activity( ACT_CONSUME_FOOD_MENU ); } return inv_internal( p, comestible_filtered_inventory_preset( p, []( const item & it ) { return ( it.is_comestible() && it.get_comestible()->comesttype == "FOOD" ) || - it.has_flag( "USE_EAT_VERB" ); + it.has_flag( flag_USE_EAT_VERB ); } ), _( "Consume food" ), 1, _( "You have no food to consume." ), @@ -727,13 +718,13 @@ item_location game_menus::inv::consume_food( player &p ) item_location game_menus::inv::consume_drink( player &p ) { - if( !g->u.has_activity( activity_id( "ACT_CONSUME_DRINK_MENU" ) ) ) { - g->u.assign_activity( activity_id( "ACT_CONSUME_DRINK_MENU" ) ); + if( !g->u.has_activity( ACT_CONSUME_DRINK_MENU ) ) { + g->u.assign_activity( ACT_CONSUME_DRINK_MENU ); } return inv_internal( p, comestible_filtered_inventory_preset( p, []( const item & it ) { return it.is_comestible() && it.get_comestible()->comesttype == "DRINK" && - !it.has_flag( "USE_EAT_VERB" ); + !it.has_flag( flag_USE_EAT_VERB ); } ), _( "Consume drink" ), 1, _( "You have no drink to consume." ), @@ -742,8 +733,8 @@ item_location game_menus::inv::consume_drink( player &p ) item_location game_menus::inv::consume_meds( player &p ) { - if( !g->u.has_activity( activity_id( "ACT_CONSUME_MEDS_MENU" ) ) ) { - g->u.assign_activity( activity_id( "ACT_CONSUME_MEDS_MENU" ) ); + if( !g->u.has_activity( ACT_CONSUME_MEDS_MENU ) ) { + g->u.assign_activity( ACT_CONSUME_MEDS_MENU ); } return inv_internal( p, comestible_filtered_inventory_preset( p, []( const item & it ) { @@ -798,7 +789,7 @@ class activatable_inventory_preset : public pickup_inventory_preset loc->ammo_required() ); } - if( !it.has_flag( "ALLOWS_REMOTE_USE" ) ) { + if( !it.has_flag( flag_ALLOWS_REMOTE_USE ) ) { return pickup_inventory_preset::get_denial( loc ); } @@ -1506,15 +1497,15 @@ static item_location autodoc_internal( player &u, player &patient, if( !surgeon ) {//surgeon use their own anesthetic, player just need money if( patient.has_trait( trait_NOPAIN ) ) { hint = _( "Patient has Deadened nerves. Anesthesia unneeded." ); - } else if( patient.has_bionic( bionic_id( "bio_painkiller" ) ) ) { + } else if( patient.has_bionic( bio_painkiller ) ) { hint = _( "Patient has Sensory Dulling CBM installed. Anesthesia unneeded." ); } else { const inventory &crafting_inv = u.crafting_inventory(); std::vector a_filter = crafting_inv.items_with( []( const item & it ) { - return it.has_quality( quality_id( "ANESTHESIA" ) ); + return it.has_quality( qual_ANESTHESIA ); } ); std::vector b_filter = crafting_inv.items_with( []( const item & it ) { - return it.has_flag( "ANESTHESIA" ); // legacy + return it.has_flag( flag_ANESTHESIA ); // legacy } ); for( const item *anesthesia_item : a_filter ) { if( anesthesia_item->ammo_remaining() >= 1 ) { @@ -1602,10 +1593,10 @@ class bionic_install_preset: public inventory_selector_preset const itype *itemtype = it->type; const bionic_id &bid = itemtype->bionic->id; - if( it->has_flag( "FILTHY" ) ) { + if( it->has_flag( flag_FILTHY ) ) { // NOLINTNEXTLINE(cata-text-style): single space after the period for symmetry return _( "/!\\ CBM is highly contaminated. /!\\" ); - } else if( it->has_flag( "NO_STERILE" ) ) { + } else if( it->has_flag( flag_NO_STERILE ) ) { // NOLINTNEXTLINE(cata-text-style): single space after the period for symmetry return _( "/!\\ CBM is not sterile. /!\\ Please use autoclave to sterilize." ); } else if( it->has_fault( fault_id( "fault_bionic_salvaged" ) ) ) { @@ -1664,7 +1655,7 @@ class bionic_install_preset: public inventory_selector_preset -1 ); if( ( get_option < bool > ( "SAFE_AUTODOC" ) ) || - g->u.has_trait( trait_id( "DEBUG_BIONICS" ) ) ) { + g->u.has_trait( trait_DEBUG_BIONICS ) ) { chance_of_failure = 0; } else { float skill_difficulty_parameter = static_cast( ( adjusted_skill + assist_bonus ) / @@ -1685,7 +1676,7 @@ class bionic_install_preset: public inventory_selector_preset std::vector b_filter = p.crafting_inventory().items_with( []( const item & it ) { // Legacy - return it.has_flag( "ANESTHESIA" ); + return it.has_flag( flag_ANESTHESIA ); } ); if( !b_filter.empty() ) { @@ -1725,11 +1716,11 @@ class bionic_install_surgeon_preset : public inventory_selector_preset const itype *itemtype = it->type; const bionic_id &bid = itemtype->bionic->id; - if( it->has_flag( "FILTHY" ) ) { + if( it->has_flag( flag_FILTHY ) ) { return _( "CBM is filthy." ); - } else if( it->has_flag( "NO_STERILE" ) ) { + } else if( it->has_flag( flag_NO_STERILE ) ) { return _( "CBM is not sterile." ); - } else if( it->has_fault( fault_id( "fault_bionic_salvaged" ) ) ) { + } else if( it->has_fault( fault_bionic_salvaged ) ) { return _( "CBM is already deployed." ); } else if( pa.has_bionic( bid ) ) { return _( "CBM is already installed." ); @@ -1776,7 +1767,7 @@ class bionic_install_surgeon_preset : public inventory_selector_preset 20 ); if( ( get_option < bool >( "SAFE_AUTODOC" ) ) || - g->u.has_trait( trait_id( "DEBUG_BIONICS" ) ) ) { + g->u.has_trait( trait_DEBUG_BIONICS ) ) { chance_of_failure = 0; } else { float skill_difficulty_parameter = static_cast( ( adjusted_skill + assist_bonus ) / @@ -1823,7 +1814,7 @@ class bionic_uninstall_preset : public inventory_selector_preset } bool is_shown( const item_location &loc ) const override { - return loc->has_flag( "IN_CBM" ); + return loc->has_flag( flag_IN_CBM ); } std::string get_denial( const item_location &loc ) const override { @@ -1867,7 +1858,7 @@ class bionic_uninstall_preset : public inventory_selector_preset -1 ); if( ( get_option < bool >( "SAFE_AUTODOC" ) ) || - g->u.has_trait( trait_id( "DEBUG_BIONICS" ) ) ) { + g->u.has_trait( trait_DEBUG_BIONICS ) ) { chance_of_failure = 0; } else { float skill_difficulty_parameter = static_cast( ( adjusted_skill + assist_bonus ) / @@ -1887,7 +1878,7 @@ class bionic_uninstall_preset : public inventory_selector_preset duration * weight; std::vector b_filter = p.crafting_inventory().items_with( []( const item & it ) { - return it.has_flag( "ANESTHESIA" ); // legacy + return it.has_flag( flag_ANESTHESIA ); // legacy } ); if( !b_filter.empty() ) { @@ -1920,15 +1911,15 @@ class bionic_sterilize_preset : public inventory_selector_preset } bool is_shown( const item_location &loc ) const override { - return loc->has_flag( "NO_STERILE" ) && loc->is_bionic(); + return loc->has_flag( flag_NO_STERILE ) && loc->is_bionic(); } std::string get_denial( const item_location &loc ) const override { auto reqs = *requirement_id( "autoclave_item" ); - if( loc.get_item()->has_flag( "FILTHY" ) ) { + if( loc.get_item()->has_flag( flag_FILTHY ) ) { return _( "CBM is filthy. Wash it first." ); } - if( loc.get_item()->has_flag( "NO_PACKED" ) ) { + if( loc.get_item()->has_flag( flag_NO_PACKED ) ) { return _( "You should put this CBM in an autoclave pouch to keep it sterile." ); } if( !reqs.can_make_with_inventory( p.crafting_inventory(), is_crafting_component ) ) { diff --git a/src/gamemode_defense.cpp b/src/gamemode_defense.cpp index 9fb4ddedaa64a..dc26e58211ba0 100644 --- a/src/gamemode_defense.cpp +++ b/src/gamemode_defense.cpp @@ -33,6 +33,7 @@ #include "string_id.h" #include "point.h" #include "weather.h" +#include "cata_string_consts.h" #define SPECIAL_WAVE_CHANCE 5 // One in X chance of single-flavor wave #define SPECIAL_WAVE_MIN 5 // Don't use a special wave with < X monsters @@ -43,15 +44,6 @@ #define NUMALIGN(n) ((n) >= 10000 ? 20 : ((n) >= 1000 ? 21 :\ ((n) >= 100 ? 22 : ((n) >= 10 ? 23 : 24)))) -static const skill_id skill_barter( "barter" ); - -static const mongroup_id GROUP_NETHER = mongroup_id( "GROUP_NETHER" ); -static const mongroup_id GROUP_ROBOT = mongroup_id( "GROUP_ROBOT" ); -static const mongroup_id GROUP_SPIDER = mongroup_id( "GROUP_SPIDER" ); -static const mongroup_id GROUP_TRIFFID = mongroup_id( "GROUP_TRIFFID" ); -static const mongroup_id GROUP_VANILLA = mongroup_id( "GROUP_VANILLA" ); -static const mongroup_id GROUP_ZOMBIE = mongroup_id( "GROUP_ZOMBIE" ); - std::string caravan_category_name( caravan_category cat ); std::vector caravan_items( caravan_category cat ); std::set monflags_to_add; diff --git a/src/gamemode_tutorial.cpp b/src/gamemode_tutorial.cpp index b3e36b3dd3d7e..e669d1bf99b98 100644 --- a/src/gamemode_tutorial.cpp +++ b/src/gamemode_tutorial.cpp @@ -31,8 +31,7 @@ #include "type_id.h" #include "point.h" #include "weather.h" - -static const mtype_id mon_zombie( "mon_zombie" ); +#include "cata_string_consts.h" static std::vector tut_text; @@ -78,12 +77,12 @@ bool tutorial_game::init() starting_om.ter_set( lp + tripoint_below, oter_id( "tutorial" ) ); starting_om.clear_mon_groups(); - g->u.toggle_trait( trait_id( "QUICK" ) ); + g->u.toggle_trait( trait_QUICK ); item lighter( "lighter", 0 ); lighter.invlet = 'e'; g->u.inv.add_item( lighter, true, false ); - g->u.set_skill_level( skill_id( "gun" ), 5 ); - g->u.set_skill_level( skill_id( "melee" ), 5 ); + g->u.set_skill_level( skill_gun, 5 ); + g->u.set_skill_level( skill_melee, 5 ); g->load_map( omt_to_sm_copy( lp ) ); g->u.setx( 2 ); g->u.sety( 4 ); diff --git a/src/gates.cpp b/src/gates.cpp index cb15acaac4ec9..8addeb83f991b 100644 --- a/src/gates.cpp +++ b/src/gates.cpp @@ -31,6 +31,7 @@ #include "type_id.h" #include "colony.h" #include "point.h" +#include "cata_string_consts.h" // Gates namespace @@ -241,7 +242,7 @@ void gates::open_gate( const tripoint &pos, player &p ) const gate_data &gate = gates_data.obj( gid ); p.add_msg_if_player( gate.pull_message ); - p.assign_activity( activity_id( "ACT_OPEN_GATE" ), gate.moves ); + p.assign_activity( ACT_OPEN_GATE, gate.moves ); p.activity.placement = pos; } @@ -319,7 +320,7 @@ void doors::close_door( map &m, Character &who, const tripoint &closep ) items_in_way.size() == 1 ? items_in_way.only_item().tname() : _( "stuff" ) ); who.mod_moves( -std::min( items_in_way.stored_volume() / ( max_nudge / 50 ), 100 ) ); - if( m.has_flag( "NOITEM", closep ) ) { + if( m.has_flag( flag_NOITEM, closep ) ) { // Just plopping items back on their origin square will displace them to adjacent squares // since the door is closed now. for( auto &elem : items_in_way ) { diff --git a/src/grab.cpp b/src/grab.cpp index 5653d741715f0..32351009b2389 100644 --- a/src/grab.cpp +++ b/src/grab.cpp @@ -14,8 +14,7 @@ #include "tileray.h" #include "translations.h" #include "units.h" - -static const efftype_id effect_harnessed( "harnessed" ); +#include "cata_string_consts.h" bool game::grabbed_veh_move( const tripoint &dp ) { diff --git a/src/handle_action.cpp b/src/handle_action.cpp index 2cbe73f350823..7e3434c0bede9 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -66,20 +66,10 @@ #include "units.h" #include "string_id.h" #include "item.h" +#include "cata_string_consts.h" #define dbg(x) DebugLog((x),D_GAME) << __FILE__ << ":" << __LINE__ << ": " -static const efftype_id effect_alarm_clock( "alarm_clock" ); -static const efftype_id effect_laserlocked( "laserlocked" ); -static const efftype_id effect_relax_gas( "relax_gas" ); - -static const bionic_id bio_remote( "bio_remote" ); - -static const trait_id trait_HIBERNATE( "HIBERNATE" ); -static const trait_id trait_SHELL2( "SHELL2" ); - -static const skill_id skill_melee( "melee" ); - #if defined(__ANDROID__) extern std::map> quick_shortcuts_map; extern bool add_best_key_for_action_to_quick_shortcuts( action_id action, @@ -510,7 +500,7 @@ static void open() if( !didit ) { const ter_str_id tid = m.ter( openp ).id(); - if( m.has_flag( "LOCKED", openp ) ) { + if( m.has_flag( flag_LOCKED, openp ) ) { add_msg( m_info, _( "The door is locked!" ) ); return; } else if( tid.obj().close ) { @@ -693,7 +683,7 @@ static void smash() if( maybe_corpse.is_corpse() && maybe_corpse.damage() < maybe_corpse.max_damage() && maybe_corpse.get_mtype()->has_flag( MF_REVIVES ) ) { // do activity forever. ACT_PULP stops itself - u.assign_activity( activity_id( "ACT_PULP" ), calendar::INDEFINITELY_LONG, 0 ); + u.assign_activity( ACT_PULP, calendar::INDEFINITELY_LONG, 0 ); u.activity.placement = g->m.getabs( smashp ); return; // don't smash terrain if we've smashed a corpse } @@ -887,11 +877,11 @@ static void wait() // Waiting activity_id actType; if( as_m.ret == 11 ) { - actType = activity_id( "ACT_WAIT_WEATHER" ); + actType = ACT_WAIT_WEATHER; } else if( as_m.ret == 12 ) { - actType = activity_id( "ACT_WAIT_STAMINA" ); + actType = ACT_WAIT_STAMINA; } else { - actType = activity_id( "ACT_WAIT" ); + actType = ACT_WAIT; } player_activity new_act( actType, 100 * ( to_turns( time_to_wait ) - 1 ), 0 ); @@ -1121,31 +1111,31 @@ static void loot() add_msg( _( "Never mind." ) ); break; case SortLoot: - u.assign_activity( activity_id( "ACT_MOVE_LOOT" ) ); + u.assign_activity( ACT_MOVE_LOOT ); break; case FertilizePlots: - u.assign_activity( activity_id( "ACT_FERTILIZE_PLOT" ) ); + u.assign_activity( ACT_FERTILIZE_PLOT ); break; case ConstructPlots: - u.assign_activity( activity_id( "ACT_MULTIPLE_CONSTRUCTION" ) ); + u.assign_activity( ACT_MULTIPLE_CONSTRUCTION ); break; case MultiFarmPlots: - u.assign_activity( activity_id( "ACT_MULTIPLE_FARM" ) ); + u.assign_activity( ACT_MULTIPLE_FARM ); break; case Multichoptrees: - u.assign_activity( activity_id( "ACT_MULTIPLE_CHOP_TREES" ) ); + u.assign_activity( ACT_MULTIPLE_CHOP_TREES ); break; case Multichopplanks: - u.assign_activity( activity_id( "ACT_MULTIPLE_CHOP_PLANKS" ) ); + u.assign_activity( ACT_MULTIPLE_CHOP_PLANKS ); break; case Multideconvehicle: - u.assign_activity( activity_id( "ACT_VEHICLE_DECONSTRUCTION" ) ); + u.assign_activity( ACT_VEHICLE_DECONSTRUCTION ); break; case Multirepairvehicle: - u.assign_activity( activity_id( "ACT_VEHICLE_REPAIR" ) ); + u.assign_activity( ACT_VEHICLE_REPAIR ); break; case MultiButchery: - u.assign_activity( activity_id( "ACT_MULTIPLE_BUTCHER" ) ); + u.assign_activity( ACT_MULTIPLE_BUTCHER ); break; default: debugmsg( "Unsupported flag" ); @@ -1290,7 +1280,7 @@ static void fire() std::vector> actions; for( auto &w : u.worn ) { - if( w.type->can_use( "holster" ) && !w.has_flag( "NO_QUICKDRAW" ) && + if( w.type->can_use( "holster" ) && !w.has_flag( flag_NO_QUICKDRAW ) && !w.contents.empty() && w.contents.front().is_gun() ) { //~ draw (first) gun contained in holster //~ %1$s: weapon name, %2$s: container name, %3$d: remaining ammo count @@ -1317,8 +1307,8 @@ static void fire() if( u.weapon.is_gun() && !u.weapon.gun_current_mode().melee() ) { avatar_action::fire( g->u, g->m, u.weapon ); - } else if( u.weapon.has_flag( "REACH_ATTACK" ) ) { - int range = u.weapon.has_flag( "REACH3" ) ? 3 : 2; + } else if( u.weapon.has_flag( flag_REACH_ATTACK ) ) { + int range = u.weapon.has_flag( flag_REACH3 ) ? 3 : 2; if( u.has_effect( effect_relax_gas ) ) { if( one_in( 8 ) ) { add_msg( m_good, _( "Your willpower asserts itself, and so do you!" ) ); @@ -1330,7 +1320,7 @@ static void fire() } else { reach_attack( range, u ); } - } else if( u.weapon.is_gun() && u.weapon.gun_current_mode().flags.count( "REACH_ATTACK" ) ) { + } else if( u.weapon.is_gun() && u.weapon.gun_current_mode().flags.count( flag_REACH_ATTACK ) ) { int range = u.weapon.gun_current_mode().qty; if( u.has_effect( effect_relax_gas ) ) { if( one_in( 8 ) ) { @@ -1403,7 +1393,8 @@ static void cast_spell() spell &sp = *u.magic.get_spells()[spell_index]; - if( u.is_armed() && !sp.has_flag( spell_flag::NO_HANDS ) && !u.weapon.has_flag( "MAGIC_FOCUS" ) ) { + if( u.is_armed() && !sp.has_flag( spell_flag::NO_HANDS ) && + !u.weapon.has_flag( flag_MAGIC_FOCUS ) ) { add_msg( m_bad, _( "You need your hands free to cast this spell!" ) ); return; } @@ -1413,12 +1404,12 @@ static void cast_spell() return; } - if( sp.energy_source() == hp_energy && !u.has_quality( quality_id( "CUT" ) ) ) { + if( sp.energy_source() == hp_energy && !u.has_quality( qual_CUT ) ) { add_msg( m_bad, _( "You cannot cast Blood Magic without a cutting implement." ) ); return; } - player_activity cast_spell( activity_id( "ACT_SPELLCASTING" ), sp.casting_time( u ) ); + player_activity cast_spell( ACT_SPELLCASTING, sp.casting_time( u ) ); // [0] this is used as a spell level override for items casting spells cast_spell.values.emplace_back( -1 ); // [1] if this value is 1, the spell never fails @@ -2024,7 +2015,7 @@ bool game::handle_action() if( u.is_armed() ) { if( u.weapon.is_gun() && !u.weapon.is_gunmod() && u.weapon.gun_all_modes().size() > 1 ) { u.weapon.gun_cycle_mode(); - } else if( u.weapon.has_flag( "RELOAD_ONE" ) || u.weapon.has_flag( "RELOAD_AND_SHOOT" ) ) { + } else if( u.weapon.has_flag( flag_RELOAD_ONE ) || u.weapon.has_flag( flag_RELOAD_AND_SHOOT ) ) { item::reload_option opt = u.select_ammo( u.weapon, false ); if( !opt ) { break; @@ -2135,7 +2126,7 @@ bool game::handle_action() add_msg( m_info, _( "You can't operate a vehicle while you're in your shell." ) ); } else if( u.is_mounted() ) { u.dismount(); - } else if( u.has_trait( trait_id( "WAYFARER" ) ) ) { + } else if( u.has_trait( trait_WAYFARER ) ) { add_msg( m_info, _( "You refuse to take control of this vehicle." ) ); } else { control_vehicle(); @@ -2181,7 +2172,7 @@ bool game::handle_action() } set_safe_mode( SAFE_MODE_ON ); } else if( u.has_effect( effect_laserlocked ) ) { - if( u.has_trait( trait_id( "PROF_CHURL" ) ) ) { + if( u.has_trait( trait_PROF_CHURL ) ) { add_msg( m_warning, _( "You make the sign of the cross." ) ); } else { add_msg( m_info, _( "Ignoring laser targeting!" ) ); diff --git a/src/inventory.cpp b/src/inventory.cpp index fd58204a73869..496e2ae5b4915 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -33,6 +33,7 @@ #include "colony.h" #include "flat_set.h" #include "point.h" +#include "cata_string_consts.h" struct itype; @@ -812,9 +813,9 @@ int inventory::leak_level( const std::string &flag ) const for( const auto &elem : items ) { for( const auto &elem_stack_iter : elem ) { if( elem_stack_iter.has_flag( flag ) ) { - if( elem_stack_iter.has_flag( "LEAK_ALWAYS" ) ) { + if( elem_stack_iter.has_flag( flag_LEAK_ALWAYS ) ) { ret += elem_stack_iter.volume() / units::legacy_volume_factor; - } else if( elem_stack_iter.has_flag( "LEAK_DAM" ) && elem_stack_iter.damage() > 0 ) { + } else if( elem_stack_iter.has_flag( flag_LEAK_DAM ) && elem_stack_iter.damage() > 0 ) { ret += elem_stack_iter.damage_level( 4 ); } } @@ -881,8 +882,8 @@ void inventory::rust_iron_items() for( auto &elem : items ) { for( auto &elem_stack_iter : elem ) { if( elem_stack_iter.made_of( material_id( "iron" ) ) && - !elem_stack_iter.has_flag( "WATERPROOF_GUN" ) && - !elem_stack_iter.has_flag( "WATERPROOF" ) && + !elem_stack_iter.has_flag( flag_WATERPROOF_GUN ) && + !elem_stack_iter.has_flag( flag_WATERPROOF ) && elem_stack_iter.damage() < elem_stack_iter.max_damage() / 2 && //Passivation layer prevents further rusting one_in( 500 ) && diff --git a/src/item_action.cpp b/src/item_action.cpp index cff1f2413b8b2..a91ee8c9a9d19 100644 --- a/src/item_action.cpp +++ b/src/item_action.cpp @@ -28,11 +28,12 @@ #include "cursesdef.h" #include "iuse.h" #include "type_id.h" +#include "cata_string_consts.h" struct tripoint; static item_action nullaction; -static const std::string errstring( "ERROR" ); + static char key_bound_to( const input_context &ctxt, const item_action_id &act ) { @@ -217,12 +218,12 @@ void game::item_action_menu() // HACK: A bit of a hack for now. If more pseudos get implemented, this should be un-hacked std::vector pseudos; item toolset( "toolset", calendar::turn ); - if( u.has_active_bionic( bionic_id( "bio_tools" ) ) ) { + if( u.has_active_bionic( bio_tools ) ) { pseudos.push_back( &toolset ); } - item bio_claws( "bio_claws_weapon", calendar::turn ); - if( u.has_active_bionic( bionic_id( "bio_claws" ) ) ) { - pseudos.push_back( &bio_claws ); + item bio_claws_item( static_cast( bio_claws_weapon ), calendar::turn ); + if( u.has_active_bionic( bio_claws ) ) { + pseudos.push_back( &bio_claws_item ); } item_action_map iactions = gen.map_actions_to_items( u, pseudos ); diff --git a/src/item_group.cpp b/src/item_group.cpp index 16331294f7c14..7d0064bc47904 100644 --- a/src/item_group.cpp +++ b/src/item_group.cpp @@ -16,8 +16,7 @@ #include "enums.h" #include "type_id.h" #include "flat_set.h" - -static const std::string null_item_id( "null" ); +#include "cata_string_consts.h" Item_spawn_data::ItemList Item_spawn_data::create( const time_point &birthday ) const { @@ -63,7 +62,7 @@ item Single_item_creator::create_single( const time_point &birthday, RecursionLi } else if( type == S_NONE ) { return item( null_item_id, birthday ); } - if( one_in( 3 ) && tmp.has_flag( "VARSIZE" ) ) { + if( one_in( 3 ) && tmp.has_flag( flag_VARSIZE ) ) { tmp.item_tags.insert( "FIT" ); } if( modifier ) { @@ -233,15 +232,15 @@ void Item_modifier::modify( item &new_item ) const new_item.set_damage( rng( damage.first, damage.second ) ); // no need for dirt if it's a bow - if( new_item.is_gun() && !new_item.has_flag( "PRIMITIVE_RANGED_WEAPON" ) && - !new_item.has_flag( "NON-FOULING" ) ) { + if( new_item.is_gun() && !new_item.has_flag( flag_PRIMITIVE_RANGED_WEAPON ) && + !new_item.has_flag( flag_NON_FOULING ) ) { int random_dirt = rng( dirt.first, dirt.second ); // if gun RNG is dirty, must add dirt fault to allow cleaning if( random_dirt > 0 ) { new_item.set_var( "dirt", random_dirt ); new_item.faults.emplace( "fault_gun_dirt" ); // chance to be unlubed, but only if it's not a laser or something - } else if( one_in( 10 ) && !new_item.has_flag( "NEEDS_NO_LUBE" ) ) { + } else if( one_in( 10 ) && !new_item.has_flag( flag_NEEDS_NO_LUBE ) ) { new_item.faults.emplace( "fault_gun_unlubricated" ); } } diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index dee15467cb902..34fd35111e0a8 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -75,47 +75,10 @@ #include "flat_set.h" #include "point.h" #include "clothing_mod.h" +#include "cata_string_consts.h" class npc; -static const skill_id skill_mechanics( "mechanics" ); -static const skill_id skill_survival( "survival" ); -static const skill_id skill_firstaid( "firstaid" ); -static const skill_id skill_fabrication( "fabrication" ); - -static const species_id ZOMBIE( "ZOMBIE" ); -static const species_id HUMAN( "HUMAN" ); - -static const efftype_id effect_bandaged( "bandaged" ); -static const efftype_id effect_bite( "bite" ); -static const efftype_id effect_bleed( "bleed" ); -static const efftype_id effect_disinfected( "disinfected" ); -static const efftype_id effect_infected( "infected" ); -static const efftype_id effect_music( "music" ); -static const efftype_id effect_playing_instrument( "playing_instrument" ); -static const efftype_id effect_recover( "recover" ); -static const efftype_id effect_sleep( "sleep" ); -static const efftype_id effect_stunned( "stunned" ); -static const efftype_id effect_asthma( "asthma" ); -static const efftype_id effect_downed( "downed" ); - -static const trait_id trait_CENOBITE( "CENOBITE" ); -static const trait_id trait_LIGHTWEIGHT( "LIGHTWEIGHT" ); -static const trait_id trait_MASOCHIST( "MASOCHIST" ); -static const trait_id trait_MASOCHIST_MED( "MASOCHIST_MED" ); -static const trait_id trait_NOPAIN( "NOPAIN" ); -static const trait_id trait_PACIFIST( "PACIFIST" ); -static const trait_id trait_PSYCHOPATH( "PSYCHOPATH" ); -static const trait_id trait_PYROMANIA( "PYROMANIA" ); -static const trait_id trait_SAPIOVORE( "SAPIOVORE" ); -static const trait_id trait_SELFAWARE( "SELFAWARE" ); -static const trait_id trait_SMALL2( "SMALL2" ); -static const trait_id trait_SMALL_OK( "SMALL_OK" ); -static const trait_id trait_TOLERANCE( "TOLERANCE" ); -static const trait_id trait_MUT_JUNKIE( "MUT_JUNKIE" ); - -static const bionic_id bio_syringe( "bio_syringe" ); - std::unique_ptr iuse_transform::clone() const { return std::make_unique( *this ); @@ -1380,7 +1343,7 @@ int firestarter_actor::use( player &p, item &it, bool t, const tripoint &spos ) // skill gains are handled by the activity, but stored here in the index field const int potential_skill_gain = moves_modifier + moves_cost_fast / 100.0 + 2; - p.assign_activity( activity_id( "ACT_START_FIRE" ), moves, potential_skill_gain, + p.assign_activity( ACT_START_FIRE, moves, potential_skill_gain, p.get_item_position( &it ), it.tname() ); p.activity.values.push_back( g->natural_light_level( pos.z ) ); @@ -1984,7 +1947,7 @@ int enzlave_actor::use( player &p, item &it, bool t, const tripoint & ) const /** @EFFECT_FIRSTAID speeds up enzlavement */ const int moves = difficulty * to_moves( 12_seconds ) / p.get_skill_level( skill_firstaid ); - p.assign_activity( activity_id( "ACT_MAKE_ZLAVE" ), moves ); + p.assign_activity( ACT_MAKE_ZLAVE, moves ); p.activity.values.push_back( success ); p.activity.str_values.push_back( corpses[selected_corpse]->display_name() ); @@ -2391,7 +2354,7 @@ int learn_spell_actor::use( player &p, item &, bool, const tripoint & ) const return 0; } const bool knows_spell = p.magic.knows_spell( spells[action] ); - player_activity study_spell( activity_id( "ACT_STUDY_SPELL" ), + player_activity study_spell( ACT_STUDY_SPELL, p.magic.time_to_learn_spell( p, spells[action] ) ); study_spell.str_values = { "", // reserved for "until you gain a spell level" option [0] @@ -2463,7 +2426,7 @@ int cast_spell_actor::use( player &p, item &it, bool, const tripoint & ) const spell casting = spell( spell_id( item_spell ) ); int charges = it.type->charges_to_use(); - player_activity cast_spell( activity_id( "ACT_SPELLCASTING" ), casting.casting_time( p ) ); + player_activity cast_spell( ACT_SPELLCASTING, casting.casting_time( p ) ); // [0] this is used as a spell level override for items casting spells cast_spell.values.emplace_back( spell_level ); if( no_fail ) { @@ -2860,7 +2823,7 @@ int ammobelt_actor::use( player &p, item &, bool, const tripoint & ) const item::reload_option opt = p.select_ammo( mag, true ); if( opt ) { - p.assign_activity( activity_id( "ACT_RELOAD" ), opt.moves(), opt.qty() ); + p.assign_activity( ACT_RELOAD, opt.moves(), opt.qty() ); p.activity.targets.emplace_back( p, &p.i_add( mag ) ); p.activity.targets.push_back( std::move( opt.ammo ) ); } @@ -2954,7 +2917,7 @@ int repair_item_actor::use( player &p, item &it, bool, const tripoint &position return 0; } - p.assign_activity( activity_id( "ACT_REPAIR_ITEM" ), 0, p.get_item_position( &it ), INT_MIN ); + p.assign_activity( ACT_REPAIR_ITEM, 0, p.get_item_position( &it ), INT_MIN ); // We also need to store the repair actor subtype in the activity p.activity.str_values.push_back( type ); // storing of item_location to support repairs by tools on the ground @@ -3243,17 +3206,17 @@ repair_item_actor::repair_type repair_item_actor::default_action( const item &fi return RT_REPAIR; } - const bool can_be_refitted = fix.has_flag( "VARSIZE" ); - const bool doesnt_fit = !fix.has_flag( "FIT" ); + const bool can_be_refitted = fix.has_flag( flag_VARSIZE ); + const bool doesnt_fit = !fix.has_flag( flag_FIT ); if( doesnt_fit && can_be_refitted ) { return RT_REFIT; } - const bool smol = g->u.has_trait( trait_id( "SMALL2" ) ) || - g->u.has_trait( trait_id( "SMALL_OK" ) ); + const bool smol = g->u.has_trait( trait_SMALL2 ) || + g->u.has_trait( trait_SMALL_OK ); - const bool is_undersized = fix.has_flag( "UNDERSIZE" ); - const bool is_oversized = fix.has_flag( "OVERSIZE" ); + const bool is_undersized = fix.has_flag( flag_UNDERSIZE ); + const bool is_oversized = fix.has_flag( flag_OVERSIZE ); const bool resizing_matters = fix.get_encumber( g->u ) != 0; const bool too_big_while_smol = smol && !is_undersized && !is_oversized; @@ -3542,7 +3505,7 @@ int heal_actor::use( player &p, item &it, bool, const tripoint &pos ) const if( long_action && &patient == &p && !p.is_npc() ) { // Assign first aid long action. /** @EFFECT_FIRSTAID speeds up firstaid activity */ - p.assign_activity( activity_id( "ACT_FIRSTAID" ), cost, 0, p.get_item_position( &it ), it.tname() ); + p.assign_activity( ACT_FIRSTAID, cost, 0, p.get_item_position( &it ), it.tname() ); p.activity.values.push_back( hpp ); p.moves = 0; return 0; @@ -3799,7 +3762,7 @@ hp_part heal_actor::use_healing_item( player &healer, player &patient, item &it, } } else if( patient.is_player() ) { // Player healing self - let player select - if( healer.activity.id() != activity_id( "ACT_FIRSTAID" ) ) { + if( healer.activity.id() != ACT_FIRSTAID ) { const std::string menu_header = _( "Select a body part for: " ) + it.tname(); healed = pick_part_to_heal( healer, patient, menu_header, limb_power, head_bonus, torso_bonus, @@ -3812,10 +3775,10 @@ hp_part heal_actor::use_healing_item( player &healer, player &patient, item &it, } } // Brick healing if using a first aid kit for the first time. - if( long_action && healer.activity.id() != activity_id( "ACT_FIRSTAID" ) ) { + if( long_action && healer.activity.id() != ACT_FIRSTAID ) { // Cancel and wait for activity completion. return healed; - } else if( healer.activity.id() == activity_id( "ACT_FIRSTAID" ) ) { + } else if( healer.activity.id() == ACT_FIRSTAID ) { // Completed activity, extract body part from it. healed = static_cast( healer.activity.values[0] ); } @@ -4167,14 +4130,14 @@ ret_val install_bionic_actor::can_use( const Character &p, const item &it, return ret_val::make_failure( _( "You can't install bionics while mounted." ) ); } if( !get_option( "MANUAL_BIONIC_INSTALLATION" ) && - !p.has_trait( trait_id( "DEBUG_BIONICS" ) ) ) { + !p.has_trait( trait_DEBUG_BIONICS ) ) { return ret_val::make_failure( _( "You can't self-install bionics." ) ); - } else if( !p.has_trait( trait_id( "DEBUG_BIONICS" ) ) ) { + } else if( !p.has_trait( trait_DEBUG_BIONICS ) ) { if( it.has_flag( "FILTHY" ) ) { return ret_val::make_failure( _( "You can't install a filthy CBM!" ) ); } else if( it.has_flag( "NO_STERILE" ) ) { return ret_val::make_failure( _( "This CBM is not sterile, you can't install it." ) ); - } else if( it.has_fault( fault_id( "fault_bionic_salvaged" ) ) ) { + } else if( it.has_fault( fault_bionic_salvaged ) ) { return ret_val::make_failure( _( "This CBM is already deployed. You need to reset it to factory state." ) ); } else if( units::energy_max - p.get_max_power_level() < bid->capacity ) { diff --git a/src/lightmap.cpp b/src/lightmap.cpp index 0f58adff19c26..5b4c5c43d4bdc 100644 --- a/src/lightmap.cpp +++ b/src/lightmap.cpp @@ -37,6 +37,7 @@ #include "colony.h" #include "item_stack.h" #include "point.h" +#include "cata_string_consts.h" #define LIGHTMAP_CACHE_X MAPSIZE_X #define LIGHTMAP_CACHE_Y MAPSIZE_Y @@ -46,9 +47,6 @@ static constexpr point lightmap_boundary_max( LIGHTMAP_CACHE_X, LIGHTMAP_CACHE_Y const rectangle lightmap_boundaries( lightmap_boundary_min, lightmap_boundary_max ); -static const efftype_id effect_onfire( "onfire" ); -static const efftype_id effect_haslight( "haslight" ); - std::string four_quadrants::to_string() const { return string_format( "(%.2f,%.2f,%.2f,%.2f)", @@ -446,7 +444,7 @@ void map::generate_lightmap( const int zlev ) } } - if( g->u.has_active_bionic( bionic_id( "bio_night" ) ) ) { + if( g->u.has_active_bionic( bio_night ) ) { for( const tripoint &p : points_in_rectangle( cache_start, cache_end ) ) { if( rl_dist( p, g->u.pos() ) < 2 ) { lm[p.x][p.y].fill( LIGHT_AMBIENT_MINIMAL ); diff --git a/src/magic.cpp b/src/magic.cpp index f448e9aaa6bb2..55d3f5dd03ed1 100644 --- a/src/magic.cpp +++ b/src/magic.cpp @@ -40,6 +40,7 @@ #include "point.h" #include "string_formatter.h" #include "line.h" +#include "cata_string_consts.h" namespace io { @@ -582,7 +583,7 @@ bool spell::is_max_level() const bool spell::can_learn( const player &p ) const { - if( type->spell_class == trait_id( "NONE" ) ) { + if( type->spell_class == trait_NONE ) { return true; } return p.has_trait( type->spell_class ); @@ -1273,7 +1274,7 @@ void known_magic::learn_spell( const spell_type *sp, player &p, bool force ) debugmsg( "Tried to learn invalid spell" ); return; } - if( !force && sp->spell_class != trait_id( "NONE" ) ) { + if( !force && sp->spell_class != trait_NONE ) { if( can_learn_spell( p, sp->id ) && !p.has_trait( sp->spell_class ) ) { std::string trait_cancel; for( const trait_id &cancel : sp->spell_class->cancels ) { @@ -1329,7 +1330,7 @@ void known_magic::forget_spell( const spell_id &sp ) bool known_magic::can_learn_spell( const player &p, const spell_id &sp ) const { const spell_type &sp_t = sp.obj(); - if( sp_t.spell_class == trait_id( "NONE" ) ) { + if( sp_t.spell_class == trait_NONE ) { return true; } return !p.has_opposite_trait( sp_t.spell_class ); @@ -1568,7 +1569,7 @@ void spellcasting_callback::draw_spell_info( const spell &sp, const uilist *menu nc_color yellow = c_yellow; print_colored_text( w_menu, point( h_col1, line++ ), yellow, yellow, - sp.spell_class() == trait_id( "NONE" ) ? _( "Classless" ) : sp.spell_class()->name() ); + sp.spell_class() == trait_NONE ? _( "Classless" ) : sp.spell_class()->name() ); line += fold_and_print( w_menu, point( h_col1, line ), info_width, gray, sp.description() ); @@ -1835,7 +1836,7 @@ static void draw_spellbook_info( const spell_type &sp, uilist *menu ) const spell fake_spell( sp.id ); const std::string spell_name = colorize( sp.name, c_light_green ); - const std::string spell_class = sp.spell_class == trait_id( "NONE" ) ? _( "Classless" ) : + const std::string spell_class = sp.spell_class == trait_NONE ? _( "Classless" ) : sp.spell_class->name(); print_colored_text( w, point( start_x, line ), gray, gray, spell_name ); print_colored_text( w, point( menu->pad_left - utf8_width( spell_class ) - 1, line++ ), yellow, diff --git a/src/map_extras.cpp b/src/map_extras.cpp index c7c62b84ce792..caf08d0a45d4b 100644 --- a/src/map_extras.cpp +++ b/src/map_extras.cpp @@ -50,6 +50,7 @@ #include "string_formatter.h" #include "weighted_list.h" #include "rng.h" +#include "cata_string_consts.h" class npc_template; @@ -91,34 +92,6 @@ const map_extra &string_id::obj() const namespace MapExtras { -static const mongroup_id GROUP_NETHER_CAPTURED( "GROUP_NETHER_CAPTURED" ); -static const mongroup_id GROUP_NETHER_PORTAL( "GROUP_NETHER_PORTAL" ); -static const mongroup_id GROUP_MAYBE_MIL( "GROUP_MAYBE_MIL" ); -static const mongroup_id GROUP_FISH( "GROUP_FISH" ); -static const mongroup_id GROUP_FUNGI_FUNGALOID( "GROUP_FUNGI_FUNGALOID" ); -static const mongroup_id GROUP_MI_GO_CAMP_OM( "GROUP_MI-GO_CAMP_OM" ); - -static const mtype_id mon_zombie_tough( "mon_zombie_tough" ); -static const mtype_id mon_marloss_zealot_f( "mon_marloss_zealot_f" ); -static const mtype_id mon_marloss_zealot_m( "mon_marloss_zealot_m" ); -static const mtype_id mon_zombie_smoker( "mon_zombie_smoker" ); -static const mtype_id mon_zombie_scientist( "mon_zombie_scientist" ); -static const mtype_id mon_dispatch( "mon_dispatch" ); -static const mtype_id mon_turret_bmg( "mon_turret_bmg" ); -static const mtype_id mon_turret_rifle( "mon_turret_rifle" ); -static const mtype_id mon_turret_riot( "mon_turret_riot" ); -static const mtype_id mon_zombie_spitter( "mon_zombie_spitter" ); -static const mtype_id mon_zombie_soldier( "mon_zombie_soldier" ); -static const mtype_id mon_zombie_military_pilot( "mon_zombie_military_pilot" ); -static const mtype_id mon_zombie_bio_op( "mon_zombie_bio_op" ); -static const mtype_id mon_shia( "mon_shia" ); -static const mtype_id mon_spider_web( "mon_spider_web" ); -static const mtype_id mon_spider_widow_giant( "mon_spider_widow_giant" ); -static const mtype_id mon_spider_cellar_giant( "mon_spider_cellar_giant" ); -static const mtype_id mon_wasp( "mon_wasp" ); -static const mtype_id mon_jabberwock( "mon_jabberwock" ); -static const mtype_id mon_wolf( "mon_wolf" ); - const generic_factory &mapExtraFactory() { return extras; @@ -133,7 +106,7 @@ static void dead_vegetation_parser( map &m, const tripoint &loc ) { // furniture plants die to withered plants const furn_t &fid = m.furn( loc ).obj(); - if( fid.has_flag( "PLANT" ) || fid.has_flag( "FLOWER" ) || fid.has_flag( "ORGANIC" ) ) { + if( fid.has_flag( flag_PLANT ) || fid.has_flag( flag_FLOWER ) || fid.has_flag( flag_ORGANIC ) ) { m.i_clear( loc ); m.furn_set( loc, f_null ); m.spawn_item( loc, "withered" ); @@ -141,17 +114,17 @@ static void dead_vegetation_parser( map &m, const tripoint &loc ) // terrain specific conversions const ter_id tid = m.ter( loc ); static const std::map dies_into {{ - {t_grass, ter_str_id( "t_grass_dead" )}, - {t_grass_long, ter_str_id( "t_grass_dead" )}, - {t_grass_tall, ter_str_id( "t_grass_dead" )}, - {t_moss, ter_str_id( "t_grass_dead" )}, - {t_tree_pine, ter_str_id( "t_tree_deadpine" )}, - {t_tree_birch, ter_str_id( "t_tree_birch_harvested" )}, - {t_tree_willow, ter_str_id( "t_tree_dead" )}, - {t_tree_hickory, ter_str_id( "t_tree_hickory_dead" )}, - {t_tree_hickory_harvested, ter_str_id( "t_tree_hickory_dead" )}, - {t_grass_golf, ter_str_id( "t_grass_dead" )}, - {t_grass_white, ter_str_id( "t_grass_dead" )}, + {t_grass, ter_grass_dead}, + {t_grass_long, ter_grass_dead}, + {t_grass_tall, ter_grass_dead}, + {t_moss, ter_grass_dead}, + {t_tree_pine, ter_tree_deadpine}, + {t_tree_birch, ter_tree_birch_harvested}, + {t_tree_willow, ter_tree_dead}, + {t_tree_hickory, ter_tree_hickory_dead}, + {t_tree_hickory_harvested, ter_tree_hickory_dead}, + {t_grass_golf, ter_grass_dead}, + {t_grass_white, ter_grass_dead}, }}; const auto iter = dies_into.find( tid ); @@ -160,21 +133,21 @@ static void dead_vegetation_parser( map &m, const tripoint &loc ) } // non-specific small vegetation falls into sticks, large dies and randomly falls const ter_t &tr = tid.obj(); - if( tr.has_flag( "SHRUB" ) ) { + if( tr.has_flag( flag_SHRUB ) ) { m.ter_set( loc, t_dirt ); if( one_in( 2 ) ) { m.spawn_item( loc, "stick" ); } - } else if( tr.has_flag( "TREE" ) ) { + } else if( tr.has_flag( flag_TREE ) ) { if( one_in( 4 ) ) { - m.ter_set( loc, ter_str_id( "t_trunk" ) ); + m.ter_set( loc, ter_trunk ); } else if( one_in( 4 ) ) { - m.ter_set( loc, ter_str_id( "t_stump" ) ); + m.ter_set( loc, ter_stump ); } else { - m.ter_set( loc, ter_str_id( "t_tree_dead" ) ); + m.ter_set( loc, ter_tree_dead ); } - } else if( tr.has_flag( "YOUNG" ) ) { - m.ter_set( loc, ter_str_id( "t_dirt" ) ); + } else if( tr.has_flag( flag_YOUNG ) ) { + m.ter_set( loc, ter_dirt ); if( one_in( 2 ) ) { m.spawn_item( loc, "stick_long" ); } @@ -1030,7 +1003,7 @@ static void mx_minefield( map &m, const tripoint &abs_sub ) //Spawn ordinary mine on asphalt, otherwise spawn buried mine for( int i = 0; i < num_mines; i++ ) { const int x = rng( 1, SEEX * 2 ), y = rng( SEEY, SEEY * 2 - 2 ); - if( m.has_flag( "DIGGABLE", point( x, y ) ) ) { + if( m.has_flag( flag_DIGGABLE, point( x, y ) ) ) { mtrap_set( &m, x, y, tr_landmine_buried ); } else { mtrap_set( &m, x, y, tr_landmine ); @@ -1131,7 +1104,7 @@ static void mx_minefield( map &m, const tripoint &abs_sub ) //Spawn ordinary mine on asphalt, otherwise spawn buried mine for( int i = 0; i < num_mines; i++ ) { const int x = rng( 1, SEEX * 2 ), y = rng( 1, SEEY ); - if( m.has_flag( "DIGGABLE", point( x, y ) ) ) { + if( m.has_flag( flag_DIGGABLE, point( x, y ) ) ) { mtrap_set( &m, x, y, tr_landmine_buried ); } else { mtrap_set( &m, x, y, tr_landmine ); @@ -1275,7 +1248,7 @@ static void mx_minefield( map &m, const tripoint &abs_sub ) //Spawn ordinary mine on asphalt, otherwise spawn buried mine for( int i = 0; i < num_mines; i++ ) { const int x = rng( SEEX + 1, SEEX * 2 - 2 ), y = rng( 1, SEEY * 2 ); - if( m.has_flag( "DIGGABLE", point( x, y ) ) ) { + if( m.has_flag( flag_DIGGABLE, point( x, y ) ) ) { mtrap_set( &m, x, y, tr_landmine_buried ); } else { mtrap_set( &m, x, y, tr_landmine ); @@ -1409,7 +1382,7 @@ static void mx_minefield( map &m, const tripoint &abs_sub ) //Spawn ordinary mine on asphalt, otherwise spawn buried mine for( int i = 0; i < num_mines; i++ ) { const int x = rng( 1, SEEX ), y = rng( 1, SEEY * 2 ); - if( m.has_flag( "DIGGABLE", point( x, y ) ) ) { + if( m.has_flag( flag_DIGGABLE, point( x, y ) ) ) { mtrap_set( &m, x, y, tr_landmine_buried ); } else { mtrap_set( &m, x, y, tr_landmine ); @@ -1695,9 +1668,9 @@ static void mx_spider( map &m, const tripoint &abs_sub ) for( int j = 0; j < SEEY * 2; j++ ) { const tripoint location( i, j, abs_sub.z ); - bool should_web_flat = m.has_flag_ter( "FLAT", location ) && !one_in( 3 ); - bool should_web_shrub = m.has_flag_ter( "SHRUB", location ) && !one_in( 4 ); - bool should_web_tree = m.has_flag_ter( "TREE", location ) && !one_in( 4 ); + bool should_web_flat = m.has_flag_ter( flag_FLAT, location ) && !one_in( 3 ); + bool should_web_shrub = m.has_flag_ter( flag_SHRUB, location ) && !one_in( 4 ); + bool should_web_tree = m.has_flag_ter( flag_TREE, location ) && !one_in( 4 ); if( should_web_flat || should_web_shrub || should_web_tree ) { m.add_field( location, fd_web, rng( 1, 3 ), 0_turns ); @@ -1736,7 +1709,7 @@ static void mx_grove( map &m, const tripoint &abs_sub ) for( int i = 0; i < SEEX * 2; i++ ) { for( int j = 0; j < SEEY * 2; j++ ) { const tripoint location( i, j, abs_sub.z ); - if( m.has_flag_ter( "TREE", location ) ) { + if( m.has_flag_ter( flag_TREE, location ) ) { tree = m.ter( location ); found_tree = true; } @@ -1750,8 +1723,8 @@ static void mx_grove( map &m, const tripoint &abs_sub ) for( int i = 0; i < SEEX * 2; i++ ) { for( int j = 0; j < SEEY * 2; j++ ) { const tripoint location( i, j, abs_sub.z ); - if( m.has_flag_ter( "SHRUB", location ) || m.has_flag_ter( "TREE", location ) || - m.has_flag_ter( "YOUNG", location ) ) { + if( m.has_flag_ter( flag_SHRUB, location ) || m.has_flag_ter( flag_TREE, location ) || + m.has_flag_ter( flag_YOUNG, location ) ) { m.ter_set( location, tree ); } } @@ -1768,7 +1741,7 @@ static void mx_shrubbery( map &m, const tripoint &abs_sub ) for( int i = 0; i < SEEX * 2; i++ ) { for( int j = 0; j < SEEY * 2; j++ ) { const tripoint location( i, j, abs_sub.z ); - if( m.has_flag_ter( "SHRUB", location ) ) { + if( m.has_flag_ter( flag_SHRUB, location ) ) { shrubbery = m.ter( location ); found_shrubbery = true; } @@ -1782,8 +1755,8 @@ static void mx_shrubbery( map &m, const tripoint &abs_sub ) for( int i = 0; i < SEEX * 2; i++ ) { for( int j = 0; j < SEEY * 2; j++ ) { const tripoint location( i, j, abs_sub.z ); - if( m.has_flag_ter( "SHRUB", location ) || m.has_flag_ter( "TREE", location ) || - m.has_flag_ter( "YOUNG", location ) ) { + if( m.has_flag_ter( flag_SHRUB, location ) || m.has_flag_ter( flag_TREE, location ) || + m.has_flag_ter( flag_YOUNG, location ) ) { m.ter_set( location, shrubbery ); } } @@ -1802,7 +1775,7 @@ static void mx_clearcut( map &m, const tripoint &abs_sub ) for( int i = 0; i < SEEX * 2; i++ ) { for( int j = 0; j < SEEY * 2; j++ ) { const tripoint location( i, j, abs_sub.z ); - if( m.has_flag_ter( "TREE", location ) || m.has_flag_ter( "YOUNG", location ) ) { + if( m.has_flag_ter( flag_TREE, location ) || m.has_flag_ter( flag_YOUNG, location ) ) { m.ter_set( location, stump ); } } @@ -1962,13 +1935,13 @@ static void burned_ground_parser( map &m, const tripoint &loc ) // this method is deliberate to allow adding new post-terrains // (TODO: expand this list when new destroyed terrain is added) static const std::map dies_into {{ - {t_grass, ter_str_id( "t_grass_dead" )}, - {t_grass_long, ter_str_id( "t_grass_dead" )}, - {t_grass_tall, ter_str_id( "t_grass_dead" )}, - {t_moss, ter_str_id( "t_grass_dead" )}, - {t_fungus, ter_str_id( "t_dirt" )}, - {t_grass_golf, ter_str_id( "t_grass_dead" )}, - {t_grass_white, ter_str_id( "t_grass_dead" )}, + {t_grass, ter_grass_dead}, + {t_grass_long, ter_grass_dead}, + {t_grass_tall, ter_grass_dead}, + {t_moss, ter_grass_dead}, + {t_fungus, ter_dirt}, + {t_grass_golf, ter_grass_dead}, + {t_grass_white, ter_grass_dead}, }}; const auto iter = dies_into.find( tid ); @@ -1984,27 +1957,27 @@ static void burned_ground_parser( map &m, const tripoint &loc ) } // fungus cannot be destroyed by map::destroy so ths method is employed - if( fid.has_flag( "FUNGUS" ) ) { + if( fid.has_flag( flag_FUNGUS ) ) { if( one_in( 5 ) ) { m.furn_set( loc, f_ash ); } } - if( tr.has_flag( "FUNGUS" ) ) { + if( tr.has_flag( flag_FUNGUS ) ) { m.ter_set( loc, t_dirt ); if( one_in( 5 ) ) { m.spawn_item( loc, "ash", 1, rng( 1, 5 ) ); } } // destruction of trees is not absolute - if( tr.has_flag( "TREE" ) ) { + if( tr.has_flag( flag_TREE ) ) { if( one_in( 4 ) ) { - m.ter_set( loc, ter_str_id( "t_trunk" ) ); + m.ter_set( loc, ter_trunk ); } else if( one_in( 4 ) ) { - m.ter_set( loc, ter_str_id( "t_stump" ) ); + m.ter_set( loc, ter_stump ); } else if( one_in( 4 ) ) { - m.ter_set( loc, ter_str_id( "t_tree_dead" ) ); + m.ter_set( loc, ter_tree_dead ); } else { - m.ter_set( loc, ter_str_id( "t_dirt" ) ); + m.ter_set( loc, ter_dirt ); m.furn_set( loc, f_ash ); m.spawn_item( loc, "ash", 1, rng( 1, 100 ) ); } @@ -2014,7 +1987,7 @@ static void burned_ground_parser( map &m, const tripoint &loc ) while( m.is_bashable( loc ) ) { // one is not enough m.destroy( loc, true ); } - if( one_in( 5 ) && !tr.has_flag( "LIQUID" ) ) { + if( one_in( 5 ) && !tr.has_flag( flag_LIQUID ) ) { m.spawn_item( loc, "ash", 1, rng( 1, 10 ) ); } } else if( ter_furn_has_flag( tr, fid, TFLAG_FLAMMABLE_ASH ) ) { @@ -2022,7 +1995,7 @@ static void burned_ground_parser( map &m, const tripoint &loc ) m.destroy( loc, true ); } m.furn_set( loc, f_ash ); - if( !tr.has_flag( "LIQUID" ) ) { + if( !tr.has_flag( flag_LIQUID ) ) { m.spawn_item( loc, "ash", 1, rng( 1, 100 ) ); } } @@ -2674,7 +2647,7 @@ static void mx_corpses( map &m, const tripoint &abs_sub ) for( const auto &loc : m.points_in_radius( corpse_location, 1 ) ) { if( one_in( 2 ) ) { m.add_field( { loc.xy(), abs_sub.z }, fd_gibs_flesh, rng( 1, 3 ) ); - m.place_spawns( mongroup_id( "GROUP_STRAY_DOGS" ), 1, loc.xy(), loc.xy(), 1, true ); + m.place_spawns( GROUP_STRAY_DOGS, 1, loc.xy(), loc.xy(), 1, true ); } } } diff --git a/src/map_field.cpp b/src/map_field.cpp index 49baed22647c1..1cd4247eb2e15 100644 --- a/src/map_field.cpp +++ b/src/map_field.cpp @@ -59,25 +59,7 @@ #include "scent_block.h" #include "mongroup.h" #include "teleport.h" - -static const species_id FUNGUS( "FUNGUS" ); -static const species_id INSECT( "INSECT" ); -static const species_id SPIDER( "SPIDER" ); - -static const efftype_id effect_badpoison( "badpoison" ); -static const efftype_id effect_blind( "blind" ); -static const efftype_id effect_corroding( "corroding" ); -static const efftype_id effect_fungus( "fungus" ); -static const efftype_id effect_onfire( "onfire" ); -static const efftype_id effect_poison( "poison" ); -static const efftype_id effect_stung( "stung" ); -static const efftype_id effect_stunned( "stunned" ); -static const efftype_id effect_teargas( "teargas" ); -static const efftype_id effect_webbed( "webbed" ); - -static const trait_id trait_ELECTRORECEPTORS( "ELECTRORECEPTORS" ); -static const trait_id trait_M_SKIN2( "M_SKIN2" ); -static const trait_id trait_M_SKIN3( "M_SKIN3" ); +#include "cata_string_consts.h" void map::create_burnproducts( const tripoint &p, const item &fuel, const units::mass &burned_mass ) { @@ -1280,10 +1262,10 @@ bool map::process_fields_in_submap( submap *const current_submap, const ter_t &ter = map_tile.get_ter_t(); const furn_t &frn = map_tile.get_furn_t(); const int intensity = cur.get_field_intensity(); - if( ter.has_flag( "FUNGUS" ) && one_in( 10 / intensity ) ) { + if( ter.has_flag( flag_FUNGUS ) && one_in( 10 / intensity ) ) { ter_set( p, t_dirt ); } - if( frn.has_flag( "FUNGUS" ) && one_in( 10 / intensity ) ) { + if( frn.has_flag( flag_FUNGUS ) && one_in( 10 / intensity ) ) { furn_set( p, f_null ); } } @@ -1358,7 +1340,7 @@ void map::player_in_field( player &u ) if( ft == fd_web ) { // If we are in a web, can't walk in webs or are in a vehicle, get webbed maybe. // Moving through multiple webs stacks the effect. - if( !u.has_trait( trait_id( "WEB_WALKER" ) ) && !u.in_vehicle ) { + if( !u.has_trait( trait_WEB_WALKER ) && !u.in_vehicle ) { // Between 5 and 15 minus your current web level. u.add_effect( effect_webbed, 1_turns, num_bp, true, cur.get_field_intensity() ); // It is spent. @@ -1374,7 +1356,7 @@ void map::player_in_field( player &u ) if( ft == fd_acid ) { // Assume vehicles block acid damage entirely, // you're certainly not standing in it. - if( !u.in_vehicle && !u.has_trait( trait_id( "ACIDPROOF" ) ) ) { + if( !u.in_vehicle && !u.has_trait( trait_ACIDPROOF ) ) { int total_damage = 0; const int intensity = cur.get_field_intensity(); // 1-3 at intensity, 1-4 at 2, 1-5 at 3 @@ -1429,7 +1411,7 @@ void map::player_in_field( player &u ) } if( ft == fd_fire ) { // Heatsink or suit prevents ALL fire damage. - if( !u.has_active_bionic( bionic_id( "bio_heatsink" ) ) && !u.is_wearing( "rm13_armor_on" ) ) { + if( !u.has_active_bionic( bio_heatsink ) && !u.is_wearing( "rm13_armor_on" ) ) { // To modify power of a field based on... whatever is relevant for the effect. int adjusted_intensity = cur.get_field_intensity(); @@ -1519,7 +1501,7 @@ void map::player_in_field( player &u ) } } if( ft == fd_fungal_haze ) { - if( !u.has_trait( trait_id( "M_IMMUNE" ) ) && ( !inside || one_in( 4 ) ) ) { + if( !u.has_trait( trait_M_IMMUNE ) && ( !inside || one_in( 4 ) ) ) { u.add_env_effect( effect_fungus, bp_mouth, 4, 10_minutes, num_bp, true ); u.add_env_effect( effect_fungus, bp_eyes, 4, 10_minutes, num_bp, true ); } @@ -1548,7 +1530,7 @@ void map::player_in_field( player &u ) if( !inside ) { // Fireballs can't touch you inside a car. // Heatsink or suit stops fire. - if( !u.has_active_bionic( bionic_id( "bio_heatsink" ) ) && + if( !u.has_active_bionic( bio_heatsink ) && !u.is_wearing( "rm13_armor_on" ) ) { u.add_msg_player_or_npc( m_bad, _( "You're torched by flames!" ), _( " is torched by flames!" ) ); @@ -1641,11 +1623,11 @@ void map::player_in_field( player &u ) // The gas won't harm you inside a vehicle. if( !inside ) { // Full body suits protect you from the effects of the gas. - if( !( u.worn_with_flag( "GAS_PROOF" ) && u.get_env_resist( bp_mouth ) >= 15 && + if( !( u.worn_with_flag( flag_GAS_PROOF ) && u.get_env_resist( bp_mouth ) >= 15 && u.get_env_resist( bp_eyes ) >= 15 ) ) { const int intensity = cur.get_field_intensity(); bool inhaled = u.add_env_effect( effect_poison, bp_mouth, 5, intensity * 1_minutes ); - if( u.has_trait( trait_id( "THRESH_MYCUS" ) ) || u.has_trait( trait_id( "THRESH_MARLOSS" ) ) || + if( u.has_trait( trait_THRESH_MYCUS ) || u.has_trait( trait_THRESH_MARLOSS ) || ( ft == fd_insecticidal_gas && ( u.get_highest_category() == "INSECT" || u.get_highest_category() == "SPIDER" ) ) ) { inhaled |= u.add_env_effect( effect_badpoison, bp_mouth, 5, intensity * 1_minutes ); diff --git a/src/mapdata.cpp b/src/mapdata.cpp index b009613abeffb..298c59d0cb91c 100644 --- a/src/mapdata.cpp +++ b/src/mapdata.cpp @@ -19,6 +19,7 @@ #include "trap.h" #include "assign.h" #include "json.h" +#include "cata_string_consts.h" namespace { @@ -313,7 +314,7 @@ furn_t null_furniture_t() new_furniture.movecost = 0; new_furniture.move_str_req = -1; new_furniture.transparent = true; - new_furniture.set_flag( "TRANSPARENT" ); + new_furniture.set_flag( flag_TRANSPARENT ); new_furniture.examine = iexamine_function_from_string( "none" ); new_furniture.max_volume = DEFAULT_MAX_VOLUME_IN_SQUARE; return new_furniture; @@ -334,8 +335,8 @@ ter_t null_terrain_t() new_terrain.light_emitted = 0; new_terrain.movecost = 0; new_terrain.transparent = true; - new_terrain.set_flag( "TRANSPARENT" ); - new_terrain.set_flag( "DIGGABLE" ); + new_terrain.set_flag( flag_TRANSPARENT ); + new_terrain.set_flag( flag_DIGGABLE ); new_terrain.examine = iexamine_function_from_string( "none" ); new_terrain.max_volume = DEFAULT_MAX_VOLUME_IN_SQUARE; return new_terrain; diff --git a/src/mapgen.cpp b/src/mapgen.cpp index dab03c863a83a..409c9139810e7 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -66,34 +66,12 @@ #include "colony.h" #include "pimpl.h" #include "point.h" +#include "cata_string_consts.h" #define dbg(x) DebugLog((x),D_MAP_GEN) << __FILE__ << ":" << __LINE__ << ": " #define MON_RADIUS 3 -static const mongroup_id GROUP_DARK_WYRM( "GROUP_DARK_WYRM" ); -static const mongroup_id GROUP_DOG_THING( "GROUP_DOG_THING" ); -static const mongroup_id GROUP_FUNGI_FUNGALOID( "GROUP_FUNGI_FUNGALOID" ); -static const mongroup_id GROUP_BLOB( "GROUP_BLOB" ); -static const mongroup_id GROUP_BREATHER( "GROUP_BREATHER" ); -static const mongroup_id GROUP_BREATHER_HUB( "GROUP_BREATHER_HUB" ); -static const mongroup_id GROUP_HAZMATBOT( "GROUP_HAZMATBOT" ); -static const mongroup_id GROUP_LAB( "GROUP_LAB" ); -static const mongroup_id GROUP_LAB_CYBORG( "GROUP_LAB_CYBORG" ); -static const mongroup_id GROUP_LAB_FEMA( "GROUP_LAB_FEMA" ); -static const mongroup_id GROUP_MIL_WEAK( "GROUP_MIL_WEAK" ); -static const mongroup_id GROUP_NETHER( "GROUP_NETHER" ); -static const mongroup_id GROUP_PLAIN( "GROUP_PLAIN" ); -static const mongroup_id GROUP_ROBOT_SECUBOT( "GROUP_ROBOT_SECUBOT" ); -static const mongroup_id GROUP_SEWER( "GROUP_SEWER" ); -static const mongroup_id GROUP_SPIDER( "GROUP_SPIDER" ); -static const mongroup_id GROUP_TRIFFID_HEART( "GROUP_TRIFFID_HEART" ); -static const mongroup_id GROUP_TRIFFID( "GROUP_TRIFFID" ); -static const mongroup_id GROUP_TRIFFID_OUTER( "GROUP_TRIFFID_OUTER" ); -static const mongroup_id GROUP_TURRET( "GROUP_TURRET" ); -static const mongroup_id GROUP_ZOMBIE( "GROUP_ZOMBIE" ); -static const mongroup_id GROUP_ZOMBIE_COP( "GROUP_ZOMBIE_COP" ); - void science_room( map *m, int x1, int y1, int x2, int y2, int z, int rotate ); void set_science_room( map *m, int x1, int y1, bool faces_right, const time_point &when ); void build_mine_room( room_type type, int x1, int y1, int x2, int y2, mapgendata &dat ); @@ -5831,7 +5809,7 @@ character_id map::place_npc( const point &p, const string_id &type temp->normalize(); temp->load_npc_template( type ); temp->spawn_at_precise( { abs_sub.xy() }, { p, abs_sub.z } ); - temp->toggle_trait( trait_id( "NPC_STATIC_NPC" ) ); + temp->toggle_trait( trait_NPC_STATIC_NPC ); overmap_buffer.insert_npc( temp ); return temp->getID(); } diff --git a/src/mapgen_functions.cpp b/src/mapgen_functions.cpp index c735d202787af..a5e1a9d6dd98e 100644 --- a/src/mapgen_functions.cpp +++ b/src/mapgen_functions.cpp @@ -36,20 +36,12 @@ #include "string_id.h" #include "int_id.h" #include "enums.h" +#include "cata_string_consts.h" class npc_template; #define dbg(x) DebugLog((x),D_MAP_GEN) << __FILE__ << ":" << __LINE__ << ": " -static const mtype_id mon_ant_larva( "mon_ant_larva" ); -static const mtype_id mon_ant_queen( "mon_ant_queen" ); -static const mtype_id mon_bat( "mon_bat" ); -static const mtype_id mon_bee( "mon_bee" ); -static const mtype_id mon_beekeeper( "mon_beekeeper" ); -static const mtype_id mon_rat_king( "mon_rat_king" ); -static const mtype_id mon_sewer_rat( "mon_sewer_rat" ); -static const mtype_id mon_zombie_jackson( "mon_zombie_jackson" ); - tripoint rotate_point( const tripoint &p, int rotations ) { if( p.x < 0 || p.x >= SEEX * 2 || @@ -881,7 +873,7 @@ void mapgen_road( mapgendata &dat ) // spawn some monsters if( neighbor_sidewalks ) { - m->place_spawns( mongroup_id( "GROUP_ZOMBIE" ), 2, point_zero, point( SEEX * 2 - 1, SEEX * 2 - 1 ), + m->place_spawns( GROUP_ZOMBIE, 2, point_zero, point( SEEX * 2 - 1, SEEX * 2 - 1 ), dat.monster_density() ); // 1 per 10 overmaps if( one_in( 10000 ) ) { @@ -1980,7 +1972,7 @@ void mapgen_cave( mapgendata &dat ) dat.when() ); break; } - m->place_spawns( mongroup_id( "GROUP_CAVE" ), 2, point( 6, 6 ), point( 18, 18 ), 1.0 ); + m->place_spawns( GROUP_CAVE, 2, point( 6, 6 ), point( 18, 18 ), 1.0 ); } else { // We're above ground! // First, draw a forest mapgendata forest_mapgen_dat( dat, oter_str_id( "forest" ).id() ); diff --git a/src/martialarts.cpp b/src/martialarts.cpp index b786d6b362a3b..a5ae9dc53d148 100644 --- a/src/martialarts.cpp +++ b/src/martialarts.cpp @@ -29,6 +29,7 @@ #include "pldata.h" #include "enums.h" #include "optional.h" +#include "cata_string_consts.h" namespace { @@ -434,12 +435,12 @@ bool ma_requirements::is_valid_character( const Character &u ) const //to all weapons (such as Ninjutsu sneak attacks or innate weapon techniques like RAPID) //or if the weapon is flagged as being compatible with the style. Some techniques have //further restrictions on required weapon properties (is_valid_weapon). - bool cqb = u.has_active_bionic( bionic_id( "bio_cqb" ) ); + bool cqb = u.has_active_bionic( bio_cqb ); // There are 4 different cases of "armedness": // Truly unarmed, unarmed weapon, style-allowed weapon, generic weapon bool melee_style = u.martial_arts_data.selected_strictly_melee(); bool is_armed = u.is_armed(); - bool unarmed_weapon = is_armed && u.used_weapon().has_flag( "UNARMED_WEAPON" ); + bool unarmed_weapon = is_armed && u.used_weapon().has_flag( flag_UNARMED_WEAPON ); bool forced_unarmed = u.martial_arts_data.selected_force_unarmed(); bool weapon_ok = is_valid_weapon( u.weapon ); bool style_weapon = u.martial_arts_data.selected_has_weapon( u.weapon.typeId() ); @@ -938,14 +939,14 @@ bool character_martial_arts::can_leg_block( const Character &owner ) const { const martialart &ma = style_selected.obj(); ///\EFFECT_UNARMED increases ability to perform leg block - int unarmed_skill = owner.has_active_bionic( bionic_id( "bio_cqb" ) ) ? 5 : owner.get_skill_level( - skill_id( "unarmed" ) ); + int unarmed_skill = owner.has_active_bionic( bio_cqb ) ? 5 : owner.get_skill_level( + skill_unarmed ); // Success conditions. if( owner.get_working_leg_count() >= 1 ) { if( unarmed_skill >= ma.leg_block ) { return true; - } else if( ma.leg_block_with_bio_armor_legs && owner.has_bionic( bionic_id( "bio_armor_legs" ) ) ) { + } else if( ma.leg_block_with_bio_armor_legs && owner.has_bionic( bio_armor_legs ) ) { return true; } } @@ -957,14 +958,14 @@ bool character_martial_arts::can_arm_block( const Character &owner ) const { const martialart &ma = style_selected.obj(); ///\EFFECT_UNARMED increases ability to perform arm block - int unarmed_skill = owner.has_active_bionic( bionic_id( "bio_cqb" ) ) ? 5 : owner.get_skill_level( - skill_id( "unarmed" ) ); + int unarmed_skill = owner.has_active_bionic( bio_cqb ) ? 5 : owner.get_skill_level( + skill_unarmed ); // Success conditions. if( !owner.is_limb_broken( hp_arm_l ) || !owner.is_limb_broken( hp_arm_r ) ) { if( unarmed_skill >= ma.arm_block ) { return true; - } else if( ma.arm_block_with_bio_armor_arms && owner.has_bionic( bionic_id( "bio_armor_arms" ) ) ) { + } else if( ma.arm_block_with_bio_armor_arms && owner.has_bionic( bio_armor_arms ) ) { return true; } } diff --git a/src/mattack_actors.cpp b/src/mattack_actors.cpp index 307c64bdff858..52273a6a408cd 100644 --- a/src/mattack_actors.cpp +++ b/src/mattack_actors.cpp @@ -24,15 +24,7 @@ #include "rng.h" #include "material.h" #include "point.h" - -static const efftype_id effect_grabbed( "grabbed" ); -static const efftype_id effect_bite( "bite" ); -static const efftype_id effect_infected( "infected" ); -static const efftype_id effect_laserlocked( "laserlocked" ); -static const efftype_id effect_was_laserlocked( "was_laserlocked" ); -static const efftype_id effect_targeted( "targeted" ); -static const efftype_id effect_poison( "poison" ); -static const efftype_id effect_badpoison( "badpoison" ); +#include "cata_string_consts.h" // Simplified version of the function in monattack.cpp static bool is_adjacent( const monster &z, const Creature &target ) @@ -362,7 +354,7 @@ void bite_actor::on_damage( monster &z, Creature &target, dealt_damage_instance target.add_effect( effect_bite, 1_turns, hit, true ); } } - if( target.has_trait( trait_id( "TOXICFLESH" ) ) ) { + if( target.has_trait( trait_TOXICFLESH ) ) { z.add_effect( effect_poison, 5_minutes ); z.add_effect( effect_badpoison, 5_minutes ); } diff --git a/src/memorial_logger.cpp b/src/memorial_logger.cpp index c4243141fa7b8..3dd7fe47bacba 100644 --- a/src/memorial_logger.cpp +++ b/src/memorial_logger.cpp @@ -19,11 +19,7 @@ #include "profession.h" #include "skill.h" #include "stats_tracker.h" - -static const efftype_id effect_adrenaline( "adrenaline" ); -static const efftype_id effect_datura( "datura" ); -static const efftype_id effect_drunk( "drunk" ); -static const efftype_id effect_jetinjector( "jetinjector" ); +#include "cata_string_consts.h" static const trap_str_id tr_bubblewrap( "tr_bubblewrap" ); static const trap_str_id tr_glass( "tr_glass" ); @@ -55,10 +51,6 @@ static const trap_str_id tr_drain( "tr_drain" ); static const trap_str_id tr_snake( "tr_snake" ); static const trap_str_id tr_glass_pit( "tr_glass_pit" ); -static const trait_id trait_CANNIBAL( "CANNIBAL" ); -static const trait_id trait_PSYCHOPATH( "PSYCHOPATH" ); -static const trait_id trait_SAPIOVORE( "SAPIOVORE" ); - void memorial_logger::clear() { log.clear(); diff --git a/src/mission_companion.cpp b/src/mission_companion.cpp index c4743492905b3..1db7e6b1ed35a 100644 --- a/src/mission_companion.cpp +++ b/src/mission_companion.cpp @@ -57,23 +57,7 @@ #include "colony.h" #include "point.h" #include "weather.h" - -static const skill_id skill_dodge( "dodge" ); -static const skill_id skill_gun( "gun" ); -static const skill_id skill_unarmed( "unarmed" ); -static const skill_id skill_cutting( "cutting" ); -static const skill_id skill_stabbing( "stabbing" ); -static const skill_id skill_bashing( "bashing" ); -static const skill_id skill_melee( "melee" ); -static const skill_id skill_fabrication( "fabrication" ); -static const skill_id skill_survival( "survival" ); - -static const trait_id trait_NPC_CONSTRUCTION_LEV_1( "NPC_CONSTRUCTION_LEV_1" ); -static const trait_id trait_NPC_CONSTRUCTION_LEV_2( "NPC_CONSTRUCTION_LEV_2" ); -static const trait_id trait_NPC_MISSION_LEV_1( "NPC_MISSION_LEV_1" ); -static const trait_id trait_DEBUG_HS( "DEBUG_HS" ); - -static const efftype_id effect_riding( "riding" ); +#include "cata_string_consts.h" struct comp_rank { int industry; diff --git a/src/mission_start.cpp b/src/mission_start.cpp index ada5d80d19088..1e947909cd1f8 100644 --- a/src/mission_start.cpp +++ b/src/mission_start.cpp @@ -25,14 +25,7 @@ #include "item.h" #include "optional.h" #include "rng.h" - -static const mtype_id mon_dog( "mon_dog" ); -static const mtype_id mon_zombie( "mon_zombie" ); -static const mtype_id mon_zombie_brute( "mon_zombie_brute" ); -static const mtype_id mon_zombie_dog( "mon_zombie_dog" ); -static const mtype_id mon_zombie_hulk( "mon_zombie_hulk" ); -static const mtype_id mon_zombie_master( "mon_zombie_master" ); -static const mtype_id mon_zombie_necro( "mon_zombie_necro" ); +#include "cata_string_consts.h" /* These functions are responsible for making changes to the game at the moment * the mission is accepted by the player. They are also responsible for diff --git a/src/monattack.cpp b/src/monattack.cpp index 81b9986527c45..e4f6294572919 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -71,99 +71,7 @@ #include "material.h" #include "point.h" #include "units.h" - -static const mtype_id mon_ant_acid_larva( "mon_ant_acid_larva" ); -static const mtype_id mon_ant_acid_queen( "mon_ant_acid_queen" ); -static const mtype_id mon_ant_larva( "mon_ant_larva" ); -static const mtype_id mon_biollante( "mon_biollante" ); -static const mtype_id mon_blob( "mon_blob" ); -static const mtype_id mon_blob_brain( "mon_blob_brain" ); -static const mtype_id mon_blob_large( "mon_blob_large" ); -static const mtype_id mon_blob_small( "mon_blob_small" ); -static const mtype_id mon_breather( "mon_breather" ); -static const mtype_id mon_breather_hub( "mon_breather_hub" ); -static const mtype_id mon_creeper_hub( "mon_creeper_hub" ); -static const mtype_id mon_creeper_vine( "mon_creeper_vine" ); -static const mtype_id mon_dermatik( "mon_dermatik" ); -static const mtype_id mon_defective_robot_nurse( "mon_nursebot_defective" ); -static const mtype_id mon_fungal_hedgerow( "mon_fungal_hedgerow" ); -static const mtype_id mon_fungaloid( "mon_fungaloid" ); -static const mtype_id mon_fungaloid_young( "mon_fungaloid_young" ); -static const mtype_id mon_fungal_tendril( "mon_fungal_tendril" ); -static const mtype_id mon_fungal_wall( "mon_fungal_wall" ); -static const mtype_id mon_headless_dog_thing( "mon_headless_dog_thing" ); -static const mtype_id mon_manhack( "mon_manhack" ); -static const mtype_id mon_shadow( "mon_shadow" ); -static const mtype_id mon_leech_stalk( "mon_leech_stalk" ); -static const mtype_id mon_leech_blossom( "mon_leech_blossom" ); -static const mtype_id mon_leech_root_runner( "mon_leech_root_runner" ); -static const mtype_id mon_leech_root_drone( "mon_leech_root_drone" ); -static const mtype_id mon_hound_tindalos_afterimage( "mon_hound_tindalos_afterimage" ); -static const mtype_id mon_triffid( "mon_triffid" ); -static const mtype_id mon_zombie_gasbag_impaler( "mon_zombie_gasbag_impaler" ); -static const mtype_id mon_zombie_gasbag_crawler( "mon_zombie_gasbag_crawler" ); -static const mtype_id mon_turret_searchlight( "mon_turret_searchlight" ); -static const mtype_id mon_zombie_dancer( "mon_zombie_dancer" ); -static const mtype_id mon_zombie_jackson( "mon_zombie_jackson" ); -static const mtype_id mon_zombie_skeltal_minion( "mon_zombie_skeltal_minion" ); - -static const skill_id skill_melee( "melee" ); -static const skill_id skill_gun( "gun" ); -static const skill_id skill_unarmed( "unarmed" ); -static const skill_id skill_rifle( "rifle" ); -static const skill_id skill_launcher( "launcher" ); - -static const species_id ZOMBIE( "ZOMBIE" ); -static const species_id BLOB( "BLOB" ); -static const species_id LEECH_PLANT( "LEECH_PLANT" ); - -static const efftype_id effect_assisted( "assisted" ); -static const efftype_id effect_bite( "bite" ); -static const efftype_id effect_bleed( "bleed" ); -static const efftype_id effect_blind( "blind" ); -static const efftype_id effect_boomered( "boomered" ); -static const efftype_id effect_controlled( "controlled" ); -static const efftype_id effect_corroding( "corroding" ); -static const efftype_id effect_countdown( "countdown" ); -static const efftype_id effect_darkness( "darkness" ); -static const efftype_id effect_dazed( "dazed" ); -static const efftype_id effect_deaf( "deaf" ); -static const efftype_id effect_dermatik( "dermatik" ); -static const efftype_id effect_downed( "downed" ); -static const efftype_id effect_dragging( "dragging" ); -static const efftype_id effect_fearparalyze( "fearparalyze" ); -static const efftype_id effect_fungus( "fungus" ); -static const efftype_id effect_glowing( "glowing" ); -static const efftype_id effect_got_checked( "got_checked" ); -static const efftype_id effect_grabbed( "grabbed" ); -static const efftype_id effect_grown_of_fuse( "grown_of_fuse" ); -static const efftype_id effect_grabbing( "grabbing" ); -static const efftype_id effect_has_bag( "has_bag" ); -static const efftype_id effect_infected( "infected" ); -static const efftype_id effect_laserlocked( "laserlocked" ); -static const efftype_id effect_onfire( "onfire" ); -static const efftype_id effect_operating( "operating" ); -static const efftype_id effect_paralyzepoison( "paralyzepoison" ); -static const efftype_id effect_paid( "paid" ); -static const efftype_id effect_pet( "pet" ); -static const efftype_id effect_raising( "raising" ); -static const efftype_id effect_rat( "rat" ); -static const efftype_id effect_shrieking( "shrieking" ); -static const efftype_id effect_slimed( "slimed" ); -static const efftype_id effect_stunned( "stunned" ); -static const efftype_id effect_targeted( "targeted" ); -static const efftype_id effect_teleglow( "teleglow" ); -static const efftype_id effect_under_op( "under_operation" ); - -static const trait_id trait_ACIDBLOOD( "ACIDBLOOD" ); -static const trait_id trait_MARLOSS_BLUE( "MARLOSS_BLUE" ); -static const trait_id trait_MARLOSS( "MARLOSS" ); -static const trait_id trait_PARAIMMUNE( "PARAIMMUNE" ); -static const trait_id trait_TAIL_CATTLE( "TAIL_CATTLE" ); -static const trait_id trait_THRESH_MARLOSS( "THRESH_MARLOSS" ); -static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" ); - -static const std::string flag_AUTODOC_COUCH( "AUTODOC_COUCH" ); +#include "cata_string_consts.h" // shared utility functions static bool within_visual_range( monster *z, int max_range ) @@ -783,7 +691,7 @@ bool mattack::pull_metal_weapon( monster *z ) target->add_msg_player_or_npc( m_type, _( "%s is pulled away from your hands!" ), _( "%s is pulled away from 's hands!" ), foe->weapon.tname() ); z->add_item( foe->remove_weapon() ); - if( foe->has_activity( activity_id( "ACT_RELOAD" ) ) ) { + if( foe->has_activity( ACT_RELOAD ) ) { foe->cancel_activity(); } } else { @@ -3092,7 +3000,7 @@ bool mattack::photograph( monster *z ) // Badges should NOT be swappable between roles. // Hence separate checking. // If you are in fact listed as a police officer - if( g->u.has_trait( trait_id( "PROF_POLICE" ) ) ) { + if( g->u.has_trait( trait_PROF_POLICE ) ) { // And you're wearing your badge if( g->u.is_wearing( "badge_deputy" ) ) { if( one_in( 3 ) ) { @@ -3112,7 +3020,7 @@ bool mattack::photograph( monster *z ) } } - if( g->u.has_trait( trait_id( "PROF_PD_DET" ) ) ) { + if( g->u.has_trait( trait_PROF_PD_DET ) ) { // And you have your shield on if( g->u.is_wearing( "badge_detective" ) ) { if( one_in( 4 ) ) { @@ -3130,7 +3038,7 @@ bool mattack::photograph( monster *z ) return true; } } - } else if( g->u.has_trait( trait_id( "PROF_SWAT" ) ) ) { + } else if( g->u.has_trait( trait_PROF_SWAT ) ) { // And you're wearing your badge if( g->u.is_wearing( "badge_swat" ) ) { if( one_in( 3 ) ) { @@ -3147,7 +3055,7 @@ bool mattack::photograph( monster *z ) return true; } } - } else if( g->u.has_trait( trait_id( "PROF_CYBERCOP" ) ) ) { + } else if( g->u.has_trait( trait_PROF_CYBERCO ) ) { // And you're wearing your badge if( g->u.is_wearing( "badge_cybercop" ) ) { if( one_in( 3 ) ) { @@ -3167,7 +3075,7 @@ bool mattack::photograph( monster *z ) } } - if( g->u.has_trait( trait_id( "PROF_FED" ) ) ) { + if( g->u.has_trait( trait_PROF_FED ) ) { // And you're wearing your badge if( g->u.is_wearing( "badge_marshal" ) ) { add_msg( m_info, _( "The %s flashes a LED and departs. The Feds got this." ), z->name() ); @@ -3306,7 +3214,7 @@ void mattack::frag( monster *z, Creature *target ) // This is for the bots, not if( target == &g->u ) { if( !z->has_effect( effect_targeted ) ) { - if( g->u.has_trait( trait_id( "PROF_CHURL" ) ) ) { + if( g->u.has_trait( trait_PROF_CHURL ) ) { //~ Potential grenading detected. add_msg( m_warning, _( "Thee eye o dat divil be upon me!" ) ); } else { @@ -4694,7 +4602,7 @@ bool mattack::riotbot( monster *z ) handcuffs.set_var( "HANDCUFFS_X", foe->posx() ); handcuffs.set_var( "HANDCUFFS_Y", foe->posy() ); - const bool is_uncanny = foe->has_active_bionic( bionic_id( "bio_uncanny_dodge" ) ) && + const bool is_uncanny = foe->has_active_bionic( bio_uncanny_dodge ) && foe->get_power_level() > 74_kJ && !one_in( 3 ); ///\EFFECT_DEX >13 allows and increases chance to slip out of riot bot handcuffs diff --git a/src/mondeath.cpp b/src/mondeath.cpp index 6452f4adc78f0..75c6b7a1e1739 100644 --- a/src/mondeath.cpp +++ b/src/mondeath.cpp @@ -47,36 +47,7 @@ #include "colony.h" #include "point.h" #include "mattack_actors.h" - -static const mtype_id mon_blob( "mon_blob" ); -static const mtype_id mon_blob_brain( "mon_blob_brain" ); -static const mtype_id mon_blob_small( "mon_blob_small" ); -static const mtype_id mon_breather( "mon_breather" ); -static const mtype_id mon_breather_hub( "mon_breather_hub" ); -static const mtype_id mon_creeper_hub( "mon_creeper_hub" ); -static const mtype_id mon_creeper_vine( "mon_creeper_vine" ); -static const mtype_id mon_halfworm( "mon_halfworm" ); -static const mtype_id mon_sewer_rat( "mon_sewer_rat" ); -static const mtype_id mon_thing( "mon_thing" ); -static const mtype_id mon_zombie_dancer( "mon_zombie_dancer" ); -static const mtype_id mon_zombie_hulk( "mon_zombie_hulk" ); -static const mtype_id mon_giant_cockroach_nymph( "mon_giant_cockroach_nymph" ); - -static const species_id ZOMBIE( "ZOMBIE" ); -static const species_id BLOB( "BLOB" ); - -static const efftype_id effect_amigara( "amigara" ); -static const efftype_id effect_boomered( "boomered" ); -static const efftype_id effect_controlled( "controlled" ); -static const efftype_id effect_darkness( "darkness" ); -static const efftype_id effect_glowing( "glowing" ); -static const efftype_id effect_no_ammo( "no_ammo" ); -static const efftype_id effect_pacified( "pacified" ); -static const efftype_id effect_rat( "rat" ); - -static const trait_id trait_PACIFIST( "PACIFIST" ); -static const trait_id trait_PSYCHOPATH( "PSYCHOPATH" ); -static const trait_id trait_KILLER( "KILLER" ); +#include "cata_string_consts.h" void mdeath::normal( monster &z ) { diff --git a/src/mondefense.cpp b/src/mondefense.cpp index 3e7bff7e802a5..bb69950d91db5 100644 --- a/src/mondefense.cpp +++ b/src/mondefense.cpp @@ -26,9 +26,7 @@ #include "enums.h" #include "item.h" #include "point.h" - -static const skill_id skill_gun( "gun" ); -static const skill_id skill_rifle( "rifle" ); +#include "cata_string_consts.h" void mdefense::none( monster &, Creature *, const dealt_projectile_attack * ) { diff --git a/src/monexamine.cpp b/src/monexamine.cpp index 66758d9ccdaf9..469a8791d48a4 100644 --- a/src/monexamine.cpp +++ b/src/monexamine.cpp @@ -36,20 +36,7 @@ #include "type_id.h" #include "pimpl.h" #include "point.h" - -static const species_id ZOMBIE( "ZOMBIE" ); - -static const efftype_id effect_controlled( "controlled" ); -static const efftype_id effect_harnessed( "harnessed" ); -static const efftype_id effect_has_bag( "has_bag" ); -static const efftype_id effect_milked( "milked" ); -static const efftype_id effect_monster_armor( "monster_armor" ); -static const efftype_id effect_paid( "paid" ); -static const efftype_id effect_pet( "pet" ); -static const efftype_id effect_tied( "tied" ); -static const efftype_id effect_ridden( "ridden" ); -static const efftype_id effect_saddled( "monster_saddled" ); -static const skill_id skill_survival( "survival" ); +#include "cata_string_consts.h" bool monexamine::pet_menu( monster &z ) { @@ -621,7 +608,7 @@ void monexamine::remove_armor( monster &z ) void monexamine::play_with( monster &z ) { std::string pet_name = z.get_name(); - g->u.assign_activity( activity_id( "ACT_PLAY_WITH_PET" ), rng( 50, 125 ) * 100 ); + g->u.assign_activity( ACT_PLAY_WITH_PET, rng( 50, 125 ) * 100 ); g->u.activity.str_values.push_back( pet_name ); } diff --git a/src/monmove.cpp b/src/monmove.cpp index 7fb71607ca0b8..a91efe9bdebe5 100644 --- a/src/monmove.cpp +++ b/src/monmove.cpp @@ -40,30 +40,10 @@ #include "string_id.h" #include "pimpl.h" #include "string_formatter.h" +#include "cata_string_consts.h" #define MONSTER_FOLLOW_DIST 8 -static const species_id FUNGUS( "FUNGUS" ); -static const species_id INSECT( "INSECT" ); -static const species_id SPIDER( "SPIDER" ); - -static const efftype_id effect_bouldering( "bouldering" ); -static const efftype_id effect_countdown( "countdown" ); -static const efftype_id effect_docile( "docile" ); -static const efftype_id effect_downed( "downed" ); -static const efftype_id effect_dragging( "dragging" ); -static const efftype_id effect_grabbed( "grabbed" ); -static const efftype_id effect_no_sight( "no_sight" ); -static const efftype_id effect_operating( "operating" ); -static const efftype_id effect_pacified( "pacified" ); -static const efftype_id effect_pushed( "pushed" ); -static const efftype_id effect_stunned( "stunned" ); -static const efftype_id effect_harnessed( "harnessed" ); - -static const species_id ZOMBIE( "ZOMBIE" ); - -static const std::string flag_AUTODOC_COUCH( "AUTODOC_COUCH" ); - bool monster::wander() { return ( goal == pos() ); diff --git a/src/monster.cpp b/src/monster.cpp index d5febe437a377..56539f1e6d6b1 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -53,6 +53,7 @@ #include "string_id.h" #include "flat_set.h" #include "weather.h" +#include "cata_string_consts.h" struct pathfinding_settings; @@ -61,108 +62,6 @@ struct pathfinding_settings; // The rough formula is 2^(-x), e.g. for x = 5 it's 0.03125 (~ 3%). #define UPGRADE_MAX_ITERS 5 -static const mtype_id mon_ant( "mon_ant" ); -static const mtype_id mon_ant_fungus( "mon_ant_fungus" ); -static const mtype_id mon_ant_queen( "mon_ant_queen" ); -static const mtype_id mon_ant_soldier( "mon_ant_soldier" ); -static const mtype_id mon_beekeeper( "mon_beekeeper" ); -static const mtype_id mon_boomer( "mon_boomer" ); -static const mtype_id mon_boomer_huge( "mon_boomer_huge" ); -static const mtype_id mon_boomer_fungus( "mon_boomer_fungus" ); -static const mtype_id mon_fungaloid( "mon_fungaloid" ); -static const mtype_id mon_triffid( "mon_triffid" ); -static const mtype_id mon_triffid_queen( "mon_triffid_queen" ); -static const mtype_id mon_triffid_young( "mon_triffid_young" ); -static const mtype_id mon_zombie( "mon_zombie" ); -static const mtype_id mon_zombie_bio_op( "mon_zombie_bio_op" ); -static const mtype_id mon_zombie_brute( "mon_zombie_brute" ); -static const mtype_id mon_zombie_brute_shocker( "mon_zombie_brute_shocker" ); -static const mtype_id mon_zombie_child( "mon_zombie_child" ); -static const mtype_id mon_zombie_cop( "mon_zombie_cop" ); -static const mtype_id mon_zombie_electric( "mon_zombie_electric" ); -static const mtype_id mon_zombie_fat( "mon_zombie_fat" ); -static const mtype_id mon_zombie_fireman( "mon_zombie_fireman" ); -static const mtype_id mon_zombie_fungus( "mon_zombie_fungus" ); -static const mtype_id mon_zombie_gasbag( "mon_zombie_gasbag" ); -static const mtype_id mon_zombie_gasbag_fungus( "mon_zombie_gasbag_fungus" ); -static const mtype_id mon_zombie_grabber( "mon_zombie_grabber" ); -static const mtype_id mon_zombie_hazmat( "mon_zombie_hazmat" ); -static const mtype_id mon_zombie_hulk( "mon_zombie_hulk" ); -static const mtype_id mon_skeleton_hulk( "mon_skeleton_hulk" ); -static const mtype_id mon_skeleton_hulk_fungus( "mon_skeleton_hulk_fungus" ); -static const mtype_id mon_skeleton_brute( "mon_skeleton_brute" ); -static const mtype_id mon_zombie_hunter( "mon_zombie_hunter" ); -static const mtype_id mon_zombie_master( "mon_zombie_master" ); -static const mtype_id mon_zombie_necro( "mon_zombie_necro" ); -static const mtype_id mon_zombie_rot( "mon_zombie_rot" ); -static const mtype_id mon_zombie_scientist( "mon_zombie_scientist" ); -static const mtype_id mon_zombie_shrieker( "mon_zombie_shrieker" ); -static const mtype_id mon_zombie_smoker( "mon_zombie_smoker" ); -static const mtype_id mon_zombie_smoker_fungus( "mon_zombie_smoker_fungus" ); -static const mtype_id mon_zombie_soldier( "mon_zombie_soldier" ); -static const mtype_id mon_zombie_spitter( "mon_zombie_spitter" ); -static const mtype_id mon_zombie_survivor( "mon_zombie_survivor" ); -static const mtype_id mon_zombie_swimmer( "mon_zombie_swimmer" ); -static const mtype_id mon_zombie_technician( "mon_zombie_technician" ); -static const mtype_id mon_zombie_tough( "mon_zombie_tough" ); -static const mtype_id mon_zombie_child_fungus( "mon_zombie_child_fungus" ); -static const mtype_id mon_zombie_anklebiter( "mon_zombie_anklebiter" ); -static const mtype_id mon_zombie_creepy( "mon_zombie_creepy" ); -static const mtype_id mon_zombie_sproglodyte( "mon_zombie_sproglodyte" ); -static const mtype_id mon_zombie_shriekling( "mon_zombie_shriekling" ); -static const mtype_id mon_zombie_snotgobbler( "mon_zombie_snotgobbler" ); -static const mtype_id mon_zombie_waif( "mon_zombie_waif" ); -static const mtype_id mon_spider_fungus( "mon_spider_fungus" ); - -static const species_id ZOMBIE( "ZOMBIE" ); -static const species_id FUNGUS( "FUNGUS" ); -static const species_id INSECT( "INSECT" ); -static const species_id MAMMAL( "MAMMAL" ); -static const species_id ABERRATION( "ABERRATION" ); -static const species_id MOLLUSK( "MOLLUSK" ); -static const species_id ROBOT( "ROBOT" ); -static const species_id FISH( "FISH" ); -static const species_id SPIDER( "SPIDER" ); - -static const efftype_id effect_badpoison( "badpoison" ); -static const efftype_id effect_beartrap( "beartrap" ); -static const efftype_id effect_bleed( "bleed" ); -static const efftype_id effect_blind( "blind" ); -static const efftype_id effect_bouldering( "bouldering" ); -static const efftype_id effect_crushed( "crushed" ); -static const efftype_id effect_deaf( "deaf" ); -static const efftype_id effect_docile( "docile" ); -static const efftype_id effect_downed( "downed" ); -static const efftype_id effect_emp( "emp" ); -static const efftype_id effect_grabbed( "grabbed" ); -static const efftype_id effect_grabbing( "grabbing" ); -static const efftype_id effect_heavysnare( "heavysnare" ); -static const efftype_id effect_hit_by_player( "hit_by_player" ); -static const efftype_id effect_in_pit( "in_pit" ); -static const efftype_id effect_lightsnare( "lightsnare" ); -static const efftype_id effect_monster_armor( "monster_armor" ); -static const efftype_id effect_no_sight( "no_sight" ); -static const efftype_id effect_onfire( "onfire" ); -static const efftype_id effect_pacified( "pacified" ); -static const efftype_id effect_paralyzepoison( "paralyzepoison" ); -static const efftype_id effect_poison( "poison" ); -static const efftype_id effect_ridden( "ridden" ); -static const efftype_id effect_saddled( "saddled" ); -static const efftype_id effect_run( "run" ); -static const efftype_id effect_stunned( "stunned" ); -static const efftype_id effect_supercharged( "supercharged" ); -static const efftype_id effect_tied( "tied" ); -static const efftype_id effect_webbed( "webbed" ); - -static const trait_id trait_ANIMALDISCORD( "ANIMALDISCORD" ); -static const trait_id trait_ANIMALDISCORD2( "ANIMALDISCORD2" ); -static const trait_id trait_ANIMALEMPATH( "ANIMALEMPATH" ); -static const trait_id trait_ANIMALEMPATH2( "ANIMALEMPATH2" ); -static const trait_id trait_BEE( "BEE" ); -static const trait_id trait_FLOWERS( "FLOWERS" ); -static const trait_id trait_PACIFIST( "PACIFIST" ); -static const trait_id trait_KILLER( "KILLER" ); - static const std::map size_names { { m_size::MS_TINY, to_translation( "size adj", "tiny" ) }, { m_size::MS_SMALL, to_translation( "size adj", "small" ) }, @@ -1023,11 +922,6 @@ monster_attitude monster::attitude( const Character *u ) const if( u != nullptr ) { // Those are checked quite often, so avoiding string construction is a good idea static const string_id faction_bee( "bee" ); - static const trait_id pheromone_mammal( "PHEROMONE_MAMMAL" ); - static const trait_id pheromone_insect( "PHEROMONE_INSECT" ); - static const trait_id mycus_thresh( "THRESH_MYCUS" ); - static const trait_id mycus_friend( "MYCUS_FRIEND" ); - static const trait_id terrifying( "TERRIFYING" ); if( faction == faction_bee ) { if( u->has_trait( trait_BEE ) ) { return MATT_FRIEND; @@ -1036,18 +930,18 @@ monster_attitude monster::attitude( const Character *u ) const } } - if( type->in_species( FUNGUS ) && ( u->has_trait( mycus_thresh ) || - u->has_trait( mycus_friend ) ) ) { + if( type->in_species( FUNGUS ) && ( u->has_trait( trait_MYCUS_THRESH ) || + u->has_trait( trait_MYCUS_FRIEND ) ) ) { return MATT_FRIEND; } if( effective_anger >= 10 && - ( ( type->in_species( MAMMAL ) && u->has_trait( pheromone_mammal ) ) || - ( type->in_species( INSECT ) && u->has_trait( pheromone_insect ) ) ) ) { + ( ( type->in_species( MAMMAL ) && u->has_trait( trait_PHEROMONE_MAMMAL ) ) || + ( type->in_species( INSECT ) && u->has_trait( trait_PHEROMONE_INSECT ) ) ) ) { effective_anger -= 20; } - if( u->has_trait( terrifying ) ) { + if( u->has_trait( trait_TERRIFYING ) ) { effective_morale -= 10; } diff --git a/src/morale.cpp b/src/morale.cpp index 56deac7f4d086..c13b6f34d55ad 100644 --- a/src/morale.cpp +++ b/src/morale.cpp @@ -20,11 +20,7 @@ #include "translations.h" #include "color.h" #include "enums.h" - -static const efftype_id effect_cold( "cold" ); -static const efftype_id effect_hot( "hot" ); -static const efftype_id effect_took_prozac( "took_prozac" ); -static const efftype_id effect_took_prozac_bad( "took_prozac_bad" ); +#include "cata_string_consts.h" namespace { @@ -246,24 +242,24 @@ player_morale::player_morale() : const auto update_constrained = std::bind( &player_morale::update_constrained_penalty, _1 ); const auto update_masochist = std::bind( &player_morale::update_masochist_bonus, _1 ); - mutations[trait_id( "OPTIMISTIC" )] = mutation_data( - std::bind( set_optimist, _1, 9 ), - std::bind( set_optimist, _1, 0 ) ); - mutations[trait_id( "BADTEMPER" )] = mutation_data( - std::bind( set_badtemper, _1, -9 ), - std::bind( set_badtemper, _1, 0 ) ); - mutations[trait_id( "STYLISH" )] = mutation_data( - std::bind( set_stylish, _1, true ), - std::bind( set_stylish, _1, false ) ); - mutations[trait_id( "FLOWERS" )] = mutation_data( update_constrained ); - mutations[trait_id( "ROOTS1" )] = mutation_data( update_constrained ); - mutations[trait_id( "ROOTS2" )] = mutation_data( update_constrained ); - mutations[trait_id( "ROOTS3" )] = mutation_data( update_constrained ); - mutations[trait_id( "LEAVES2" )] = mutation_data( update_constrained ); - mutations[trait_id( "LEAVES3" )] = mutation_data( update_constrained ); - mutations[trait_id( "MASOCHIST" )] = mutation_data( update_masochist ); - mutations[trait_id( "MASOCHIST_MED" )] = mutation_data( update_masochist ); - mutations[trait_id( "CENOBITE" )] = mutation_data( update_masochist ); + mutations[trait_OPTIMISTIC] = mutation_data( + std::bind( set_optimist, _1, 9 ), + std::bind( set_optimist, _1, 0 ) ); + mutations[trait_BADTEMPER] = mutation_data( + std::bind( set_badtemper, _1, -9 ), + std::bind( set_badtemper, _1, 0 ) ); + mutations[trait_STYLISH] = mutation_data( + std::bind( set_stylish, _1, true ), + std::bind( set_stylish, _1, false ) ); + mutations[trait_FLOWERS] = mutation_data( update_constrained ); + mutations[trait_ROOTS1] = mutation_data( update_constrained ); + mutations[trait_ROOTS2] = mutation_data( update_constrained ); + mutations[trait_ROOTS3] = mutation_data( update_constrained ); + mutations[trait_LEAVES2] = mutation_data( update_constrained ); + mutations[trait_LEAVES3] = mutation_data( update_constrained ); + mutations[trait_MASOCHIST] = mutation_data( update_masochist ); + mutations[trait_MASOCHIST_MED] = mutation_data( update_masochist ); + mutations[trait_CENOBITE] = mutation_data( update_masochist ); } void player_morale::add( morale_type type, int bonus, int max_bonus, @@ -853,9 +849,9 @@ void player_morale::update_stylish_bonus() void player_morale::update_masochist_bonus() { - const bool amateur_masochist = has_mutation( trait_id( "MASOCHIST" ) ); - const bool advanced_masochist = has_mutation( trait_id( "MASOCHIST_MED" ) ) || - has_mutation( trait_id( "CENOBITE" ) ); + const bool amateur_masochist = has_mutation( trait_MASOCHIST ); + const bool advanced_masochist = has_mutation( trait_MASOCHIST_MED ) || + has_mutation( trait_CENOBITE ); const bool any_masochist = amateur_masochist || advanced_masochist; int bonus = 0; @@ -910,15 +906,15 @@ void player_morale::update_constrained_penalty() }; int pen = 0; - if( has_mutation( trait_id( "FLOWERS" ) ) ) { + if( has_mutation( trait_FLOWERS ) ) { pen += bp_pen( bp_head, 10 ); } - if( has_mutation( trait_id( "ROOTS1" ) ) || has_mutation( trait_id( "ROOTS2" ) ) || - has_mutation( trait_id( "ROOTS3" ) ) ) { + if( has_mutation( trait_ROOTS1 ) || has_mutation( trait_ROOTS2 ) || + has_mutation( trait_ROOTS3 ) ) { pen += bp_pen( bp_foot_l, 5 ); pen += bp_pen( bp_foot_r, 5 ); } - if( has_mutation( trait_id( "LEAVES2" ) ) || has_mutation( trait_id( "LEAVES3" ) ) ) { + if( has_mutation( trait_LEAVES2 ) || has_mutation( trait_LEAVES3 ) ) { pen += bp_pen( bp_arm_l, 5 ); pen += bp_pen( bp_arm_r, 5 ); } diff --git a/src/mtype.cpp b/src/mtype.cpp index b606a67b57fdf..bb61e492e6437 100644 --- a/src/mtype.cpp +++ b/src/mtype.cpp @@ -11,8 +11,7 @@ #include "monstergenerator.h" #include "translations.h" #include "mapdata.h" - -static const species_id MOLLUSK( "MOLLUSK" ); +#include "cata_string_consts.h" mtype::mtype() { diff --git a/src/mutation.cpp b/src/mutation.cpp index 3ec86142ace4f..01013a305999b 100644 --- a/src/mutation.cpp +++ b/src/mutation.cpp @@ -25,36 +25,7 @@ #include "rng.h" #include "string_id.h" #include "enums.h" - -static const efftype_id effect_stunned( "stunned" ); - -static const trait_id trait_ROBUST( "ROBUST" ); -static const trait_id trait_CHAOTIC_BAD( "CHAOTIC_BAD" ); -static const trait_id trait_SLIMESPAWNER( "SLIMESPAWNER" ); -static const trait_id trait_NAUSEA( "NAUSEA" ); -static const trait_id trait_VOMITOUS( "VOMITOUS" ); -static const trait_id trait_M_FERTILE( "M_FERTILE" ); -static const trait_id trait_M_BLOOM( "M_BLOOM" ); -static const trait_id trait_M_PROVENANCE( "M_PROVENANCE" ); -static const trait_id trait_SELFAWARE( "SELFAWARE" ); -static const trait_id trait_WEB_WEAVER( "WEB_WEAVER" ); -static const trait_id trait_STR_ALPHA( "STR_ALPHA" ); -static const trait_id trait_DEX_ALPHA( "DEX_ALPHA" ); -static const trait_id trait_INT_ALPHA( "INT_ALPHA" ); -static const trait_id trait_INT_SLIME( "INT_SLIME" ); -static const trait_id trait_PER_ALPHA( "PER_ALPHA" ); -static const trait_id trait_MUTAGEN_AVOID( "MUTAGEN_AVOID" ); -static const trait_id trait_THRESH_MARLOSS( "THRESH_MARLOSS" ); -static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" ); -static const trait_id trait_M_BLOSSOMS( "M_BLOSSOMS" ); -static const trait_id trait_M_SPORES( "M_SPORES" ); -static const trait_id trait_NOPAIN( "NOPAIN" ); -static const trait_id trait_CARNIVORE( "CARNIVORE" ); -static const trait_id trait_TREE_COMMUNION( "TREE_COMMUNION" ); -static const trait_id trait_ROOTS2( "ROOTS2" ); -static const trait_id trait_ROOTS3( "ROOTS3" ); -static const trait_id trait_DEBUG_BIONIC_POWER( "DEBUG_BIONIC_POWER" ); -static const trait_id trait_DEBUG_BIONIC_POWERGEN( "DEBUG_BIONIC_POWERGEN" ); +#include "cata_string_consts.h" namespace io { @@ -537,7 +508,7 @@ void Character::activate_mutation( const trait_id &mut ) _( "You lay next to the trees letting your hair roots tangle with the trees." ) ); } - assign_activity( activity_id( "ACT_TREE_COMMUNION" ) ); + assign_activity( ACT_TREE_COMMUNION ); if( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) ) { const time_duration startup_time = has_trait( trait_ROOTS3 ) ? rng( 15_minutes, diff --git a/src/newcharacter.cpp b/src/newcharacter.cpp index 7618df70f0ebc..1a620f77dcb08 100644 --- a/src/newcharacter.cpp +++ b/src/newcharacter.cpp @@ -51,6 +51,7 @@ #include "optional.h" #include "pimpl.h" #include "type_id.h" +#include "cata_string_consts.h" // Colors used in this file: (Most else defaults to c_light_gray) #define COL_STAT_ACT c_white // Selected stat @@ -169,8 +170,8 @@ void avatar::randomize( const bool random_scenario, points_left &points, bool pl if( random_scenario ) { std::vector scenarios; for( const auto &scen : scenario::get_all() ) { - if( !scen.has_flag( "CHALLENGE" ) && - ( !scen.has_flag( "CITY_START" ) || cities_enabled ) ) { + if( !scen.has_flag( flag_CHALLENGE ) && + ( !scen.has_flag( flag_CITY_START ) || cities_enabled ) ) { scenarios.emplace_back( &scen ); } } @@ -480,10 +481,10 @@ bool avatar::create( character_type type, const std::string &tempname ) hp_cur[i] = hp_max[i]; } - if( has_trait( trait_id( "SMELLY" ) ) ) { + if( has_trait( trait_SMELLY ) ) { scent = 800; } - if( has_trait( trait_id( "WEAKSCENT" ) ) ) { + if( has_trait( trait_WEAKSCENT ) ) { scent = 300; } @@ -498,19 +499,19 @@ bool avatar::create( character_type type, const std::string &tempname ) // setup staring bank money cash = rng( -200000, 200000 ); - if( has_trait( trait_id( "XS" ) ) ) { + if( has_trait( trait_XS ) ) { set_stored_kcal( 10000 ); - toggle_trait( trait_id( "XS" ) ); + toggle_trait( trait_XS ); } - if( has_trait( trait_id( "XXXL" ) ) ) { + if( has_trait( trait_XXXL ) ) { set_stored_kcal( 125000 ); - toggle_trait( trait_id( "XXXL" ) ); + toggle_trait( trait_XXXL ); } // Learn recipes for( const auto &e : recipe_dict ) { const auto &r = e.second; - if( !r.has_flag( "SECRET" ) && !knows_recipe( &r ) && has_recipe_requirements( r ) ) { + if( !r.has_flag( flag_SECRET ) && !knows_recipe( &r ) && has_recipe_requirements( r ) ) { learn_recipe( &r ); } } @@ -520,7 +521,7 @@ bool avatar::create( character_type type, const std::string &tempname ) std::list prof_items = prof->items( male, get_mutations() ); for( item &it : prof_items ) { - if( it.has_flag( "WET" ) ) { + if( it.has_flag( flag_WET ) ) { it.active = true; it.item_counter = 450; // Give it some time to dry off } diff --git a/src/npc.cpp b/src/npc.cpp index 78a7373e30d79..402147311529e 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -63,48 +63,11 @@ #include "enums.h" #include "flat_set.h" #include "stomach.h" +#include "cata_string_consts.h" class basecamp; class monfaction; -static const skill_id skill_barter( "barter" ); -static const skill_id skill_pistol( "pistol" ); -static const skill_id skill_throw( "throw" ); -static const skill_id skill_rifle( "rifle" ); -static const skill_id skill_bashing( "bashing" ); -static const skill_id skill_stabbing( "stabbing" ); -static const skill_id skill_archery( "archery" ); -static const skill_id skill_shotgun( "shotgun" ); -static const skill_id skill_smg( "smg" ); -static const skill_id skill_cutting( "cutting" ); - -static const bionic_id bio_eye_optic( "bio_eye_optic" ); -static const bionic_id bio_memory( "bio_memory" ); - -static const efftype_id effect_contacts( "contacts" ); -static const efftype_id effect_drunk( "drunk" ); -static const efftype_id effect_high( "high" ); -static const efftype_id effect_pkill1( "pkill1" ); -static const efftype_id effect_pkill2( "pkill2" ); -static const efftype_id effect_pkill3( "pkill3" ); -static const efftype_id effect_npc_suspend( "npc_suspend" ); -static const efftype_id effect_pkill_l( "pkill_l" ); -static const efftype_id effect_infection( "infection" ); -static const efftype_id effect_bouldering( "bouldering" ); -static const efftype_id effect_npc_flee_player( "npc_flee_player" ); -static const efftype_id effect_riding( "riding" ); -static const efftype_id effect_ridden( "ridden" ); -static const efftype_id effect_controlled( "controlled" ); -static const efftype_id effect_mending( "mending" ); - -static const trait_id trait_CANNIBAL( "CANNIBAL" ); -static const trait_id trait_HYPEROPIC( "HYPEROPIC" ); -static const trait_id trait_ILLITERATE( "ILLITERATE" ); -static const trait_id trait_PROF_DICEMASTER( "PROF_DICEMASTER" ); -static const trait_id trait_PSYCHOPATH( "PSYCHOPATH" ); -static const trait_id trait_SAPIOVORE( "SAPIOVORE" ); -static const trait_id trait_TERRIFYING( "TERRIFYING" ); - void starting_clothes( npc &who, const npc_class_id &type, bool male ); void starting_inv( npc &who, const npc_class_id &type ); @@ -945,7 +908,7 @@ void npc::finish_read( item &book ) } if( ( skill_level == reading->level || !skill_level.can_train() ) || - ( ( has_trait( trait_id( "SCHIZOPHRENIC" ) ) || + ( ( has_trait( trait_SCHIZOPHRENIC ) || has_artifact_with( AEP_SCHIZO ) ) && one_in( 25 ) ) ) { if( display_messages ) { add_msg( m_info, _( "%s can no longer learn from %s." ), disp_name(), book.type_name() ); @@ -977,7 +940,7 @@ void npc::start_read( item &chosen, player *pl ) { const int time_taken = time_to_read( chosen, *pl ); const double penalty = static_cast( time_taken ) / time_to_read( chosen, *pl ); - player_activity act( activity_id( "ACT_READ" ), time_taken, 0, pl->getID().get_value() ); + player_activity act( ACT_READ, time_taken, 0, pl->getID().get_value() ); act.targets.emplace_back( item_location( *this, &chosen ) ); act.str_values.push_back( to_string( penalty ) ); // push an indentifier of martial art book to the action handling @@ -1533,7 +1496,7 @@ void npc::say( const std::string &line, const sounds::sound_t spriority ) const { std::string formatted_line = line; parse_tags( formatted_line, g->u, *this ); - if( has_trait( trait_id( "MUTE" ) ) ) { + if( has_trait( trait_MUTE ) ) { return; } @@ -2765,7 +2728,7 @@ void npc::on_load() disp_name() ); } } - if( has_trait( trait_id( "HALLUCINATION" ) ) ) { + if( has_trait( trait_HALLUCINATION ) ) { hallucination = true; } } @@ -2928,8 +2891,8 @@ bool npc::will_accept_from_player( const item &it ) const return false; } - if( is_minion() || g->u.has_trait( trait_id( "DEBUG_MIND_CONTROL" ) ) || - it.has_flag( "NPC_SAFE" ) ) { + if( is_minion() || g->u.has_trait( trait_DEBUG_MIND_CONTROL ) || + it.has_flag( flag_NPC_SAFE ) ) { return true; } @@ -3012,7 +2975,7 @@ mfaction_id npc::get_monster_faction() const return player_fac.id(); } - if( has_trait( trait_id( "BEE" ) ) ) { + if( has_trait( trait_BEE ) ) { return bee_fac.id(); } diff --git a/src/npcmove.cpp b/src/npcmove.cpp index 11c7d2b169bef..6c2e959967ec7 100644 --- a/src/npcmove.cpp +++ b/src/npcmove.cpp @@ -60,67 +60,12 @@ #include "enums.h" #include "overmap.h" #include "stomach.h" +#include "cata_string_consts.h" static constexpr float NPC_DANGER_VERY_LOW = 5.0f; static constexpr float NPC_DANGER_MAX = 150.0f; static constexpr float MAX_FLOAT = 5000000000.0f; -static const skill_id skill_firstaid( "firstaid" ); - -static const efftype_id effect_asthma( "asthma" ); -static const efftype_id effect_bandaged( "bandaged" ); -static const efftype_id effect_bite( "bite" ); -static const efftype_id effect_bleed( "bleed" ); -static const efftype_id effect_bouldering( "bouldering" ); -static const efftype_id effect_catch_up( "catch_up" ); -static const efftype_id effect_disinfected( "disinfected" ); -static const efftype_id effect_hallu( "hallu" ); -static const efftype_id effect_hit_by_player( "hit_by_player" ); -static const efftype_id effect_infected( "infected" ); -static const efftype_id effect_lying_down( "lying_down" ); -static const efftype_id effect_no_sight( "no_sight" ); -static const efftype_id effect_stunned( "stunned" ); -static const efftype_id effect_onfire( "onfire" ); -static const efftype_id effect_npc_run_away( "npc_run_away" ); -static const efftype_id effect_npc_fire_bad( "npc_fire_bad" ); -static const efftype_id effect_npc_flee_player( "npc_flee_player" ); -static const efftype_id effect_npc_player_looking( "npc_player_still_looking" ); - -// power source CBMs -static const bionic_id bio_advreactor( "bio_advreactor" ); -static const bionic_id bio_furnace( "bio_furnace" ); -static const bionic_id bio_reactor( "bio_reactor" ); - -// active defense CBMs - activate when in danger -static const bionic_id bio_ads( "bio_ads" ); -static const bionic_id bio_faraday( "bio_faraday" ); -static const bionic_id bio_heat_absorb( "bio_heat_absorb" ); -static const bionic_id bio_heat_sink( "bio_heatsink" ); -static const bionic_id bio_ods( "bio_ods" ); -static const bionic_id bio_shock( "bio_shock" ); - -// special health CBMs - activate as needed -static const bionic_id bio_painkiller( "bio_painkiller" ); -static const bionic_id bio_nanobots( "bio_nanobots" ); -static const bionic_id bio_radscrubber( "bio_radscrubber" ); -static const bionic_id bio_soporific( "bio_soporific" ); - -// health CBMs - always activate -static const bionic_id bio_leukocyte( "bio_leukocyte" ); -static const bionic_id bio_plutfilter( "bio_plutfilter" ); - -// melee CBMs - activate for melee combat -static const bionic_id bio_hydraulics( "bio_hydraulics" ); - -// weapon CBMs - activate in combat if they're better than what we have -static const bionic_id bio_lightning( "bio_chain_lightning" ); -static const bionic_id bio_laser( "bio_laser" ); -static const bionic_id bio_blade( "bio_blade" ); -static const bionic_id bio_claws( "bio_claws" ); - -static const ammotype reactor_slurry( "reactor_slurry" ); -static const ammotype plutonium( "plutonium" ); - enum npc_action : int { npc_undecided = 0, npc_pause, @@ -154,7 +99,7 @@ const std::vector defense_cbms = { { bio_ads, bio_faraday, bio_heat_absorb, - bio_heat_sink, + bio_heatsink, bio_ods, bio_shock } @@ -1695,8 +1640,8 @@ bool npc::recharge_cbm() if( use_bionic_by_id( bio_reactor ) || use_bionic_by_id( bio_advreactor ) ) { const std::function reactor_filter = []( const item & it ) { - return it.is_ammo() && ( it.ammo_type() == plutonium || - it.ammo_type() == reactor_slurry ); + return it.is_ammo() && ( it.ammo_type() == ammo_plutonium || + it.ammo_type() == ammo_reactor_slurry ); }; if( consume_cbm_items( reactor_filter ) ) { return true; @@ -3181,7 +3126,7 @@ bool npc::do_pulp() } // TODO: Don't recreate the activity every time int old_moves = moves; - assign_activity( activity_id( "ACT_PULP" ), calendar::INDEFINITELY_LONG, 0 ); + assign_activity( ACT_PULP, calendar::INDEFINITELY_LONG, 0 ); activity.placement = g->m.getabs( *pulp_location ); activity.do_turn( *this ); return moves != old_moves; diff --git a/src/npctalk.cpp b/src/npctalk.cpp index e61384eecd1aa..b17101e27dc69 100644 --- a/src/npctalk.cpp +++ b/src/npctalk.cpp @@ -72,26 +72,10 @@ #include "player_activity.h" #include "player.h" #include "point.h" +#include "cata_string_consts.h" class basecamp; -static const skill_id skill_speech( "speech" ); - -static const efftype_id effect_lying_down( "lying_down" ); -static const efftype_id effect_narcosis( "narcosis" ); -static const efftype_id effect_npc_suspend( "npc_suspend" ); -static const efftype_id effect_sleep( "sleep" ); -static const efftype_id effect_under_op( "under_operation" ); -static const efftype_id effect_riding( "riding" ); - -static const trait_id trait_DEBUG_MIND_CONTROL( "DEBUG_MIND_CONTROL" ); -static const trait_id trait_PROF_FOODP( "PROF_FOODP" ); - -static const itype_id fuel_type_animal( "animal" ); - -static const zone_type_id zone_no_investigate( "NPC_NO_INVESTIGATE" ); -static const zone_type_id zone_investigate_only( "NPC_INVESTIGATE_ONLY" ); - static std::map json_talk_topics; // Every OWED_VAL that the NPC owes you counts as +1 towards convincing @@ -802,12 +786,12 @@ void npc::talk_to_u( bool text_only, bool radio_contact ) } while( !d.done ); g->refresh_all(); - if( g->u.activity.id() == activity_id( "ACT_AIM" ) && !g->u.has_weapon() ) { + if( g->u.activity.id() == ACT_AIM && !g->u.has_weapon() ) { g->u.cancel_activity(); // don't query certain activities that are started from dialogue - } else if( g->u.activity.id() == activity_id( "ACT_TRAIN" ) || - g->u.activity.id() == activity_id( "ACT_WAIT_NPC" ) || - g->u.activity.id() == activity_id( "ACT_SOCIALIZE" ) || + } else if( g->u.activity.id() == ACT_TRAIN || + g->u.activity.id() == ACT_WAIT_NPC || + g->u.activity.id() == ACT_SOCIALIZE || g->u.activity.index == getID().get_value() ) { return; } @@ -895,7 +879,7 @@ std::string dialogue::dynamic_line( const talk_topic &the_topic ) const if( topic == "TALK_NONE" || topic == "TALK_DONE" ) { return _( "Bye." ); } else if( topic == "TALK_TRAIN" ) { - if( !g->u.backlog.empty() && g->u.backlog.front().id() == activity_id( "ACT_TRAIN" ) ) { + if( !g->u.backlog.empty() && g->u.backlog.front().id() == ACT_TRAIN ) { return _( "Shall we resume?" ); } std::vector trainable = p->skills_offered_to( g->u ); @@ -1188,7 +1172,7 @@ void dialogue::gen_responses( const talk_topic &the_topic ) } } } else if( topic == "TALK_TRAIN" ) { - if( !g->u.backlog.empty() && g->u.backlog.front().id() == activity_id( "ACT_TRAIN" ) && + if( !g->u.backlog.empty() && g->u.backlog.front().id() == ACT_TRAIN && g->u.backlog.front().index == p->getID().get_value() ) { player_activity &backlog = g->u.backlog.front(); const skill_id skillt( backlog.name ); @@ -1340,10 +1324,10 @@ int talk_trial::calc_chance( const dialogue &d ) const chance += u_mods.lie; //come on, who would suspect a robot of lying? - if( u.has_bionic( bionic_id( "bio_voice" ) ) ) { + if( u.has_bionic( bio_voice ) ) { chance += 10; } - if( u.has_bionic( bionic_id( "bio_face_mask" ) ) ) { + if( u.has_bionic( bio_face_mask ) ) { chance += 20; } break; @@ -1352,13 +1336,13 @@ int talk_trial::calc_chance( const dialogue &d ) const p.op_of_u.trust * 2 + p.op_of_u.value; chance += u_mods.persuade; - if( u.has_bionic( bionic_id( "bio_face_mask" ) ) ) { + if( u.has_bionic( bio_face_mask ) ) { chance += 10; } - if( u.has_bionic( bionic_id( "bio_deformity" ) ) ) { + if( u.has_bionic( bio_deformity ) ) { chance -= 50; } - if( u.has_bionic( bionic_id( "bio_voice" ) ) ) { + if( u.has_bionic( bio_voice ) ) { chance -= 20; } break; @@ -1367,16 +1351,16 @@ int talk_trial::calc_chance( const dialogue &d ) const p.personality.bravery * 2; chance += u_mods.intimidate; - if( u.has_bionic( bionic_id( "bio_face_mask" ) ) ) { + if( u.has_bionic( bio_face_mask ) ) { chance += 10; } - if( u.has_bionic( bionic_id( "bio_armor_eyes" ) ) ) { + if( u.has_bionic( bio_armor_eyes ) ) { chance += 10; } - if( u.has_bionic( bionic_id( "bio_deformity" ) ) ) { + if( u.has_bionic( bio_deformity ) ) { chance += 20; } - if( u.has_bionic( bionic_id( "bio_voice" ) ) ) { + if( u.has_bionic( bio_voice ) ) { chance += 20; } break; @@ -2290,8 +2274,6 @@ void talk_effect_fun_t::set_u_buy_monster( const std::string &monster_type_id, i } const mtype_id mtype( monster_type_id ); - const efftype_id effect_pet( "pet" ); - const efftype_id effect_pacified( "pacified" ); for( int i = 0; i < count; i++ ) { monster *const mon_ptr = g->place_critter_around( mtype, u.pos(), 3 ); diff --git a/src/npctalk_funcs.cpp b/src/npctalk_funcs.cpp index 9b3ce092d3858..216fd0003b618 100644 --- a/src/npctalk_funcs.cpp +++ b/src/npctalk_funcs.cpp @@ -48,30 +48,12 @@ #include "material.h" #include "monster.h" #include "point.h" +#include "cata_string_consts.h" struct itype; #define dbg(x) DebugLog((DebugLevel)(x), D_NPC) << __FILE__ << ":" << __LINE__ << ": " -static const efftype_id effect_allow_sleep( "allow_sleep" ); -static const efftype_id effect_asked_for_item( "asked_for_item" ); -static const efftype_id effect_asked_personal_info( "asked_personal_info" ); -static const efftype_id effect_asked_to_follow( "asked_to_follow" ); -static const efftype_id effect_asked_to_lead( "asked_to_lead" ); -static const efftype_id effect_asked_to_train( "asked_to_train" ); -static const efftype_id effect_bite( "bite" ); -static const efftype_id effect_bleed( "bleed" ); -static const efftype_id effect_currently_busy( "currently_busy" ); -static const efftype_id effect_infected( "infected" ); -static const efftype_id effect_lying_down( "lying_down" ); -static const efftype_id effect_npc_suspend( "npc_suspend" ); -static const efftype_id effect_sleep( "sleep" ); -static const efftype_id effect_pet( "pet" ); - -static const mtype_id mon_horse( "mon_horse" ); -static const mtype_id mon_cow( "mon_cow" ); -static const mtype_id mon_chicken( "mon_chicken" ); - void spawn_animal( npc &p, const mtype_id &mon ); void talk_function::nothing( npc & ) @@ -196,12 +178,12 @@ void talk_function::start_trade( npc &p ) void talk_function::sort_loot( npc &p ) { - p.assign_activity( activity_id( "ACT_MOVE_LOOT" ) ); + p.assign_activity( ACT_MOVE_LOOT ); } void talk_function::do_construction( npc &p ) { - p.assign_activity( activity_id( "ACT_MULTIPLE_CONSTRUCTION" ) ); + p.assign_activity( ACT_MULTIPLE_CONSTRUCTION ); } void talk_function::do_read( npc &p ) @@ -220,7 +202,7 @@ void talk_function::find_mount( npc &p ) for( monster &critter : g->all_monsters() ) { if( p.can_mount( critter ) ) { // keep the horse still for some time, so that NPC can catch up to it nad mount it. - p.assign_activity( activity_id( "ACT_FIND_MOUNT" ) ); + p.assign_activity( ACT_FIND_MOUNT ); p.chosen_mount = g->shared_from( critter ); // we found one, thats all we need. return; @@ -234,37 +216,37 @@ void talk_function::find_mount( npc &p ) void talk_function::do_butcher( npc &p ) { - p.assign_activity( activity_id( "ACT_MULTIPLE_BUTCHER" ) ); + p.assign_activity( ACT_MULTIPLE_BUTCHER ); } void talk_function::do_chop_plank( npc &p ) { - p.assign_activity( activity_id( "ACT_MULTIPLE_CHOP_PLANKS" ) ); + p.assign_activity( ACT_MULTIPLE_CHOP_PLANKS ); } void talk_function::do_vehicle_deconstruct( npc &p ) { - p.assign_activity( activity_id( "ACT_VEHICLE_DECONSTRUCTION" ) ); + p.assign_activity( ACT_VEHICLE_DECONSTRUCTION ); } void talk_function::do_vehicle_repair( npc &p ) { - p.assign_activity( activity_id( "ACT_VEHICLE_REPAIR" ) ); + p.assign_activity( ACT_VEHICLE_REPAIR ); } void talk_function::do_chop_trees( npc &p ) { - p.assign_activity( activity_id( "ACT_MULTIPLE_CHOP_TREES" ) ); + p.assign_activity( ACT_MULTIPLE_CHOP_TREES ); } void talk_function::do_farming( npc &p ) { - p.assign_activity( activity_id( "ACT_MULTIPLE_FARM" ) ); + p.assign_activity( ACT_MULTIPLE_FARM ); } void talk_function::do_fishing( npc &p ) { - p.assign_activity( activity_id( "ACT_MULTIPLE_FISH" ) ); + p.assign_activity( ACT_MULTIPLE_FISH ); } void talk_function::revert_activity( npc &p ) @@ -467,8 +449,8 @@ void talk_function::bionic_remove( npc &p ) std::vector bionic_names; for( const bionic &bio : all_bio ) { if( std::find( bionic_types.begin(), bionic_types.end(), bio.id.str() ) == bionic_types.end() ) { - if( bio.id != bionic_id( "bio_power_storage" ) || - bio.id != bionic_id( "bio_power_storage_mkII" ) ) { + if( bio.id != bio_power_storage || + bio.id != bio_power_storage_mkII ) { bionic_types.push_back( bio.id.str() ); if( item::type_is_defined( bio.id.str() ) ) { item tmp = item( bio.id.str(), 0 ); @@ -550,7 +532,7 @@ void talk_function::give_aid( npc &p ) } } const int moves = to_moves( 100_minutes ); - g->u.assign_activity( activity_id( "ACT_WAIT_NPC" ), moves ); + g->u.assign_activity( ACT_WAIT_NPC, moves ); g->u.activity.str_values.push_back( p.name ); } @@ -625,7 +607,7 @@ void talk_function::buy_haircut( npc &p ) { g->u.add_morale( MORALE_HAIRCUT, 5, 5, 720_minutes, 3_minutes ); const int moves = to_moves( 20_minutes ); - g->u.assign_activity( activity_id( "ACT_WAIT_NPC" ), moves ); + g->u.assign_activity( ACT_WAIT_NPC, moves ); g->u.activity.str_values.push_back( p.name ); add_msg( m_good, _( "%s gives you a decent haircut…" ), p.name ); } @@ -634,7 +616,7 @@ void talk_function::buy_shave( npc &p ) { g->u.add_morale( MORALE_SHAVE, 10, 10, 360_minutes, 3_minutes ); const int moves = to_moves( 5_minutes ); - g->u.assign_activity( activity_id( "ACT_WAIT_NPC" ), moves ); + g->u.assign_activity( ACT_WAIT_NPC, moves ); g->u.activity.str_values.push_back( p.name ); add_msg( m_good, _( "%s gives you a decent shave…" ), p.name ); } @@ -648,7 +630,7 @@ void talk_function::morale_chat( npc &p ) void talk_function::morale_chat_activity( npc &p ) { const int moves = to_moves( 10_minutes ); - g->u.assign_activity( activity_id( "ACT_SOCIALIZE" ), moves ); + g->u.assign_activity( ACT_SOCIALIZE, moves ); g->u.activity.str_values.push_back( p.name ); add_msg( m_good, _( "That was a pleasant conversation with %s." ), p.disp_name() ); g->u.add_morale( MORALE_CHAT, rng( 3, 10 ), 10, 200_minutes, 5_minutes / 2 ); @@ -927,7 +909,7 @@ void talk_function::start_training( npc &p ) } else if( !npc_trading::pay_npc( p, cost ) ) { return; } - player_activity act = player_activity( activity_id( "ACT_TRAIN" ), to_moves( time ), + player_activity act = player_activity( ACT_TRAIN, to_moves( time ), p.getID().get_value(), 0, name ); act.values.push_back( expert_multiplier ); g->u.assign_activity( act ); diff --git a/src/npctrade.cpp b/src/npctrade.cpp index 5ad8634d524e3..1ff771223b665 100644 --- a/src/npctrade.cpp +++ b/src/npctrade.cpp @@ -31,8 +31,7 @@ #include "type_id.h" #include "faction.h" #include "pimpl.h" - -static const skill_id skill_barter( "barter" ); +#include "cata_string_consts.h" void npc_trading::transfer_items( std::vector &stuff, player &giver, player &receiver, std::list &from_map, diff --git a/src/overmap.cpp b/src/overmap.cpp index 41e1bbe36c8ec..f1ae86eefa7e7 100644 --- a/src/overmap.cpp +++ b/src/overmap.cpp @@ -49,6 +49,7 @@ #include "math_defines.h" #include "monster.h" #include "string_formatter.h" +#include "cata_string_consts.h" class map_extra; @@ -62,8 +63,6 @@ class map_extra; #define MIN_RIFT_SIZE 6 #define MAX_RIFT_SIZE 16 -static const efftype_id effect_pet( "pet" ); - using oter_type_id = int_id; using oter_type_str_id = string_id; @@ -1607,7 +1606,7 @@ bool overmap::generate_sub( const int z ) ter_set( q, oter_id( "spiral" ) ); } ter_set( p, oter_id( "spiral_hub" ) ); - add_mon_group( mongroup( mongroup_id( "GROUP_SPIRAL" ), tripoint( i * 2, j * 2, z ), 2, 200 ) ); + add_mon_group( mongroup( GROUP_SPIRAL, tripoint( i * 2, j * 2, z ), 2, 200 ) ); } } } @@ -1745,12 +1744,12 @@ bool overmap::generate_sub( const int z ) tripoint sm_pos = omt_to_sm_copy( omt_pos ); // Sewers and city subways are present at z == -1 and z == -2. Don't spawn CHUD on other z-levels. if( ( z == -1 || z == -2 ) && one_in( 3 ) ) { - add_mon_group( mongroup( mongroup_id( "GROUP_CHUD" ), + add_mon_group( mongroup( GROUP_CHUD, sm_pos, i.size, i.size * 20 ) ); } // Sewers are present at z == -1. Don't spawn sewer monsters on other z-levels. if( z == -1 && !one_in( 8 ) ) { - add_mon_group( mongroup( mongroup_id( "GROUP_SEWER" ), + add_mon_group( mongroup( GROUP_SEWER, sm_pos, ( i.size * 7 ) / 2, i.size * 70 ) ); } } @@ -1966,7 +1965,6 @@ void overmap::move_hordes() zg.insert( tmpzg.begin(), tmpzg.end() ); if( get_option( "WANDER_SPAWNS" ) ) { - static const mongroup_id GROUP_ZOMBIE( "GROUP_ZOMBIE" ); // Re-absorb zombies into hordes. // Scan over monsters outside the player's view and place them back into hordes. @@ -1984,7 +1982,7 @@ void overmap::move_hordes() // Check if the monster is a zombie. auto &type = *( this_monster.type ); if( - !type.species.count( species_id( "ZOMBIE" ) ) || // Only add zombies to hordes. + !type.species.count( ZOMBIE ) || // Only add zombies to hordes. type.id == mtype_id( "mon_jabberwock" ) || // Jabberwockies are an exception. this_monster.get_speed() <= 30 || // So are very slow zombies, like crawling zombies. this_monster.has_effect( effect_pet ) || // "Zombie pet" zlaves are, too. @@ -4228,7 +4226,7 @@ void overmap::place_mongroups() for( auto &elem : cities ) { if( get_option( "WANDER_SPAWNS" ) ) { if( !one_in( 16 ) || elem.size > 5 ) { - mongroup m( mongroup_id( "GROUP_ZOMBIE" ), + mongroup m( GROUP_ZOMBIE, tripoint( elem.pos.x * 2, elem.pos.y * 2, 0 ), static_cast( elem.size * 2.5 ), elem.size * 80 ); @@ -4253,7 +4251,7 @@ void overmap::place_mongroups() } } if( swamp_count >= 25 ) { - add_mon_group( mongroup( mongroup_id( "GROUP_SWAMP" ), tripoint( x * 2, y * 2, 0 ), 3, + add_mon_group( mongroup( GROUP_SWAMP, tripoint( x * 2, y * 2, 0 ), 3, rng( swamp_count * 8, swamp_count * 25 ) ) ); } } @@ -4272,7 +4270,7 @@ void overmap::place_mongroups() } } if( river_count >= 25 ) { - add_mon_group( mongroup( mongroup_id( "GROUP_RIVER" ), tripoint( x * 2, y * 2, 0 ), 3, + add_mon_group( mongroup( GROUP_RIVER, tripoint( x * 2, y * 2, 0 ), 3, rng( river_count * 8, river_count * 25 ) ) ); } } @@ -4281,7 +4279,7 @@ void overmap::place_mongroups() // Place the "put me anywhere" groups int numgroups = rng( 0, 3 ); for( int i = 0; i < numgroups; i++ ) { - add_mon_group( mongroup( mongroup_id( "GROUP_WORM" ), tripoint( rng( 0, OMAPX * 2 - 1 ), rng( 0, + add_mon_group( mongroup( GROUP_WORM, tripoint( rng( 0, OMAPX * 2 - 1 ), rng( 0, OMAPY * 2 - 1 ), 0 ), rng( 20, 40 ), rng( 30, 50 ) ) ); } diff --git a/src/overmap_ui.cpp b/src/overmap_ui.cpp index 35042d32cf8b0..63c4eb126afa3 100644 --- a/src/overmap_ui.cpp +++ b/src/overmap_ui.cpp @@ -59,6 +59,7 @@ #include "enums.h" #include "map.h" #include "player_activity.h" +#include "cata_string_consts.h" #if defined(__ANDROID__) #include @@ -118,7 +119,7 @@ static std::tuple get_note_display_info( const std::stri static std::array, npm_width *npm_height> get_overmap_neighbors( const tripoint ¤t ) { - const bool has_debug_vision = g->u.has_trait( trait_id( "DEBUG_NIGHTVISION" ) ); + const bool has_debug_vision = g->u.has_trait( trait_DEBUG_NIGHTVISION ); std::array, npm_width *npm_height> map_around; int index = 0; @@ -469,7 +470,7 @@ void draw( const catacurses::window &w, const catacurses::window &wbar, const tr bool csee = false; oter_id ccur_ter = oter_str_id::NULL_ID(); // Debug vision allows seeing everything - const bool has_debug_vision = g->u.has_trait( trait_id( "DEBUG_NIGHTVISION" ) ); + const bool has_debug_vision = g->u.has_trait( trait_DEBUG_NIGHTVISION ); // sight_points is hoisted for speed reasons. const int sight_points = !has_debug_vision ? g->u.overmap_sight_range( g->light_level( g->u.posz() ) ) : @@ -730,7 +731,7 @@ void draw( const catacurses::window &w, const catacurses::window &wbar, const tr } else { const auto &groups = overmap_buffer.monsters_at( omp ); for( auto &mgp : groups ) { - if( mgp->type == mongroup_id( "GROUP_FOREST" ) ) { + if( mgp->type == GROUP_FOREST ) { // Don't flood the map with forest creatures. continue; } @@ -1489,10 +1490,10 @@ static tripoint display( const tripoint &orig, const draw_data_t &data = draw_da vehicle *player_veh = veh_pointer_or_null( g->m.veh_at( g->u.pos() ) ); player_veh->omt_path = g->u.omt_path; player_veh->is_autodriving = true; - g->u.assign_activity( activity_id( "ACT_AUTODRIVE" ) ); + g->u.assign_activity( ACT_AUTODRIVE ); } else { g->u.reset_move_mode(); - g->u.assign_activity( activity_id( "ACT_TRAVELLING" ) ); + g->u.assign_activity( ACT_TRAVELLING ); } action = "QUIT"; }