Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert string centralization #38321

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ec97223
Revert "Moved more string consts into single file (#38237)"
kevingranade Feb 23, 2020
0274847
Revert "Moved more string consts into single file (#38220)"
kevingranade Feb 23, 2020
f7b0acc
Revert "Move string consts into single file (#38195)"
kevingranade Feb 23, 2020
81ae825
Revert "More string consts into single file (#38189)"
kevingranade Feb 23, 2020
d92ac3f
Revert "More string consts into single file (#38183)"
kevingranade Feb 23, 2020
422740f
Revert "Move string consts into single file (#38184)"
kevingranade Feb 23, 2020
486c85c
Revert "Move string consts into single file (#38181)"
kevingranade Feb 23, 2020
6a76a89
Revert "Move more string consts into single file (#38175)"
kevingranade Feb 23, 2020
2999a85
Revert "Merge pull request #38176 from Ramza13/string_consts_and_more"
kevingranade Feb 23, 2020
1a86712
Revert "Move more string consts into single file (#38169)"
kevingranade Feb 23, 2020
a565702
Revert "Merge pull request #38168 from Ramza13/even_more_string_consts"
kevingranade Feb 23, 2020
be68b0c
Revert "Merge pull request #38141 from ZhilkinSerg/sa-2020-02-18"
kevingranade Feb 23, 2020
9c7e8ff
Revert "Move string consts into single file (#38158)"
kevingranade Feb 23, 2020
f2be6b5
Revert "Merge pull request #38157 from Ramza13/string_consts_more_flags"
kevingranade Feb 23, 2020
93a9dd0
Revert "Move string_consts"
kevingranade Feb 23, 2020
3d793dc
Revert "Merge pull request #38146 from Ramza13/battery"
kevingranade Feb 23, 2020
c546b86
Revert "Merge pull request #38134 from AMurkin/rename-blob"
kevingranade Feb 23, 2020
7756f5b
Revert "Yet more string consts moved out (#38130)"
kevingranade Feb 23, 2020
01a6a74
Revert "Merge pull request #38115 from Ramza13/string_consts_game"
kevingranade Feb 23, 2020
4645f42
Fixup to the picked_up
kevingranade Feb 25, 2020
5561692
RE-inline item_location initialization
kevingranade Feb 25, 2020
18491f0
Update character.h
kevingranade Feb 25, 2020
560944e
Update item.cpp
kevingranade Feb 25, 2020
e1fadf2
Update item.h
kevingranade Feb 25, 2020
629ab4f
Update item_action.cpp
kevingranade Feb 25, 2020
1520f3d
Update item_factory.cpp
kevingranade Feb 25, 2020
b3c6e68
Update point.h
kevingranade Feb 25, 2020
21a2efb
Update safemode_ui.cpp
kevingranade Feb 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3866,7 +3866,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