From d4ccbe71f7850f36d1a7a01beec9d57d2ad8f1fe Mon Sep 17 00:00:00 2001 From: Ramza13 <52087122+Ramza13@users.noreply.github.com> Date: Thu, 20 Feb 2020 17:59:15 -0500 Subject: [PATCH 1/3] first batch --- src/activity_handlers.cpp | 4 ++-- src/cata_string_consts.h | 26 ++++++++++++++------------ src/character.cpp | 4 ++-- src/computer_session.cpp | 4 ++-- src/explosion.cpp | 2 +- src/fungal_effects.cpp | 2 +- src/game.cpp | 2 +- src/item.cpp | 4 ++-- src/iuse.cpp | 16 ++++++++-------- src/iuse_actor.cpp | 4 ++-- src/map_field.cpp | 6 +++--- src/melee.cpp | 2 +- src/monattack.cpp | 10 +++++----- src/mondeath.cpp | 6 +++--- src/monexamine.cpp | 2 +- src/monmove.cpp | 8 ++++---- src/monster.cpp | 18 +++++++++--------- src/mtype.cpp | 2 +- src/overmap.cpp | 2 +- src/trapfunc.cpp | 4 ++-- 20 files changed, 65 insertions(+), 63 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index fd444cd3ef738..cf484018b7058 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -498,8 +498,8 @@ static void set_up_butchery( player_activity &act, player &u, butcher_type actio } // applies to all butchery actions - const bool is_human = corpse.id == mtype_id::NULL_ID() || ( corpse.in_species( HUMAN ) && - !corpse.in_species( ZOMBIE ) ); + const bool is_human = corpse.id == mtype_id::NULL_ID() || ( corpse.in_species( species_HUMAN ) && + !corpse.in_species( species_ZOMBIE ) ); if( is_human && !( u.has_trait_flag( flag_CANNIBAL ) || u.has_trait_flag( flag_PSYCHOPATH ) || u.has_trait_flag( flag_SAPIOVORE ) ) ) { diff --git a/src/cata_string_consts.h b/src/cata_string_consts.h index 3ac4865c64d56..78a38669f628f 100644 --- a/src/cata_string_consts.h +++ b/src/cata_string_consts.h @@ -1518,19 +1518,21 @@ 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 species_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 species_id species_FISH( "FISH" ); +static const species_id species_FUNGUS( "FUNGUS" ); +static const species_id species_HALLUCINATION( "HALLUCINATION" ); +static const species_id species_HUMAN( "HUMAN" ); +static const species_id species_INSECT( "INSECT" ); +static const species_id species_LEECH_PLANT( "LEECH_PLANT" ); +static const species_id species_MAMMAL( "MAMMAL" ); +static const species_id species_MOLLUSK( "MOLLUSK" ); +static const species_id species_PLANT( "PLANT" ); +static const species_id species_ROBOT( "ROBOT" ); +static const species_id species_SPIDER( "SPIDER" ); +static const species_id species_ZOMBIE( "ZOMBIE" ); + static const matec_id matec_no_technique_id( "" ); static const matec_id matec_RAPID( "RAPID" ); diff --git a/src/character.cpp b/src/character.cpp index 07024893728db..bf0ea0f501740 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -183,7 +183,7 @@ field_type_id Character::gibType() const bool Character::in_species( const species_id &spec ) const { - return spec == HUMAN; + return spec == species_HUMAN; } bool Character::is_warm() const @@ -5645,7 +5645,7 @@ bool Character::sees_with_specials( const Creature &critter ) const { // electroreceptors grants vision of robots and electric monsters through walls if( has_trait( trait_ELECTRORECEPTORS ) && - ( critter.in_species( ROBOT ) || critter.has_flag( MF_ELECTRIC ) ) ) { + ( critter.in_species( species_ROBOT ) || critter.has_flag( MF_ELECTRIC ) ) ) { return true; } diff --git a/src/computer_session.cpp b/src/computer_session.cpp index 6bdb08a48b142..5651403228f60 100644 --- a/src/computer_session.cpp +++ b/src/computer_session.cpp @@ -718,8 +718,8 @@ void computer_session::action_blood_anal() const mtype *mt = blood.get_mtype(); if( mt == nullptr || mt->id == mtype_id::NULL_ID() ) { print_line( _( "Result: Human blood, no pathogens found." ) ); - } else if( mt->in_species( ZOMBIE ) ) { - if( mt->in_species( HUMAN ) ) { + } else if( mt->in_species( species_ZOMBIE ) ) { + if( mt->in_species( species_HUMAN ) ) { print_line( _( "Result: Human blood. Unknown pathogen found." ) ); } else { print_line( _( "Result: Unknown blood type. Unknown pathogen found." ) ); diff --git a/src/explosion.cpp b/src/explosion.cpp index 8fe3d0243f4c3..c92a698ede92b 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -546,7 +546,7 @@ void flashbang( const tripoint &p, bool player_immune ) } } for( monster &critter : g->all_monsters() ) { - if( critter.type->in_species( ROBOT ) ) { + if( critter.type->in_species( species_ROBOT ) ) { continue; } // TODO: can the following code be called for all types of creatures diff --git a/src/fungal_effects.cpp b/src/fungal_effects.cpp index 5cb1c65ad39ad..516d796de5093 100644 --- a/src/fungal_effects.cpp +++ b/src/fungal_effects.cpp @@ -40,7 +40,7 @@ void fungal_effects::fungalize( const tripoint &p, Creature *origin, double spor if( monster *const mon_ptr = g->critter_at( p ) ) { monster &critter = *mon_ptr; if( gm.u.sees( p ) && - !critter.type->in_species( FUNGUS ) ) { + !critter.type->in_species( species_FUNGUS ) ) { add_msg( _( "The %s is covered in tiny spores!" ), critter.name() ); } if( !critter.make_fungus() ) { diff --git a/src/game.cpp b/src/game.cpp index d22c26a1d7bb8..494e201ebb1af 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3948,7 +3948,7 @@ void game::mon_info_update( ) monster &critter = *new_seen_mon.back(); cancel_activity_or_ignore_query( distraction_type::hostile_spotted, string_format( _( "%s spotted!" ), critter.name() ) ); - if( u.has_trait( trait_id( "M_DEFENDER" ) ) && critter.type->in_species( PLANT ) ) { + if( u.has_trait( trait_id( "M_DEFENDER" ) ) && critter.type->in_species( species_PLANT ) ) { add_msg( m_warning, _( "We have detected a %s - an enemy of the Mycus!" ), critter.name() ); if( !u.has_effect( effect_adrenaline_mycus ) ) { u.add_effect( effect_adrenaline_mycus, 30_minutes ); diff --git a/src/item.cpp b/src/item.cpp index 252514165c272..dd01fb0c9a240 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -8669,14 +8669,14 @@ bool item::process_corpse( player *carrier, const tripoint &pos ) if( rng( 0, volume() / units::legacy_volume_factor ) > burnt && g->revive_corpse( pos, *this ) ) { if( carrier == nullptr ) { if( g->u.sees( pos ) ) { - if( corpse->in_species( ROBOT ) ) { + if( corpse->in_species( species_ROBOT ) ) { add_msg( m_warning, _( "A nearby robot has repaired itself and stands up!" ) ); } else { add_msg( m_warning, _( "A nearby corpse rises and moves towards you!" ) ); } } } else { - if( corpse->in_species( ROBOT ) ) { + if( corpse->in_species( species_ROBOT ) ) { carrier->add_msg_if_player( m_warning, _( "Oh dear god, a robot you're carrying has started moving!" ) ); } else { diff --git a/src/iuse.cpp b/src/iuse.cpp index ccb0411a117ef..b97a01b547895 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -463,7 +463,7 @@ int iuse::fungicide( player *p, item *it, bool, const tripoint & ) if( monster *const mon_ptr = g->critter_at( dest ) ) { monster &critter = *mon_ptr; if( g->u.sees( dest ) && - !critter.type->in_species( FUNGUS ) ) { + !critter.type->in_species( species_FUNGUS ) ) { add_msg( m_warning, _( "The %s is covered in tiny spores!" ), critter.name() ); } @@ -3448,7 +3448,7 @@ int iuse::granade_act( player *p, item *it, bool t, const tripoint &pos ) explosion_handler::draw_explosion( pos, explosion_radius, c_light_cyan ); for( const tripoint &dest : g->m.points_in_radius( pos, explosion_radius ) ) { monster *const mon = g->critter_at( dest, true ); - if( mon && ( mon->type->in_species( INSECT ) || mon->is_hallucination() ) ) { + if( mon && ( mon->type->in_species( species_INSECT ) || mon->is_hallucination() ) ) { mon->die_in_explosion( nullptr ); } } @@ -3786,7 +3786,7 @@ int iuse::pheromone( player *p, item *it, bool, const tripoint &pos ) continue; } monster &critter = *mon_ptr; - if( critter.type->in_species( ZOMBIE ) && critter.friendly == 0 && + if( critter.type->in_species( species_ZOMBIE ) && critter.friendly == 0 && rng( 0, 500 ) > critter.get_hp() ) { converts++; critter.anger = 0; @@ -5946,7 +5946,7 @@ int iuse::seed( player *p, item *it, bool, const tripoint & ) bool iuse::robotcontrol_can_target( player *p, const monster &m ) { return !m.is_dead() - && m.type->in_species( ROBOT ) + && m.type->in_species( species_ROBOT ) && m.friendly == 0 && rl_dist( p->pos(), m.pos() ) <= 10; } @@ -6027,7 +6027,7 @@ int iuse::robotcontrol( player *p, item *it, bool, const tripoint & ) p->moves -= to_moves( 1_seconds ); int f = 0; //flag to check if you have robotic allies for( monster &critter : g->all_monsters() ) { - if( critter.friendly != 0 && critter.type->in_species( ROBOT ) ) { + if( critter.friendly != 0 && critter.type->in_species( species_ROBOT ) ) { p->add_msg_if_player( _( "A following %s goes into passive mode." ), critter.name() ); critter.add_effect( effect_docile, 1_turns, num_bp, true ); @@ -7097,7 +7097,7 @@ static extended_photo_def photo_def_for_camera_point( const tripoint &aim_point, creature = guy; player_vec.push_back( guy ); } else { - if( mon->is_hallucination() || mon->type->in_species( HALLUCINATION ) ) { + if( mon->is_hallucination() || mon->type->in_species( species_HALLUCINATION ) ) { continue; // do not include hallucinations } pose = _( "stands" ); @@ -7506,7 +7506,7 @@ int iuse::camera( player *p, item *it, bool, const tripoint & ) // shoot past small monsters and hallucinations if( trajectory_point != aim_point && ( z.type->size <= MS_SMALL || z.is_hallucination() || - z.type->in_species( HALLUCINATION ) ) ) { + z.type->in_species( species_HALLUCINATION ) ) ) { continue; } if( !aim_bounds.is_point_inside( trajectory_point ) ) { @@ -7518,7 +7518,7 @@ int iuse::camera( player *p, item *it, bool, const tripoint & ) } // get an special message if the target is a hallucination if( trajectory_point == aim_point && ( z.is_hallucination() || - z.type->in_species( HALLUCINATION ) ) ) { + z.type->in_species( species_HALLUCINATION ) ) ) { p->add_msg_if_player( _( "Strangeā€¦ there's nothing in the center of picture?" ) ); } } else if( guy ) { diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index a8c316758a884..9b2dc8c99cf22 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -1864,8 +1864,8 @@ int enzlave_actor::use( player &p, item &it, bool t, const tripoint & ) const for( auto &it : items ) { const auto mt = it.get_mtype(); - if( it.is_corpse() && mt->in_species( ZOMBIE ) && mt->made_of( material_id( "flesh" ) ) && - mt->in_species( HUMAN ) && it.active && !it.has_var( "zlave" ) ) { + if( it.is_corpse() && mt->in_species( species_ZOMBIE ) && mt->made_of( material_id( "flesh" ) ) && + mt->in_species( species_HUMAN ) && it.active && !it.has_var( "zlave" ) ) { corpses.push_back( &it ); } } diff --git a/src/map_field.cpp b/src/map_field.cpp index a7c5529b087cb..2c04603c6639f 100644 --- a/src/map_field.cpp +++ b/src/map_field.cpp @@ -1937,7 +1937,7 @@ void map::monster_in_field( monster &z ) } } if( cur_field_type == fd_fungal_haze ) { - if( !z.type->in_species( FUNGUS ) && + if( !z.type->in_species( species_FUNGUS ) && !z.type->has_flag( MF_NO_BREATHE ) && !z.make_fungus() ) { // Don't insta-kill jabberwocks, that's silly @@ -1947,14 +1947,14 @@ void map::monster_in_field( monster &z ) } } if( cur_field_type == fd_fungicidal_gas ) { - if( z.type->in_species( FUNGUS ) ) { + if( z.type->in_species( species_FUNGUS ) ) { const int intensity = cur.get_field_intensity(); z.moves -= rng( 10 * intensity, 30 * intensity ); dam += rng( 4, 7 * intensity ); } } if( cur_field_type == fd_insecticidal_gas ) { - if( z.type->in_species( INSECT ) || z.type->in_species( SPIDER ) ) { + if( z.type->in_species( species_INSECT ) || z.type->in_species( species_SPIDER ) ) { const int intensity = cur.get_field_intensity(); z.moves -= rng( 10 * intensity, 30 * intensity ); dam += rng( 4, 7 * intensity ); diff --git a/src/melee.cpp b/src/melee.cpp index b232233f24462..f8e254621ecf8 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -1095,7 +1095,7 @@ matec_id player::pick_technique( Creature &t, const item &weap, } // Don't apply humanoid-only techniques to non-humanoids - if( tec.human_target && !t.in_species( HUMAN ) ) { + if( tec.human_target && !t.in_species( species_HUMAN ) ) { continue; } // if aoe, check if there are valid targets diff --git a/src/monattack.cpp b/src/monattack.cpp index b31efaaaedf5a..442341cc5b3e8 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -832,7 +832,7 @@ bool mattack::resurrect( monster *z ) for( auto &i : g->m.i_at( p ) ) { const mtype *mt = i.get_mtype(); if( !( i.is_corpse() && i.can_revive() && i.active && mt->has_flag( MF_REVIVES ) && - mt->in_species( ZOMBIE ) && !mt->has_flag( MF_NO_NECRO ) ) ) { + mt->in_species( species_ZOMBIE ) && !mt->has_flag( MF_NO_NECRO ) ) ) { continue; } @@ -873,7 +873,7 @@ bool mattack::resurrect( monster *z ) // Check to see if there are any nearby living zombies to see if we should get angry const bool allies = g->get_creature_if( [&]( const Creature & critter ) { const monster *const zed = dynamic_cast( &critter ); - return zed && zed != z && zed->type->has_flag( MF_REVIVES ) && zed->type->in_species( ZOMBIE ) && + return zed && zed != z && zed->type->has_flag( MF_REVIVES ) && zed->type->in_species( species_ZOMBIE ) && z->attitude_to( *zed ) == Creature::Attitude::A_FRIENDLY && within_target_range( z, zed, 10 ); } ); @@ -2311,7 +2311,7 @@ bool mattack::jackson( monster *z ) std::list allies; std::vector nearby_points = closest_tripoints_first( z->pos(), 3 ); for( monster &candidate : g->all_monsters() ) { - if( candidate.type->in_species( ZOMBIE ) && candidate.type->id != mon_zombie_jackson ) { + if( candidate.type->in_species( species_ZOMBIE ) && candidate.type->id != mon_zombie_jackson ) { // Just give the allies consistent assignments. // Don't worry about trying to make the orders optimal. allies.push_back( &candidate ); @@ -4788,7 +4788,7 @@ bool mattack::leech_spawner( monster *z ) const bool u_see = g->u.sees( *z ); std::list allies; for( monster &candidate : g->all_monsters() ) { - if( candidate.in_species( LEECH_PLANT ) && !candidate.has_flag( MF_IMMOBILE ) ) { + if( candidate.in_species( species_LEECH_PLANT ) && !candidate.has_flag( MF_IMMOBILE ) ) { allies.push_back( &candidate ); } } @@ -4821,7 +4821,7 @@ bool mattack::mon_leech_evolution( monster *z ) const bool is_queen = z->has_flag( MF_QUEEN ); std::list queens; for( monster &candidate : g->all_monsters() ) { - if( candidate.in_species( LEECH_PLANT ) && candidate.has_flag( MF_QUEEN ) && + if( candidate.in_species( species_LEECH_PLANT ) && candidate.has_flag( MF_QUEEN ) && rl_dist( z->pos(), candidate.pos() ) < 35 ) { queens.push_back( &candidate ); } diff --git a/src/mondeath.cpp b/src/mondeath.cpp index fa0ffa96ac00f..ad412d8961852 100644 --- a/src/mondeath.cpp +++ b/src/mondeath.cpp @@ -55,7 +55,7 @@ void mdeath::normal( monster &z ) return; } - if( z.type->in_species( ZOMBIE ) ) { + if( z.type->in_species( species_ZOMBIE ) ) { sfx::play_variant_sound( "mon_death", "zombie_death", sfx::get_heard_volume( z.pos() ) ); } @@ -420,7 +420,7 @@ void mdeath::guilt( monster &z ) int maxMalus = -250 * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); time_duration duration = 30_minutes * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); time_duration decayDelay = 3_minutes * ( 1.0 - ( static_cast( kill_count ) / maxKills ) ); - if( z.type->in_species( ZOMBIE ) ) { + if( z.type->in_species( species_ZOMBIE ) ) { moraleMalus /= 10; if( g->u.has_trait( trait_PACIFIST ) ) { moraleMalus *= 5; @@ -824,7 +824,7 @@ void make_mon_corpse( monster &z, int damageLvl ) corpse.set_item_temperature( 310.15 ); } corpse.set_damage( damageLvl ); - if( z.has_effect( effect_pacified ) && z.type->in_species( ZOMBIE ) ) { + if( z.has_effect( effect_pacified ) && z.type->in_species( species_ZOMBIE ) ) { // Pacified corpses have a chance of becoming unpacified when regenerating. corpse.set_var( "zlave", one_in( 2 ) ? "zlave" : "mutilated" ); } diff --git a/src/monexamine.cpp b/src/monexamine.cpp index 3f2ebac11428f..4790109298fe2 100644 --- a/src/monexamine.cpp +++ b/src/monexamine.cpp @@ -66,7 +66,7 @@ bool monexamine::pet_menu( monster &z ) uilist amenu; std::string pet_name = z.get_name(); - bool is_zombie = z.type->in_species( ZOMBIE ); + bool is_zombie = z.type->in_species( species_ZOMBIE ); if( is_zombie ) { pet_name = _( "zombie slave" ); } diff --git a/src/monmove.cpp b/src/monmove.cpp index 8d9135f50f3a3..e963176459143 100644 --- a/src/monmove.cpp +++ b/src/monmove.cpp @@ -52,13 +52,13 @@ bool monster::wander() bool monster::is_immune_field( const field_type_id &fid ) const { if( fid == fd_fungal_haze ) { - return has_flag( MF_NO_BREATHE ) || type->in_species( FUNGUS ); + return has_flag( MF_NO_BREATHE ) || type->in_species( species_FUNGUS ); } if( fid == fd_fungicidal_gas ) { - return !type->in_species( FUNGUS ); + return !type->in_species( species_FUNGUS ); } if( fid == fd_insecticidal_gas ) { - return !type->in_species( INSECT ) && !type->in_species( SPIDER ); + return !type->in_species( species_INSECT ) && !type->in_species( species_SPIDER ); } const field_type &ft = fid.obj(); if( ft.has_fume ) { @@ -462,7 +462,7 @@ void monster::plan() friendly = 100; for( auto critter : g->m.get_creatures_in_radius( pos(), 6 ) ) { monster *mon = dynamic_cast( critter ); - if( mon != nullptr && mon->type->in_species( ZOMBIE ) ) { + if( mon != nullptr && mon->type->in_species( species_ZOMBIE ) ) { anger = 100; } else { anger = 0; diff --git a/src/monster.cpp b/src/monster.cpp index 5c839e393c5ed..1ab55a49342ad 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -434,7 +434,7 @@ std::string monster::name( unsigned int quantity ) const std::string monster::name_with_armor() const { std::string ret; - if( type->in_species( INSECT ) ) { + if( type->in_species( species_INSECT ) ) { ret = _( "carapace" ); } else if( made_of( material_id( "veggy" ) ) ) { ret = _( "thick bark" ); @@ -925,7 +925,7 @@ monster_attitude monster::attitude( const Character *u ) const } // Zombies don't understand not attacking NPCs, but dogs and bots should. const npc *np = dynamic_cast< const npc * >( u ); - if( np != nullptr && np->get_attitude() != NPCATT_KILL && !type->in_species( ZOMBIE ) ) { + if( np != nullptr && np->get_attitude() != NPCATT_KILL && !type->in_species( species_ZOMBIE ) ) { return MATT_FRIEND; } if( np != nullptr && np->is_hallucination() ) { @@ -953,14 +953,14 @@ monster_attitude monster::attitude( const Character *u ) const } } - if( type->in_species( FUNGUS ) && ( u->has_trait( trait_MYCUS_THRESH ) || + if( type->in_species( 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( trait_PHEROMONE_MAMMAL ) ) || - ( type->in_species( INSECT ) && u->has_trait( trait_PHEROMONE_INSECT ) ) ) ) { + ( ( type->in_species( species_MAMMAL ) && u->has_trait( trait_PHEROMONE_MAMMAL ) ) || + ( type->in_species( species_INSECT ) && u->has_trait( trait_PHEROMONE_INSECT ) ) ) ) { effective_anger -= 20; } @@ -1527,8 +1527,8 @@ bool monster::move_effects( bool ) } // non-friendly monster will struggle to get free occasionally. // some monsters cant be tangled up with a net/bolas/lassoo etc. - bool immediate_break = type->in_species( FISH ) || type->in_species( MOLLUSK ) || - type->in_species( ROBOT ) || type->bodytype == "snake" || type->bodytype == "blob"; + bool immediate_break = type->in_species( species_FISH ) || type->in_species( species_MOLLUSK ) || + type->in_species( species_ROBOT ) || type->bodytype == "snake" || type->bodytype == "blob"; if( !immediate_break && rng( 0, 900 ) > type->melee_dice * type->melee_sides * 1.5 ) { if( u_see_me ) { add_msg( _( "The %s struggles to break free of its bonds." ), name() ); @@ -2378,7 +2378,7 @@ bool monster::make_fungus() } char polypick = 0; const mtype_id &tid = type->id; - if( type->in_species( FUNGUS ) ) { // No friendly-fungalizing ;-) + if( type->in_species( species_FUNGUS ) ) { // No friendly-fungalizing ;-) return true; } if( !made_of( material_id( "flesh" ) ) && !made_of( material_id( "hflesh" ) ) && @@ -2417,7 +2417,7 @@ bool monster::make_fungus() polypick = 7; } else if( tid == mon_zombie_gasbag ) { polypick = 8; - } else if( type->in_species( SPIDER ) && get_size() > MS_TINY ) { + } else if( type->in_species( species_SPIDER ) && get_size() > MS_TINY ) { polypick = 9; } diff --git a/src/mtype.cpp b/src/mtype.cpp index fe3780a22e7e3..b351624e2f2e9 100644 --- a/src/mtype.cpp +++ b/src/mtype.cpp @@ -166,7 +166,7 @@ field_type_id mtype::bloodType() const field_type_id mtype::gibType() const { - if( has_flag( MF_LARVA ) || in_species( MOLLUSK ) ) { + if( has_flag( MF_LARVA ) || in_species( species_MOLLUSK ) ) { return fd_gibs_invertebrate; } if( made_of( material_id( "veggy" ) ) ) { diff --git a/src/overmap.cpp b/src/overmap.cpp index 30cc780b3707e..ef73b1407bad4 100644 --- a/src/overmap.cpp +++ b/src/overmap.cpp @@ -1982,7 +1982,7 @@ void overmap::move_hordes() // Check if the monster is a zombie. auto &type = *( this_monster.type ); if( - !type.species.count( ZOMBIE ) || // Only add zombies to hordes. + !type.species.count( species_ZOMBIE ) || // Only add zombies to hordes. type.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. diff --git a/src/trapfunc.cpp b/src/trapfunc.cpp index d9b564996d7f5..2ea837e72f813 100644 --- a/src/trapfunc.cpp +++ b/src/trapfunc.cpp @@ -654,7 +654,7 @@ bool trapfunc::goo( const tripoint &p, Creature *c, item * ) if( z->type->id != mon_blob ) { z->set_speed_base( z->get_speed_base() - 15 ); //All monsters that aren't blobs or robots transform into a blob - if( !z->type->in_species( ROBOT ) ) { + if( !z->type->in_species( species_ROBOT ) ) { z->poly( mon_blob ); z->set_hp( z->get_speed() ); } @@ -675,7 +675,7 @@ bool trapfunc::dissector( const tripoint &p, Creature *c, item * ) } monster *z = dynamic_cast( c ); if( z != nullptr ) { - if( z->type->in_species( ROBOT ) ) { + if( z->type->in_species( species_ROBOT ) ) { //The monster is a robot. So the dissector should not try to dissect the monsters flesh. //Dissector error sound. sounds::sound( p, 4, sounds::sound_t::electronic_speech, From 728eb06e9b5fc56960ffaad396f78899e851face Mon Sep 17 00:00:00 2001 From: Ramza13 <52087122+Ramza13@users.noreply.github.com> Date: Thu, 20 Feb 2020 18:19:06 -0500 Subject: [PATCH 2/3] Batch 2 --- src/activity_handlers.cpp | 6 ++-- src/activity_item_handling.cpp | 10 +++---- src/basecamp.cpp | 2 +- src/cata_string_consts.h | 10 +++++++ src/character.cpp | 2 +- src/consumption.cpp | 2 +- src/crafting.cpp | 2 +- src/dump.cpp | 2 +- src/explosion.cpp | 2 +- src/iexamine.cpp | 4 +-- src/inventory.cpp | 50 +++++++++++++++++----------------- src/iuse.cpp | 4 +-- src/monattack.cpp | 3 +- src/monster.cpp | 2 +- src/veh_interact.cpp | 4 +-- src/vehicle_use.cpp | 34 +++++++++++------------ 16 files changed, 75 insertions(+), 64 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index cf484018b7058..d902a0a34aaa2 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -2553,7 +2553,7 @@ void activity_handlers::heat_item_finish( player_activity *act, player *p ) return; } item &target = *heat->get_food(); - if( target.item_tags.count( "FROZEN" ) ) { + if( target.item_tags.count( flag_FROZEN ) ) { target.apply_freezerburn(); if( target.has_flag( flag_EATEN_COLD ) ) { target.cold_up(); @@ -2690,7 +2690,7 @@ void activity_handlers::toolmod_add_finish( player_activity *act, player *p ) item &mod = *act->targets[1]; p->add_msg_if_player( m_good, _( "You successfully attached the %1$s to your %2$s." ), mod.tname(), tool.tname() ); - mod.item_tags.insert( "IRREMOVABLE" ); + mod.item_tags.insert( flag_IRREMOVABLE ); tool.contents.push_back( mod ); act->targets[1].remove_item(); } @@ -3860,7 +3860,7 @@ void activity_handlers::dig_finish( player_activity *act, player *p ) g->m.place_items( "jewelry_front", 20, pos, pos, false, calendar::turn ); for( const auto &it : dropped ) { if( it->is_armor() ) { - it->item_tags.insert( "FILTHY" ); + it->item_tags.insert( flag_FILTHY ); it->set_damage( rng( 1, it->max_damage() - 1 ) ); } } diff --git a/src/activity_item_handling.cpp b/src/activity_item_handling.cpp index 517ad91861232..152b41b9c6754 100644 --- a/src/activity_item_handling.cpp +++ b/src/activity_item_handling.cpp @@ -631,7 +631,7 @@ void activity_handlers::washing_finish( player_activity *act, player *p ) for( const auto &ait : items ) { item *filthy_item = const_cast( &*ait.loc ); - filthy_item->item_tags.erase( "FILTHY" ); + filthy_item->item_tags.erase( flag_FILTHY ); p->on_worn_item_washed( *filthy_item ); } @@ -1235,12 +1235,12 @@ static bool are_requirements_nearby( const std::vector &loot_spots, const cata::optional weldpart = vp.part_with_feature( "WELDRIG", true ); if( weldpart ) { item welder( "welder", 0 ); - welder.charges = veh.fuel_left( "battery", true ); - welder.item_tags.insert( "PSEUDO" ); + welder.charges = veh.fuel_left( fuel_type_battery, true ); + welder.item_tags.insert( flag_PSEUDO ); temp_inv.add_item( welder ); item soldering_iron( "soldering_iron", 0 ); - soldering_iron.charges = veh.fuel_left( "battery", true ); - soldering_iron.item_tags.insert( "PSEUDO" ); + soldering_iron.charges = veh.fuel_left( fuel_type_battery, true ); + soldering_iron.item_tags.insert( flag_PSEUDO ); temp_inv.add_item( soldering_iron ); } } diff --git a/src/basecamp.cpp b/src/basecamp.cpp index 2223f36e4c935..e3d5ca2a7fdfb 100644 --- a/src/basecamp.cpp +++ b/src/basecamp.cpp @@ -623,7 +623,7 @@ void basecamp::form_crafting_inventory( map &target_map ) for( basecamp_resource &bcp_r : resources ) { bcp_r.consumed = 0; item camp_item( bcp_r.fake_id, 0 ); - camp_item.item_tags.insert( "PSEUDO" ); + camp_item.item_tags.insert( flag_PSEUDO ); if( bcp_r.ammo_id != "NULL" ) { for( basecamp_fuel &bcp_f : fuels ) { if( bcp_f.ammo_id == bcp_r.ammo_id ) { diff --git a/src/cata_string_consts.h b/src/cata_string_consts.h index 78a38669f628f..b124799d992a1 100644 --- a/src/cata_string_consts.h +++ b/src/cata_string_consts.h @@ -921,6 +921,7 @@ 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 std::string flag_ACID( "ACID" ); static const std::string flag_ACID_IMMUNE( "ACID_IMMUNE" ); static const std::string flag_ACT_IN_FIRE( "ACT_IN_FIRE" ); @@ -1024,6 +1025,7 @@ static const std::string flag_DIG_TOOL( "DIG_TOOL" ); static const std::string flag_DIGGABLE( "DIGGABLE" ); static const std::string flag_DIGGABLE_CAN_DEEPEN( "DIGGABLE_CAN_DEEPEN" ); static const std::string flag_DIMENSIONAL_ANCHOR( "DIMENSIONAL_ANCHOR" ); +static const std::string flag_DIRTY( "DIRTY" ); 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_DOOR( "DOOR" ); @@ -1396,11 +1398,13 @@ static const std::string flag_WIND_TURBINE( "WIND_TURBINE" ); static const std::string flag_WINDOW( "WINDOW" ); static const std::string flag_WINDOW_CURTAIN( "WINDOW_CURTAIN" ); static const std::string flag_WINDSHIELD( "WINDSHIELD" ); +static const std::string flag_wooled( "wooled" ); static const std::string flag_WORKBENCH( "WORKBENCH" ); static const std::string flag_WRITE_MESSAGE( "WRITE_MESSAGE" ); static const std::string flag_YOUNG( "YOUNG" ); static const std::string flag_ZOOM( "ZOOM" ); + static const skill_id skill_archery( "archery" ); static const skill_id skill_barter( "barter" ); static const skill_id skill_bashing( "bashing" ); @@ -1462,23 +1466,29 @@ static const zone_type_id zone_type_NO_AUTO_PICKUP( "NO_AUTO_PICKUP" ); 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 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 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_water( "water" ); +static const itype_id fuel_type_water_clean( "water_clean" ); 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" ); diff --git a/src/character.cpp b/src/character.cpp index bf0ea0f501740..66503eebcfee2 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -2139,7 +2139,7 @@ ret_val Character::can_wear( const item &it, bool with_equip_change ) cons } if( has_trait( trait_WOOLALLERGY ) && ( it.made_of( material_id( "wool" ) ) || - it.item_tags.count( "wooled" ) ) ) { + it.item_tags.count( flag_wooled ) ) ) { return ret_val::make_failure( _( "Can't wear that, it's made of wool!" ) ); } diff --git a/src/consumption.cpp b/src/consumption.cpp index d0ccf79ade706..2c8b8902f7382 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -530,7 +530,7 @@ ret_val Character::can_eat( const item &food ) const return ret_val::make_failure( _( "That doesn't look edible in its current form." ) ); } - if( food.item_tags.count( "DIRTY" ) ) { + if( food.item_tags.count( flag_DIRTY ) ) { return ret_val::make_failure( _( "This is full of dirt after being on the ground." ) ); } diff --git a/src/crafting.cpp b/src/crafting.cpp index 4570c42524a16..e777d0451e082 100644 --- a/src/crafting.cpp +++ b/src/crafting.cpp @@ -2247,7 +2247,7 @@ void player::complete_disassemble( item_location &target, const recipe &dis ) } if( filthy ) { - act_item.item_tags.insert( "FILTHY" ); + act_item.item_tags.insert( flag_FILTHY ); } for( std::list::iterator a = dis_item.components.begin(); a != dis_item.components.end(); diff --git a/src/dump.cpp b/src/dump.cpp index 34c85d62329cd..6eee7c7c69afb 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -122,7 +122,7 @@ bool game::dump_stats( const std::string &what, dump_mode mode, item obj( e ); if( bp == num_bp || obj.covers( bp ) ) { if( obj.has_flag( flag_VARSIZE ) ) { - obj.item_tags.insert( "FIT" ); + obj.item_tags.insert( flag_FIT ); } dump( obj ); } diff --git a/src/explosion.cpp b/src/explosion.cpp index c92a698ede92b..ec067f2e26236 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -721,7 +721,7 @@ void emp_blast( const tripoint &p ) // TODO: More effects? //e-handcuffs effects if( g->u.weapon.typeId() == "e_handcuffs" && g->u.weapon.charges > 0 ) { - g->u.weapon.item_tags.erase( "NO_UNWIELD" ); + g->u.weapon.item_tags.erase( flag_NO_UNWIELD ); g->u.weapon.charges = 0; g->u.weapon.active = false; add_msg( m_good, _( "The %s on your wrists spark briefly, then release your hands!" ), diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 7ce469f22c725..1810a05c606e7 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -136,7 +136,7 @@ void iexamine::cvdmachine( player &p, const tripoint & ) p.invalidate_crafting_inventory(); // Apply flag to item - loc->item_tags.insert( "DIAMOND" ); + loc->item_tags.insert( flag_DIAMOND ); add_msg( m_good, _( "You apply a diamond coating to your %s" ), loc->type_name() ); p.mod_moves( -to_turns( 10_seconds ) ); } @@ -188,7 +188,7 @@ void iexamine::nanofab( player &p, const tripoint &examp ) p.invalidate_crafting_inventory(); if( new_item.is_armor() && new_item.has_flag( flag_VARSIZE ) ) { - new_item.item_tags.insert( "FIT" ); + new_item.item_tags.insert( flag_FIT ); } g->m.add_item_or_charges( spawn_point, new_item ); diff --git a/src/inventory.cpp b/src/inventory.cpp index 0fd2e43331f1c..46115a784fe4f 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -439,7 +439,7 @@ void inventory::form_from_map( map &m, std::vector pts, const Characte if( type != nullptr ) { const itype *ammo = f.crafting_ammo_item_type(); item furn_item( type, calendar::turn, 0 ); - furn_item.item_tags.insert( "PSEUDO" ); + furn_item.item_tags.insert( flag_PSEUDO ); furn_item.charges = ammo ? count_charges_in_list( ammo, m.i_at( p ) ) : 0; add_item( furn_item ); } @@ -532,70 +532,70 @@ void inventory::form_from_map( map &m, std::vector pts, const Characte if( kpart ) { item hotplate( "hotplate", 0 ); - hotplate.charges = veh->fuel_left( "battery", true ); - hotplate.item_tags.insert( "PSEUDO" ); + hotplate.charges = veh->fuel_left( fuel_type_battery, true ); + hotplate.item_tags.insert( flag_PSEUDO ); add_item( hotplate ); item pot( "pot", 0 ); - pot.item_tags.insert( "PSEUDO" ); + pot.item_tags.insert( flag_PSEUDO ); add_item( pot ); item pan( "pan", 0 ); - pan.item_tags.insert( "PSEUDO" ); + pan.item_tags.insert( flag_PSEUDO ); add_item( pan ); } if( weldpart ) { item welder( "welder", 0 ); - welder.charges = veh->fuel_left( "battery", true ); - welder.item_tags.insert( "PSEUDO" ); + welder.charges = veh->fuel_left( fuel_type_battery, true ); + welder.item_tags.insert( flag_PSEUDO ); add_item( welder ); item soldering_iron( "soldering_iron", 0 ); - soldering_iron.charges = veh->fuel_left( "battery", true ); - soldering_iron.item_tags.insert( "PSEUDO" ); + soldering_iron.charges = veh->fuel_left( fuel_type_battery, true ); + soldering_iron.item_tags.insert( flag_PSEUDO ); add_item( soldering_iron ); } if( craftpart ) { item vac_sealer( "vac_sealer", 0 ); - vac_sealer.charges = veh->fuel_left( "battery", true ); - vac_sealer.item_tags.insert( "PSEUDO" ); + vac_sealer.charges = veh->fuel_left( fuel_type_battery, true ); + vac_sealer.item_tags.insert( flag_PSEUDO ); add_item( vac_sealer ); item dehydrator( "dehydrator", 0 ); - dehydrator.charges = veh->fuel_left( "battery", true ); - dehydrator.item_tags.insert( "PSEUDO" ); + dehydrator.charges = veh->fuel_left( fuel_type_battery, true ); + dehydrator.item_tags.insert( flag_PSEUDO ); add_item( dehydrator ); item food_processor( "food_processor", 0 ); - food_processor.charges = veh->fuel_left( "battery", true ); - food_processor.item_tags.insert( "PSEUDO" ); + food_processor.charges = veh->fuel_left( fuel_type_battery, true ); + food_processor.item_tags.insert( flag_PSEUDO ); add_item( food_processor ); item press( "press", 0 ); - press.charges = veh->fuel_left( "battery", true ); - press.item_tags.insert( "PSEUDO" ); + press.charges = veh->fuel_left( fuel_type_battery, true ); + press.item_tags.insert( flag_PSEUDO ); add_item( press ); } if( forgepart ) { item forge( "forge", 0 ); - forge.charges = veh->fuel_left( "battery", true ); - forge.item_tags.insert( "PSEUDO" ); + forge.charges = veh->fuel_left( fuel_type_battery, true ); + forge.item_tags.insert( flag_PSEUDO ); add_item( forge ); } if( kilnpart ) { item kiln( "kiln", 0 ); - kiln.charges = veh->fuel_left( "battery", true ); - kiln.item_tags.insert( "PSEUDO" ); + kiln.charges = veh->fuel_left( fuel_type_battery, true ); + kiln.item_tags.insert( flag_PSEUDO ); add_item( kiln ); } if( chempart ) { item chemistry_set( "chemistry_set", 0 ); - chemistry_set.charges = veh->fuel_left( "battery", true ); - chemistry_set.item_tags.insert( "PSEUDO" ); + chemistry_set.charges = veh->fuel_left( fuel_type_battery, true ); + chemistry_set.item_tags.insert( flag_PSEUDO ); add_item( chemistry_set ); item electrolysis_kit( "electrolysis_kit", 0 ); - electrolysis_kit.charges = veh->fuel_left( "battery", true ); - electrolysis_kit.item_tags.insert( "PSEUDO" ); + electrolysis_kit.charges = veh->fuel_left( fuel_type_battery, true ); + electrolysis_kit.item_tags.insert( flag_PSEUDO ); add_item( electrolysis_kit ); } } diff --git a/src/iuse.cpp b/src/iuse.cpp index b97a01b547895..d4ac711da29d7 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -8130,7 +8130,7 @@ static vehicle *pickveh( const tripoint ¢er, bool advanced ) for( auto &veh : g->m.get_vehicles() ) { auto &v = veh.v; if( rl_dist( center, v->global_pos3() ) < 40 && - v->fuel_left( "battery", true ) > 0 && + v->fuel_left( fuel_type_battery, true ) > 0 && ( !empty( v->get_avail_parts( advctrl ) ) || ( !advanced && !empty( v->get_avail_parts( ctrl ) ) ) ) ) { vehs.push_back( v ); @@ -8171,7 +8171,7 @@ int iuse::remoteveh( player *p, item *it, bool t, const tripoint &pos ) } else if( remote == nullptr ) { p->add_msg_if_player( _( "Lost contact with the vehicle." ) ); stop = true; - } else if( remote->fuel_left( "battery", true ) == 0 ) { + } else if( remote->fuel_left( fuel_type_battery, true ) == 0 ) { p->add_msg_if_player( m_bad, _( "The vehicle's battery died." ) ); stop = true; } diff --git a/src/monattack.cpp b/src/monattack.cpp index 442341cc5b3e8..03b7ea4855bcb 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -873,7 +873,8 @@ bool mattack::resurrect( monster *z ) // Check to see if there are any nearby living zombies to see if we should get angry const bool allies = g->get_creature_if( [&]( const Creature & critter ) { const monster *const zed = dynamic_cast( &critter ); - return zed && zed != z && zed->type->has_flag( MF_REVIVES ) && zed->type->in_species( species_ZOMBIE ) && + return zed && zed != z && zed->type->has_flag( MF_REVIVES ) && + zed->type->in_species( species_ZOMBIE ) && z->attitude_to( *zed ) == Creature::Attitude::A_FRIENDLY && within_target_range( z, zed, 10 ); } ); diff --git a/src/monster.cpp b/src/monster.cpp index 1ab55a49342ad..0e92744679069 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -954,7 +954,7 @@ monster_attitude monster::attitude( const Character *u ) const } if( type->in_species( species_FUNGUS ) && ( u->has_trait( trait_MYCUS_THRESH ) || - u->has_trait( trait_MYCUS_FRIEND ) ) ) { + u->has_trait( trait_MYCUS_FRIEND ) ) ) { return MATT_FRIEND; } diff --git a/src/veh_interact.cpp b/src/veh_interact.cpp index 8f99b5540d563..a21b7dddbbb4d 100644 --- a/src/veh_interact.cpp +++ b/src/veh_interact.cpp @@ -2735,7 +2735,7 @@ void act_vehicle_unload_fuel( vehicle *veh ) uilist smenu; smenu.text = _( "Remove what?" ); for( auto &fuel : fuels ) { - if( fuel == "plut_cell" && veh->fuel_left( fuel ) < PLUTONIUM_CHARGES ) { + if( fuel == fuel_type_plutonium_cell && veh->fuel_left( fuel ) < PLUTONIUM_CHARGES ) { continue; } smenu.addentry( item::nname( fuel ) ); @@ -2751,7 +2751,7 @@ void act_vehicle_unload_fuel( vehicle *veh ) } int qty = veh->fuel_left( fuel ); - if( fuel == "plut_cell" ) { + if( fuel == fuel_type_plutonium_cell ) { if( qty / PLUTONIUM_CHARGES == 0 ) { add_msg( m_info, _( "The vehicle has no charged plutonium cells." ) ); return; diff --git a/src/vehicle_use.cpp b/src/vehicle_use.cpp index 9f9ea3f2eceba..61f5b841709cf 100644 --- a/src/vehicle_use.cpp +++ b/src/vehicle_use.cpp @@ -1491,7 +1491,7 @@ void vehicle::use_autoclave( int p ) _( "You turn the autoclave off before it's finished the program, and open its door." ) ); } else if( items.empty() ) { add_msg( m_bad, _( "The autoclave is empty, there's no point in starting it." ) ); - } else if( fuel_left( "water" ) < 8 && fuel_left( "water_clean" ) < 8 ) { + } else if( fuel_left( fuel_type_water ) < 8 && fuel_left( fuel_type_water_clean ) < 8 ) { add_msg( m_bad, _( "You need 8 charges of water in tanks of the %s for the autoclave to run." ), name ); } else if( filthy_items ) { @@ -1507,10 +1507,10 @@ void vehicle::use_autoclave( int p ) n.set_age( 0_turns ); } - if( fuel_left( "water" ) >= 8 ) { - drain( "water", 8 ); + if( fuel_left( fuel_type_water ) >= 8 ) { + drain( fuel_type_water, 8 ); } else { - drain( "water_clean", 8 ); + drain( fuel_type_water_clean, 8 ); } add_msg( m_good, @@ -1543,7 +1543,7 @@ void vehicle::use_washing_machine( int p ) } else if( items.empty() ) { add_msg( m_bad, _( "The washing machine is empty, there's no point in starting it." ) ); - } else if( fuel_left( "water" ) < 24 && fuel_left( "water_clean" ) < 24 ) { + } else if( fuel_left( fuel_type_water ) < 24 && fuel_left( fuel_type_water_clean ) < 24 ) { add_msg( m_bad, _( "You need 24 charges of water in tanks of the %s to fill the washing machine." ), name ); } else if( detergents.empty() ) { @@ -1588,10 +1588,10 @@ void vehicle::use_washing_machine( int p ) n.set_age( 0_turns ); } - if( fuel_left( "water" ) >= 24 ) { - drain( "water", 24 ); + if( fuel_left( fuel_type_water ) >= 24 ) { + drain( fuel_type_water, 24 ); } else { - drain( "water_clean", 24 ); + drain( fuel_type_water_clean, 24 ); } std::vector detergent; @@ -1629,7 +1629,7 @@ void vehicle::use_dishwasher( int p ) } else if( items.empty() ) { add_msg( m_bad, _( "The dishwasher is empty, there's no point in starting it." ) ); - } else if( fuel_left( "water" ) < 24 && fuel_left( "water_clean" ) < 24 ) { + } else if( fuel_left( fuel_type_water ) < 24 && fuel_left( fuel_type_water_clean ) < 24 ) { add_msg( m_bad, _( "You need 24 charges of water in tanks of the %s to fill the dishwasher." ), name ); } else if( !detergent_is_enough ) { @@ -1645,10 +1645,10 @@ void vehicle::use_dishwasher( int p ) n.set_age( 0_turns ); } - if( fuel_left( "water" ) >= 24 ) { - drain( "water", 24 ); + if( fuel_left( fuel_type_water ) >= 24 ) { + drain( fuel_type_water, 24 ); } else { - drain( "water_clean", 24 ); + drain( fuel_type_water_clean, 24 ); } std::vector detergent; @@ -1930,25 +1930,25 @@ void vehicle::interact_with( const tripoint &pos, int interact_part ) if( curtain_part >= 0 && curtain_closed ) { selectmenu.addentry( PEEK_CURTAIN, true, 'p', _( "Peek through the closed curtains" ) ); } - if( ( has_kitchen || has_chemlab ) && fuel_left( "battery", true ) > 0 ) { + if( ( has_kitchen || has_chemlab ) && fuel_left( fuel_type_battery, true ) > 0 ) { selectmenu.addentry( USE_HOTPLATE, true, 'h', _( "Use the hotplate" ) ); } - if( has_faucet && fuel_left( "water_clean" ) > 0 ) { + if( has_faucet && fuel_left( fuel_type_water_clean ) > 0 ) { selectmenu.addentry( FILL_CONTAINER, true, 'c', _( "Fill a container with water" ) ); selectmenu.addentry( DRINK, true, 'd', _( "Have a drink" ) ); } if( has_towel ) { selectmenu.addentry( USE_TOWEL, true, 't', _( "Use a towel" ) ); } - if( has_weldrig && fuel_left( "battery", true ) > 0 ) { + if( has_weldrig && fuel_left( fuel_type_battery, true ) > 0 ) { selectmenu.addentry( USE_WELDER, true, 'w', _( "Use the welding rig" ) ); } if( has_purify ) { - bool can_purify = fuel_left( "battery", true ) >= + bool can_purify = fuel_left( fuel_type_battery, true ) >= item::find_type( "water_purifier" )->charges_to_use(); selectmenu.addentry( USE_PURIFIER, can_purify, 'p', _( "Purify water in carried container" ) ); - selectmenu.addentry( PURIFY_TANK, can_purify && fuel_left( "water" ), + selectmenu.addentry( PURIFY_TANK, can_purify && fuel_left( fuel_type_water ), 'P', _( "Purify water in vehicle tank" ) ); } if( has_monster_capture ) { From 6bfd3e940e1da5b89f5e41b83b33787b31d93938 Mon Sep 17 00:00:00 2001 From: ZhilkinSerg Date: Fri, 21 Feb 2020 09:07:03 +0300 Subject: [PATCH 3/3] Update cata_string_consts.h --- src/cata_string_consts.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/cata_string_consts.h b/src/cata_string_consts.h index b124799d992a1..4b5e990b6aba6 100644 --- a/src/cata_string_consts.h +++ b/src/cata_string_consts.h @@ -921,7 +921,6 @@ 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 std::string flag_ACID( "ACID" ); static const std::string flag_ACID_IMMUNE( "ACID_IMMUNE" ); static const std::string flag_ACT_IN_FIRE( "ACT_IN_FIRE" ); @@ -1404,7 +1403,6 @@ static const std::string flag_WRITE_MESSAGE( "WRITE_MESSAGE" ); static const std::string flag_YOUNG( "YOUNG" ); static const std::string flag_ZOOM( "ZOOM" ); - static const skill_id skill_archery( "archery" ); static const skill_id skill_barter( "barter" ); static const skill_id skill_bashing( "bashing" ); @@ -1466,18 +1464,15 @@ static const zone_type_id zone_type_NO_AUTO_PICKUP( "NO_AUTO_PICKUP" ); 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 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 fuel_type_animal( "animal" ); static const itype_id fuel_type_battery( "battery" ); static const itype_id fuel_type_muscle( "muscle" ); @@ -1488,7 +1483,6 @@ static const itype_id fuel_type_water( "water" ); static const itype_id fuel_type_water_clean( "water_clean" ); 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" ); @@ -1528,7 +1522,6 @@ 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 species_BLOB( "BLOB" ); static const species_id species_FISH( "FISH" ); static const species_id species_FUNGUS( "FUNGUS" ); @@ -1543,7 +1536,6 @@ static const species_id species_ROBOT( "ROBOT" ); static const species_id species_SPIDER( "SPIDER" ); static const species_id species_ZOMBIE( "ZOMBIE" ); - static const matec_id matec_no_technique_id( "" ); static const matec_id matec_RAPID( "RAPID" ); static const matec_id matec_tec_none( "tec_none" );