Skip to content

Commit

Permalink
Revert string centralization (#38321)
Browse files Browse the repository at this point in the history
* Revert "Moved more string consts into single file (#38237)"

This reverts commit 4987742.

* Revert "Moved more string consts into single file (#38220)"

This reverts commit d9c6079.

* Revert "Move string consts into single file (#38195)"

This reverts commit b1b48ba.

* Revert "More string consts into single file (#38189)"

This reverts commit 4fffd96.

* Revert "More string consts into single file (#38183)"

This reverts commit 05940bf.

* Revert "Move string consts into single file (#38184)"

This reverts commit 19c5698.

* Revert "Move string consts into single file (#38181)"

This reverts commit 55cabb7.

* Revert "Move more string consts into single file (#38175)"

This reverts commit 571efb2.

* Revert "Merge pull request #38176 from Ramza13/string_consts_and_more"

This reverts commit 9c9835f, reversing
changes made to 07995cd.

* Revert "Move more string consts into single file (#38169)"

This reverts commit 07995cd.

* Revert "Merge pull request #38168 from Ramza13/even_more_string_consts"

This reverts commit 2bf1c1e, reversing
changes made to 24a32c0.

* Revert "Merge pull request #38141 from ZhilkinSerg/sa-2020-02-18"

This reverts commit 142295b, reversing
changes made to f98c67d.

* Revert "Move string consts into single file (#38158)"

This reverts commit 50059c8.

* Revert "Merge pull request #38157 from Ramza13/string_consts_more_flags"

This reverts commit 8ec8e78, reversing
changes made to 72ef022.

* Revert "Move string_consts"

This reverts commit 0a6bf67.

* Revert "Merge pull request #38146 from Ramza13/battery"

This reverts commit 9286722, reversing
changes made to e9f1cd7.

* Revert "Merge pull request #38134 from AMurkin/rename-blob"

This reverts commit 06f72d2, reversing
changes made to bcfe074.

* Revert "Yet more string consts moved out (#38130)"

This reverts commit b5f18f3.

* Revert "Merge pull request #38115 from Ramza13/string_consts_game"

This reverts commit 9807657, reversing
changes made to 036465f.

* Fixup to the picked_up

* RE-inline item_location initialization

* Update character.h

* Update item.cpp

* Update item.h

* Update item_action.cpp

* Update item_factory.cpp

* Update point.h

* Update safemode_ui.cpp
  • Loading branch information
kevingranade authored Feb 25, 2020
1 parent 7e64112 commit 5fa9146
Show file tree
Hide file tree
Showing 145 changed files with 2,041 additions and 2,300 deletions.
6 changes: 3 additions & 3 deletions src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,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_BUTCHER );
const int factorD = g->u.max_quality( quality_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;
Expand Down Expand Up @@ -650,7 +650,7 @@ static bool can_pickup_at( const tripoint &p )
bool veh_has_items = false;
const optional_vpart_position vp = g->m.veh_at( p );
if( vp ) {
const int cargo_part = vp->vehicle().part_with_feature( vp->part_index(), flag_CARGO, false );
const int cargo_part = vp->vehicle().part_with_feature( vp->part_index(), "CARGO", false );
veh_has_items = cargo_part >= 0 && !vp->vehicle().get_items( cargo_part ).empty();
}
return g->m.has_items( p ) || veh_has_items;
Expand Down
42 changes: 21 additions & 21 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static void butcher_cbm_group( const std::string &group, const tripoint &pos,

static void set_up_butchery( player_activity &act, player &u, butcher_type action )
{
const int factor = u.max_quality( action == DISSECT ? quality_CUT_FINE : quality_BUTCHER );
const int factor = u.max_quality( action == DISSECT ? qual_CUT_FINE : qual_BUTCHER );

const item &corpse_item = *act.targets.back();
const mtype &corpse = *corpse_item.get_mtype();
Expand Down Expand Up @@ -446,7 +446,7 @@ static void set_up_butchery( player_activity &act, player &u, butcher_type actio
act.targets.pop_back();
return;
}
if( !( u.has_quality( quality_SAW_W ) || u.has_quality( quality_SAW_M ) ) ) {
if( !( u.has_quality( qual_SAW_W ) || u.has_quality( qual_SAW_M ) ) ) {
u.add_msg_if_player( m_info,
_( "For a corpse this big you need a saw to perform a full butchery." ) );
act.targets.pop_back();
Expand Down Expand Up @@ -498,11 +498,11 @@ 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( 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 ) ) ) {
const bool is_human = corpse.id == mtype_id::NULL_ID() || ( corpse.in_species( HUMAN ) &&
!corpse.in_species( ZOMBIE ) );
if( is_human && !( u.has_trait_flag( trait_flag_CANNIBAL ) ||
u.has_trait_flag( trait_flag_PSYCHOPATH ) ||
u.has_trait_flag( trait_flag_SAPIOVORE ) ) ) {

if( u.is_player() ) {
if( query_yn( _( "Would you dare desecrate the mortal remains of a fellow human being?" ) ) ) {
Expand Down Expand Up @@ -539,7 +539,7 @@ static void set_up_butchery( player_activity &act, player &u, butcher_type actio
int butcher_time_to_cut( const player &u, const item &corpse_item, const butcher_type action )
{
const mtype &corpse = *corpse_item.get_mtype();
const int factor = u.max_quality( action == DISSECT ? quality_CUT_FINE : quality_BUTCHER );
const int factor = u.max_quality( action == DISSECT ? qual_CUT_FINE : qual_BUTCHER );

int time_to_cut = 0;
switch( corpse.size ) {
Expand Down Expand Up @@ -1038,13 +1038,13 @@ void activity_handlers::butcher_finish( player_activity *act, player *p )
}

int skill_level = p->get_skill_level( skill_survival );
int factor = p->max_quality( action == DISSECT ? quality_CUT_FINE :
quality_BUTCHER );
int factor = p->max_quality( action == DISSECT ? qual_CUT_FINE :
qual_BUTCHER );

// DISSECT has special case factor calculation and results.
if( action == DISSECT ) {
skill_level = p->get_skill_level( skill_firstaid );
skill_level += p->max_quality( quality_CUT_FINE );
skill_level += p->max_quality( qual_CUT_FINE );
skill_level += p->get_skill_level( skill_electronics ) / 2;
add_msg( m_debug, _( "Skill: %s" ), skill_level );
}
Expand Down Expand Up @@ -1166,7 +1166,7 @@ void activity_handlers::butcher_finish( player_activity *act, player *p )
_( "You did something wrong and hacked the corpse badly. Maybe it's still recoverable." ) );
break;
}
corpse_item.set_flag( flag_FIELD_DRESS_FAILED );
corpse_item.set_flag( "FIELD_DRESS_FAILED" );

g->m.add_splatter( type_gib, p->pos(), rng( corpse->size + 2, ( corpse->size + 1 ) * 2 ) );
g->m.add_splatter( type_blood, p->pos(), rng( corpse->size + 2, ( corpse->size + 1 ) * 2 ) );
Expand Down Expand Up @@ -1504,19 +1504,19 @@ void activity_handlers::forage_finish( player_activity *act, player *p )
switch( season_of_year( calendar::turn ) ) {
case SPRING:
loc = "forage_spring";
next_ter = ter_underbrush_harvested_spring;
next_ter = ter_str_id( "t_underbrush_harvested_spring" );
break;
case SUMMER:
loc = "forage_summer";
next_ter = ter_underbrush_harvested_summer;
next_ter = ter_str_id( "t_underbrush_harvested_summer" );
break;
case AUTUMN:
loc = "forage_autumn";
next_ter = ter_underbrush_harvested_autumn;
next_ter = ter_str_id( "t_underbrush_harvested_autumn" );
break;
case WINTER:
loc = "forage_winter";
next_ter = ter_underbrush_harvested_winter;
next_ter = ter_str_id( "t_underbrush_harvested_winter" );
break;
default:
debugmsg( "Invalid season" );
Expand Down Expand Up @@ -2362,7 +2362,7 @@ struct weldrig_hack {
return false;
}

part = veh->part_with_feature( part, flag_WELDRIG, true );
part = veh->part_with_feature( part, "WELDRIG", true );
return part >= 0;
}

Expand Down Expand Up @@ -2559,7 +2559,7 @@ void activity_handlers::heat_item_finish( player_activity *act, player *p )
return;
}
item &target = *heat->get_food();
if( target.item_tags.count( flag_FROZEN ) ) {
if( target.item_tags.count( "FROZEN" ) ) {
target.apply_freezerburn();
if( target.has_flag( flag_EATEN_COLD ) ) {
target.cold_up();
Expand Down Expand Up @@ -2696,7 +2696,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( flag_IRREMOVABLE );
mod.item_tags.insert( "IRREMOVABLE" );
tool.contents.push_back( mod );
act->targets[1].remove_item();
}
Expand Down Expand Up @@ -2860,7 +2860,7 @@ static void rod_fish( player *p, std::vector<monster *> &fishables )
//if the vector is empty (no fish around) the player is still given a small chance to get a (let us say it was hidden) fish
if( fishables.empty() ) {
const std::vector<mtype_id> fish_group = MonsterGroupManager::GetMonstersFromGroup(
GROUP_FISH );
mongroup_id( "GROUP_FISH" ) );
const mtype_id fish_mon = random_entry_ref( fish_group );
g->m.add_item_or_charges( p->pos(), item::make_corpse( fish_mon, calendar::turn + rng( 0_turns,
3_hours ) ) );
Expand Down Expand Up @@ -3867,7 +3867,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( flag_FILTHY );
it->item_tags.insert( "FILTHY" );
it->set_damage( rng( 1, it->max_damage() - 1 ) );
}
}
Expand Down
Loading

0 comments on commit 5fa9146

Please sign in to comment.