From 5f1ddc1749eb4e1621861526e327a5ee02450376 Mon Sep 17 00:00:00 2001 From: Ramza13 <52087122+Ramza13@users.noreply.github.com> Date: Mon, 17 Feb 2020 13:11:34 -0500 Subject: [PATCH] Move string consts out of iuse.cpp --- src/iuse.cpp | 247 +++++++++++---------------------------------------- 1 file changed, 52 insertions(+), 195 deletions(-) diff --git a/src/iuse.cpp b/src/iuse.cpp index 548fd419c2fa6..861761559ad79 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -100,156 +100,12 @@ #include "omdata.h" #include "point.h" #include "teleport.h" +#include "cata_string_consts.h" #define RADIO_PER_TURN 25 // how many characters per turn of radio #include "iuse_software.h" -static const mtype_id mon_bee( "mon_bee" ); -static const mtype_id mon_blob( "mon_blob" ); -static const mtype_id mon_hologram( "mon_hologram" ); -static const mtype_id mon_dog_thing( "mon_dog_thing" ); -static const mtype_id mon_fly( "mon_fly" ); -static const mtype_id mon_hallu_multicooker( "mon_hallu_multicooker" ); -static const mtype_id mon_shadow( "mon_shadow" ); -static const mtype_id mon_spore( "mon_spore" ); -static const mtype_id mon_vortex( "mon_vortex" ); -static const mtype_id mon_wasp( "mon_wasp" ); - -static const skill_id skill_firstaid( "firstaid" ); -static const skill_id skill_survival( "survival" ); -static const skill_id skill_cooking( "cooking" ); -static const skill_id skill_mechanics( "mechanics" ); -static const skill_id skill_computer( "computer" ); -static const skill_id skill_fabrication( "fabrication" ); -static const skill_id skill_electronics( "electronics" ); -static const skill_id skill_melee( "melee" ); - -static const species_id ROBOT( "ROBOT" ); -static const species_id HALLUCINATION( "HALLUCINATION" ); -static const species_id ZOMBIE( "ZOMBIE" ); -static const species_id FUNGUS( "FUNGUS" ); -static const species_id INSECT( "INSECT" ); - -static const efftype_id effect_adrenaline( "adrenaline" ); -static const efftype_id effect_antibiotic( "antibiotic" ); -static const efftype_id effect_antibiotic_visible( "antibiotic_visible" ); -static const efftype_id effect_asthma( "asthma" ); -static const efftype_id effect_attention( "attention" ); -static const efftype_id effect_beartrap( "beartrap" ); -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_bloodworms( "bloodworms" ); -static const efftype_id effect_boomered( "boomered" ); -static const efftype_id effect_bouldering( "bouldering" ); -static const efftype_id effect_brainworms( "brainworms" ); -static const efftype_id effect_cig( "cig" ); -static const efftype_id effect_contacts( "contacts" ); -static const efftype_id effect_corroding( "corroding" ); -static const efftype_id effect_crushed( "crushed" ); -static const efftype_id effect_cureall( "cureall" ); -static const efftype_id effect_datura( "datura" ); -static const efftype_id effect_dazed( "dazed" ); -static const efftype_id effect_dermatik( "dermatik" ); -static const efftype_id effect_docile( "docile" ); -static const efftype_id effect_downed( "downed" ); -static const efftype_id effect_drunk( "drunk" ); -static const efftype_id effect_earphones( "earphones" ); -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_fungus( "fungus" ); -static const efftype_id effect_glowing( "glowing" ); -static const efftype_id effect_glowing_led( "glowy_led" ); -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_high( "high" ); -static const efftype_id effect_in_pit( "in_pit" ); -static const efftype_id effect_infected( "infected" ); -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_lying_down( "lying_down" ); -static const efftype_id effect_meth( "meth" ); -static const efftype_id effect_monster_armor( "monster_armor" ); -static const efftype_id effect_music( "music" ); -static const efftype_id effect_onfire( "onfire" ); -static const efftype_id effect_paincysts( "paincysts" ); -static const efftype_id effect_panacea( "panacea" ); -static const efftype_id effect_pet( "pet" ); -static const efftype_id effect_poison( "poison" ); -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_sleep( "sleep" ); -static const efftype_id effect_slimed( "slimed" ); -static const efftype_id effect_smoke( "smoke" ); -static const efftype_id effect_spores( "spores" ); -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_stunned( "stunned" ); -static const efftype_id effect_teargas( "teargas" ); -static const efftype_id effect_tapeworm( "tapeworm" ); -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_valium( "valium" ); -static const efftype_id effect_visuals( "visuals" ); -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_melatonin_supplements( "melatonin" ); - -static const trait_id trait_ACIDBLOOD( "ACIDBLOOD" ); -static const trait_id trait_ACIDPROOF( "ACIDPROOF" ); -static const trait_id trait_ALCMET( "ALCMET" ); -static const trait_id trait_CENOBITE( "CENOBITE" ); -static const trait_id trait_CHLOROMORPH( "CHLOROMORPH" ); -static const trait_id trait_EATDEAD( "EATDEAD" ); -static const trait_id trait_EATPOISON( "EATPOISON" ); -static const trait_id trait_GILLS( "GILLS" ); -static const trait_id trait_HYPEROPIC( "HYPEROPIC" ); -static const trait_id trait_ILLITERATE( "ILLITERATE" ); -static const trait_id trait_LIGHTWEIGHT( "LIGHTWEIGHT" ); -static const trait_id trait_MARLOSS_AVOID( "MARLOSS_AVOID" ); -static const trait_id trait_MARLOSS_BLUE( "MARLOSS_BLUE" ); -static const trait_id trait_MARLOSS( "MARLOSS" ); -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_M_DEPENDENT( "M_DEPENDENT" ); -static const trait_id trait_MYOPIC( "MYOPIC" ); -static const trait_id trait_NOPAIN( "NOPAIN" ); -static const trait_id trait_PSYCHOPATH( "PSYCHOPATH" ); -static const trait_id trait_SPIRITUAL( "SPIRITUAL" ); -static const trait_id trait_THRESH_MARLOSS( "THRESH_MARLOSS" ); -static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" ); -static const trait_id trait_THRESH_PLANT( "THRESH_PLANT" ); -static const trait_id trait_TOLERANCE( "TOLERANCE" ); -static const trait_id trait_URSINE_EYE( "URSINE_EYE" ); - -static const quality_id AXE( "AXE" ); -static const quality_id DIG( "DIG" ); - struct extended_photo_def; struct object_names_collection; @@ -843,7 +699,7 @@ int iuse::meditate( player *p, item *it, bool t, const tripoint & ) } if( p->has_trait( trait_SPIRITUAL ) ) { const int moves = to_moves( 20_minutes ); - p->assign_activity( activity_id( "ACT_MEDITATE" ), moves ); + p->assign_activity( ACT_MEDITATE, moves ); } else { p->add_msg_if_player( _( "This %s probably meant a lot to someone at one time." ), it->tname() ); @@ -976,8 +832,8 @@ int iuse::blech( player *p, item *it, bool, const tripoint & ) } } - if( it->has_flag( "ACID" ) && ( p->has_trait( trait_ACIDPROOF ) || - p->has_trait( trait_ACIDBLOOD ) ) ) { + if( it->has_flag( flag_ACID ) && ( p->has_trait( trait_ACIDPROOF ) || + p->has_trait( trait_ACIDBLOOD ) ) ) { p->add_msg_if_player( m_bad, _( "Blech, that tastes gross!" ) ); //reverse the harmful values of drinking this acid. double multiplier = -1; @@ -1721,7 +1577,7 @@ int iuse::fishing_rod( player *p, item *it, bool, const tripoint & ) } cata::optional found; for( const tripoint &pnt : g->m.points_in_radius( p->pos(), 1 ) ) { - if( g->m.has_flag( "FISHABLE", pnt ) && good_fishing_spot( pnt ) ) { + if( g->m.has_flag( flag_FISHABLE, pnt ) && good_fishing_spot( pnt ) ) { found = pnt; break; } @@ -1731,7 +1587,7 @@ int iuse::fishing_rod( player *p, item *it, bool, const tripoint & ) return 0; } p->add_msg_if_player( _( "You cast your line and wait to hook something…" ) ); - p->assign_activity( activity_id( "ACT_FISH" ), to_moves( 5_hours ), 0, + p->assign_activity( ACT_FISH, to_moves( 5_hours ), 0, p->get_item_position( it ), it->tname() ); p->activity.coord_set = g->get_fishable_locations( 60, *found ); return 0; @@ -1853,7 +1709,7 @@ int iuse::fish_trap( player *p, item *it, bool t, const tripoint &pos ) //lets say it is a 5% chance per fish to catch if( one_in( 20 ) ) { const std::vector fish_group = MonsterGroupManager::GetMonstersFromGroup( - mongroup_id( "GROUP_FISH" ) ); + GROUP_FISH ); const mtype_id &fish_mon = random_entry_ref( fish_group ); //Yes, we can put fishes in the trap like knives in the boot, //and then get fishes via activation of the item, @@ -2555,9 +2411,9 @@ int iuse::makemound( player *p, item *it, bool t, const tripoint & ) return 0; } - if( g->m.has_flag( "PLOWABLE", pnt ) && !g->m.has_flag( "PLANT", pnt ) ) { + if( g->m.has_flag( flag_PLOWABLE, pnt ) && !g->m.has_flag( flag_PLANT, pnt ) ) { p->add_msg_if_player( _( "You start churning up the earth here." ) ); - p->assign_activity( activity_id( "ACT_CHURN" ), 18000, -1, p->get_item_position( it ) ); + p->assign_activity( ACT_CHURN, 18000, -1, p->get_item_position( it ) ); p->activity.placement = g->m.getabs( pnt ); return it->type->charges_to_use(); } else { @@ -2664,7 +2520,7 @@ static digging_moves_and_byproducts dig_pit_moves_and_byproducts( player *p, ite constexpr double baseline_dig_quality = 3; // Get the dig quality of the tool. - const int quality = it->get_quality( DIG ); + const int quality = it->get_quality( qual_DIG ); // Dig quality affects the dig rate linearly relative to baseline dig quality const double tool_dig_rate = dig_rate_kg_min * quality / baseline_dig_quality; @@ -2722,7 +2578,7 @@ int iuse::dig( player *p, item *it, bool t, const tripoint & ) const bool can_deepen = g->m.has_flag( "DIGGABLE_CAN_DEEPEN", dig_point ); const bool grave = g->m.ter( dig_point ) == t_grave; - if( !p->crafting_inventory().has_quality( DIG, 2 ) ) { + if( !p->crafting_inventory().has_quality( qual_DIG, 2 ) ) { if( can_deepen ) { p->add_msg_if_player( _( "You can't deepen this pit without a proper shovel." ) ); return 0; @@ -2751,19 +2607,19 @@ int iuse::dig( player *p, item *it, bool t, const tripoint & ) } if( grave ) { - if( g->u.has_trait( trait_id( "SPIRITUAL" ) ) && !g->u.has_trait( trait_id( "PSYCHOPATH" ) ) && + if( g->u.has_trait( trait_SPIRITUAL ) && !g->u.has_trait( trait_PSYCHOPATH ) && g->u.query_yn( _( "Would you really touch the sacred resting place of the dead?" ) ) ) { add_msg( m_info, _( "Exhuming a grave is really against your beliefs." ) ); g->u.add_morale( MORALE_GRAVEDIGGER, -50, -100, 48_hours, 12_hours ); if( one_in( 3 ) ) { g->u.vomit(); } - } else if( g->u.has_trait( trait_id( "PSYCHOPATH" ) ) ) { + } else if( g->u.has_trait( trait_PSYCHOPATH ) ) { p->add_msg_if_player( m_good, _( "Exhuming a grave is fun now, where there is no one to object." ) ); g->u.add_morale( MORALE_GRAVEDIGGER, 25, 50, 2_hours, 1_hours ); - } else if( !g->u.has_trait( trait_id( "EATDEAD" ) ) && - !g->u.has_trait( trait_id( "SAPROVORE" ) ) ) { + } else if( !g->u.has_trait( trait_EATDEAD ) && + !g->u.has_trait( trait_SAPROVORE ) ) { p->add_msg_if_player( m_bad, _( "Exhuming this grave is utterly disgusting!" ) ); g->u.add_morale( MORALE_GRAVEDIGGER, -25, -50, 2_hours, 1_hours ); if( one_in( 5 ) ) { @@ -2781,7 +2637,7 @@ int iuse::dig( player *p, item *it, bool t, const tripoint & ) digging_moves_and_byproducts moves_and_byproducts = dig_pit_moves_and_byproducts( p, it, can_deepen, false ); - player_activity act( activity_id( "ACT_DIG" ), moves_and_byproducts.moves, -1, + player_activity act( ACT_DIG, moves_and_byproducts.moves, -1, p->get_item_position( it ) ); act.placement = dig_point; act.values.emplace_back( moves_and_byproducts.spawn_count ); @@ -2809,10 +2665,11 @@ int iuse::dig_channel( player *p, item *it, bool t, const tripoint & ) tripoint west = dig_point + point_west; tripoint east = dig_point + point_east; - const bool can_dig_here = g->m.has_flag( "DIGGABLE", dig_point ) && !g->m.has_furn( dig_point ) && + const bool can_dig_here = g->m.has_flag( flag_DIGGABLE, dig_point ) && + !g->m.has_furn( dig_point ) && g->m.tr_at( dig_point ).is_null() && g->m.i_at( dig_point ).empty() && !g->m.veh_at( dig_point ) && - ( g->m.has_flag( "CURRENT", north ) || g->m.has_flag( "CURRENT", south ) || - g->m.has_flag( "CURRENT", east ) || g->m.has_flag( "CURRENT", west ) ); + ( g->m.has_flag( flag_CURRENT, north ) || g->m.has_flag( flag_CURRENT, south ) || + g->m.has_flag( flag_CURRENT, east ) || g->m.has_flag( flag_CURRENT, west ) ); if( !can_dig_here ) { p->add_msg_if_player( @@ -2847,7 +2704,7 @@ int iuse::dig_channel( player *p, item *it, bool t, const tripoint & ) digging_moves_and_byproducts moves_and_byproducts = dig_pit_moves_and_byproducts( p, it, false, true ); - player_activity act( activity_id( "ACT_DIG_CHANNEL" ), moves_and_byproducts.moves, -1, + player_activity act( ACT_DIG_CHANNEL, moves_and_byproducts.moves, -1, p->get_item_position( it ) ); act.placement = dig_point; act.values.emplace_back( moves_and_byproducts.spawn_count ); @@ -2919,7 +2776,7 @@ int iuse::fill_pit( player *p, item *it, bool t, const tripoint & ) add_msg( m_info, _( "%s helps with this task…" ), np->name ); break; } - p->assign_activity( activity_id( "ACT_FILL_PIT" ), moves, -1, p->get_item_position( it ) ); + p->assign_activity( ACT_FILL_PIT, moves, -1, p->get_item_position( it ) ); p->activity.placement = pnt; return it->type->charges_to_use(); @@ -2961,7 +2818,7 @@ int iuse::clear_rubble( player *p, item *it, bool, const tripoint & ) } const int helpersize = g->u.get_num_crafting_helpers( 3 ); const int moves = to_moves( 30_seconds ) * ( 1 - ( helpersize / 10 ) ); - player_activity act( activity_id( "ACT_CLEAR_RUBBLE" ), moves / bonus, bonus ); + player_activity act( ACT_CLEAR_RUBBLE, moves / bonus, bonus ); p->assign_activity( act ); p->activity.placement = pnt; return it->type->charges_to_use(); @@ -3268,7 +3125,7 @@ int iuse::jackhammer( player *p, item *it, bool, const tripoint &pos ) break; } - p->assign_activity( activity_id( "ACT_JACKHAMMER" ), moves, -1, p->get_item_position( it ) ); + p->assign_activity( ACT_JACKHAMMER, moves, -1, p->get_item_position( it ) ); p->activity.placement = pnt; p->add_msg_if_player( _( "You start drilling into the %1$s with your %2$s." ), g->m.tername( pnt ), it->tname() ); @@ -3324,7 +3181,7 @@ int iuse::pickaxe( player *p, item *it, bool, const tripoint &pos ) break; } - p->assign_activity( activity_id( "ACT_PICKAXE" ), moves, -1, p->get_item_position( it ) ); + p->assign_activity( ACT_PICKAXE, moves, -1, p->get_item_position( it ) ); p->activity.placement = pnt; p->add_msg_if_player( _( "You strike the %1$s with your %2$s." ), g->m.tername( pnt ), it->tname() ); @@ -3370,7 +3227,7 @@ int iuse::burrow( player *p, item *it, bool, const tripoint &pos ) // We're breaking up some flat surface like pavement, which is much easier moves /= 2; } - p->assign_activity( activity_id( "ACT_BURROW" ), moves, -1, 0 ); + p->assign_activity( ACT_BURROW, moves, -1, 0 ); p->activity.placement = pnt; p->add_msg_if_player( _( "You start tearing into the %1$s with your %2$s." ), g->m.tername( pnt ), it->tname() ); @@ -4427,11 +4284,11 @@ int iuse::portable_game( player *p, item *it, bool, const tripoint & ) p->add_msg_if_player( _( "You play on your %s for a while." ), it->tname() ); if( loaded_software == "null" ) { - p->assign_activity( activity_id( "ACT_GENERIC_GAME" ), to_moves( 1_hours ), -1, + p->assign_activity( ACT_GENERIC_GAME, to_moves( 1_hours ), -1, p->get_item_position( it ), "gaming" ); return it->type->charges_to_use(); } - p->assign_activity( activity_id( "ACT_GAME" ), moves, -1, p->get_item_position( it ), "gaming" ); + p->assign_activity( ACT_GAME, moves, -1, p->get_item_position( it ), "gaming" ); std::map game_data; game_data.clear(); int game_score = 0; @@ -4479,7 +4336,7 @@ int iuse::hand_crank( player *p, item *it, bool, const tripoint & ) if( it->ammo_capacity() > it->ammo_remaining() ) { p->add_msg_if_player( _( "You start cranking the %s to charge its %s." ), it->tname(), it->magazine_current()->tname() ); - p->assign_activity( activity_id( "ACT_HAND_CRANK" ), moves, -1, p->get_item_position( it ), + p->assign_activity( ACT_HAND_CRANK, moves, -1, p->get_item_position( it ), "hand-cranking" ); } else { p->add_msg_if_player( _( "You could use the %s to charge its %s, but it's already charged." ), @@ -4524,7 +4381,7 @@ int iuse::vibe( player *p, item *it, bool, const tripoint & ) p->add_msg_if_player( _( "You whip out your %s and start getting the tension out." ), it->tname() ); } - p->assign_activity( activity_id( "ACT_VIBE" ), moves, -1, p->get_item_position( it ), + p->assign_activity( ACT_VIBE, moves, -1, p->get_item_position( it ), "de-stressing" ); } return it->type->charges_to_use(); @@ -4691,7 +4548,7 @@ int iuse::mind_splicer( player *p, item *it, bool, const tripoint & ) const time_duration time = std::max( 150_minutes - 20_minutes * ( p->get_skill_level( skill_firstaid ) - 1 ) - 10_minutes * ( p->get_dex() - 8 ), 30_minutes ); - player_activity act( activity_id( "ACT_MIND_SPLICER" ), to_moves( time ) ); + player_activity act( ACT_MIND_SPLICER, to_moves( time ) ); act.targets.push_back( item_location( *p, &data_card ) ); p->assign_activity( act ); return it->type->charges_to_use(); @@ -4710,7 +4567,7 @@ void iuse::cut_log_into_planks( player &p ) const int moves = to_moves( 20_minutes ); p.add_msg_if_player( _( "You cut the log into planks." ) ); - p.assign_activity( activity_id( "ACT_CHOP_PLANKS" ), moves, -1 ); + p.assign_activity( ACT_CHOP_PLANKS, moves, -1 ); p.activity.placement = g->m.getabs( p.pos() ); } @@ -4754,7 +4611,7 @@ int iuse::lumber( player *p, item *it, bool t, const tripoint & ) static int chop_moves( player *p, item *it ) { // quality of tool - const int quality = it->get_quality( AXE ); + const int quality = it->get_quality( qual_AXE ); // attribute; regular tools - based on STR, powered tools - based on DEX const int attr = it->has_flag( "POWERED" ) ? p->dex_cur : p->str_cur; @@ -4801,7 +4658,7 @@ int iuse::chop_tree( player *p, item *it, bool t, const tripoint & ) add_msg( m_info, _( "%s helps with this task…" ), np->name ); break; } - p->assign_activity( activity_id( "ACT_CHOP_TREE" ), moves, -1, p->get_item_position( it ) ); + p->assign_activity( ACT_CHOP_TREE, moves, -1, p->get_item_position( it ) ); p->activity.placement = g->m.getabs( pnt ); return it->type->charges_to_use(); @@ -4844,7 +4701,7 @@ int iuse::chop_logs( player *p, item *it, bool t, const tripoint & ) add_msg( m_info, _( "%s helps with this task…" ), np->name ); break; } - p->assign_activity( activity_id( "ACT_CHOP_LOGS" ), moves, -1, p->get_item_position( it ) ); + p->assign_activity( ACT_CHOP_LOGS, moves, -1, p->get_item_position( it ) ); p->activity.placement = g->m.getabs( pnt ); return it->type->charges_to_use(); @@ -4942,7 +4799,7 @@ int iuse::oxytorch( player *p, item *it, bool, const tripoint & ) } // placing ter here makes resuming tasks work better - p->assign_activity( activity_id( "ACT_OXYTORCH" ), moves, static_cast( ter ), + p->assign_activity( ACT_OXYTORCH, moves, static_cast( ter ), p->get_item_position( it ) ); p->activity.placement = pnt; p->activity.values.push_back( charges ); @@ -5021,7 +4878,7 @@ int iuse::hacksaw( player *p, item *it, bool t, const tripoint & ) return 0; } - p->assign_activity( activity_id( "ACT_HACKSAW" ), moves, static_cast( ter ), + p->assign_activity( ACT_HACKSAW, moves, static_cast( ter ), p->get_item_position( it ) ); p->activity.placement = pnt; @@ -5577,11 +5434,11 @@ static bool heat_item( player &p ) // this is x2 to simulate larger delta temperature of frozen food in relation to // heating non-frozen food (x1); no real life physics here, only aproximations int duration = to_turns( time_duration::from_seconds( to_gram( target->weight() ) ) ) * 10; - if( target->item_tags.count( "FROZEN" ) && !target->has_flag( "EATEN_COLD" ) ) { + if( target->item_tags.count( "FROZEN" ) && !target->has_flag( flag_EATEN_COLD ) ) { duration *= 2; } p.add_msg_if_player( m_info, _( "You start heating up the food." ) ); - p.assign_activity( activity_id( "ACT_HEATING" ), duration ); + p.assign_activity( ACT_HEATING, duration ); p.activity.targets.push_back( item_location( p, target ) ); return true; } @@ -5598,7 +5455,7 @@ int iuse::heat_food( player *p, item *it, bool, const tripoint & ) { if( g->m.has_nearby_fire( p->pos() ) ) { heat_item( *p ); - } else if( p->has_active_bionic( bionic_id( "bio_tools" ) ) && p->get_power_level() > 10_kJ && + } else if( p->has_active_bionic( bio_tools ) && p->get_power_level() > 10_kJ && query_yn( _( "There is no fire around, use your integrated toolset instead?" ) ) ) { if( heat_item( *p ) ) { p->mod_power_level( -10_kJ ); @@ -6106,8 +5963,8 @@ int iuse::robotcontrol( player *p, item *it, bool, const tripoint & ) return 0; } - if( p->has_trait( trait_HYPEROPIC ) && !p->worn_with_flag( "FIX_FARSIGHT" ) && - !p->has_effect( effect_contacts ) && !p->has_bionic( bionic_id( "bio_eye_optic" ) ) ) { + if( p->has_trait( trait_HYPEROPIC ) && !p->worn_with_flag( flag_FIX_FARSIGHT ) && + !p->has_effect( effect_contacts ) && !p->has_bionic( bio_eye_optic ) ) { p->add_msg_if_player( m_info, _( "You'll need to put on reading glasses before you can see the screen." ) ); return 0; @@ -6159,7 +6016,7 @@ int iuse::robotcontrol( player *p, item *it, bool, const tripoint & ) /** @EFFECT_INT speeds up hacking preperation */ /** @EFFECT_COMPUTER speeds up hacking preperation */ int move_cost = std::max( 100, 1000 - p->int_cur * 10 - p->get_skill_level( skill_computer ) * 10 ); - player_activity act( activity_id( "ACT_ROBOT_CONTROL" ), move_cost ); + player_activity act( ACT_ROBOT_CONTROL, move_cost ); act.monsters.emplace_back( z ); p->assign_activity( act ); @@ -6480,8 +6337,8 @@ int iuse::einktabletpc( player *p, item *it, bool t, const tripoint &pos ) p->add_msg_if_player( m_info, _( "You cannot read a computer screen." ) ); return 0; } - if( p->has_trait( trait_HYPEROPIC ) && !p->worn_with_flag( "FIX_FARSIGHT" ) && - !p->has_effect( effect_contacts ) && !p->has_bionic( bionic_id( "bio_eye_optic" ) ) ) { + if( p->has_trait( trait_HYPEROPIC ) && !p->worn_with_flag( flag_FIX_FARSIGHT ) && + !p->has_effect( effect_contacts ) && !p->has_bionic( bio_eye_optic ) ) { p->add_msg_if_player( m_info, _( "You'll need to put on reading glasses before you can see the screen." ) ); return 0; @@ -7877,7 +7734,7 @@ int iuse::ehandcuffs( player *p, item *it, bool t, const tripoint &pos ) } if( p->has_item( *it ) ) { - if( p->has_active_bionic( bionic_id( "bio_shock" ) ) && p->get_power_level() >= 2_kJ && + if( p->has_active_bionic( bio_shock ) && p->get_power_level() >= 2_kJ && one_in( 5 ) ) { p->mod_power_level( -2_kJ ); @@ -8356,7 +8213,7 @@ int iuse::remoteveh( player *p, item *it, bool t, const tripoint &pos ) } if( choice == 0 ) { - if( g->u.has_trait( trait_id( "WAYFARER" ) ) ) { + if( g->u.has_trait( trait_WAYFARER ) ) { add_msg( m_info, _( "Despite using a controller, you still refuse to take control of this vehicle." ) ); } else { @@ -9096,7 +8953,7 @@ int iuse::shavekit( player *p, item *it, bool, const tripoint & ) p->add_msg_if_player( _( "You need soap to use this." ) ); } else { const int moves = to_moves( 5_minutes ); - p->assign_activity( activity_id( "ACT_SHAVE" ), moves ); + p->assign_activity( ACT_SHAVE, moves ); } return it->type->charges_to_use(); } @@ -9108,7 +8965,7 @@ int iuse::hairkit( player *p, item *it, bool, const tripoint & ) return 0; } const int moves = to_moves( 30_minutes ); - p->assign_activity( activity_id( "ACT_HAIRCUT" ), moves ); + p->assign_activity( ACT_HAIRCUT, moves ); return it->type->charges_to_use(); } @@ -9534,7 +9391,7 @@ int iuse::wash_items( player *p, bool soft_items, bool hard_items ) break; } // Assign the activity values. - p->assign_activity( activity_id( "ACT_WASH" ), required.time ); + p->assign_activity( ACT_WASH, required.time ); for( drop_location pair : to_clean ) { p->activity.targets.push_back( pair.first ); @@ -9651,7 +9508,7 @@ int iuse::craft( player *p, item *it, bool, const tripoint & ) p->add_msg_player_or_npc( pgettext( "in progress craft", "You start working on the %s." ), pgettext( "in progress craft", " starts working on the %s." ), craft_name ); - p->assign_activity( activity_id( "ACT_CRAFT" ) ); + p->assign_activity( ACT_CRAFT ); p->activity.targets.push_back( item_location( *p, it ) ); p->activity.values.push_back( 0 ); // Not a long craft @@ -9738,7 +9595,7 @@ int iuse::play_game( player *p, item *it, bool, const tripoint & ) { if( query_yn( _( "Play a game with the %s?" ), it->tname() ) ) { p->add_msg_if_player( _( "You start playing." ) ); - p->assign_activity( activity_id( "ACT_GENERIC_GAME" ), to_moves( 1_hours ), -1, + p->assign_activity( ACT_GENERIC_GAME, to_moves( 1_hours ), -1, p->get_item_position( it ), "gaming" ); } return 0;