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

Remove orphaned code from obsolete mods #40357

Merged
merged 1 commit into from
May 9, 2020
Merged
Changes from all commits
Commits
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
28 changes: 0 additions & 28 deletions data/json/game_balance.json
Original file line number Diff line number Diff line change
@@ -76,27 +76,6 @@
"stype": "bool",
"value": false
},
{
"type": "EXTERNAL_OPTION",
"name": "FILTHY_CLOTHES",
"info": "If true, zombies will drop filthy clothing.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "FILTHY_MORALE",
"info": "Morale penalty for filthy clothing. If true, wearing filthy clothing will cause morale penalties. Doesn't make sense if FILTHY_CLOTHES option is false.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "FILTHY_WOUNDS",
"info": "Infected wounds from filthy clothing. If true, getting hit in a body part covered in filthy clothing may cause infections. Doesn't make sense if FILTHY_CLOTHES option is false.",
"stype": "bool",
"value": true
},
{
"type": "EXTERNAL_OPTION",
"name": "MANUAL_BIONIC_INSTALLATION",
@@ -153,13 +132,6 @@
"stype": "int",
"value": 0
},
{
"type": "EXTERNAL_OPTION",
"name": "MAX_HARVEST_COUNT",
"info": "The maximum amount of produce that can be harvested from a plant.",
"stype": "int",
"value": 12
},
{
"type": "EXTERNAL_OPTION",
"name": "DISABLE_ROBOT_RESPONSE",
46 changes: 22 additions & 24 deletions src/character.cpp
Original file line number Diff line number Diff line change
@@ -8623,31 +8623,29 @@ dealt_damage_instance Character::deal_damage( Creature *source, bodypart_id bp,
}
}

if( get_option<bool>( "FILTHY_WOUNDS" ) ) {
int sum_cover = 0;
for( const item &i : worn ) {
if( i.covers( bp->token ) && i.is_filthy() ) {
sum_cover += i.get_coverage();
}
}

// Chance of infection is damage (with cut and stab x4) * sum of coverage on affected body part, in percent.
// i.e. if the body part has a sum of 100 coverage from filthy clothing,
// each point of damage has a 1% change of causing infection.
if( sum_cover > 0 ) {
const int cut_type_dam = dealt_dams.type_damage( DT_CUT ) + dealt_dams.type_damage( DT_STAB );
const int combined_dam = dealt_dams.type_damage( DT_BASH ) + ( cut_type_dam * 4 );
const int infection_chance = ( combined_dam * sum_cover ) / 100;
if( x_in_y( infection_chance, 100 ) ) {
if( has_effect( effect_bite, bp->token ) ) {
add_effect( effect_bite, 40_minutes, bp->token, true );
} else if( has_effect( effect_infected, bp->token ) ) {
add_effect( effect_infected, 25_minutes, bp->token, true );
} else {
add_effect( effect_bite, 1_turns, bp->token, true );
}
add_msg_if_player( _( "Filth from your clothing has implanted deep in the wound." ) );
int sum_cover = 0;
for( const item &i : worn ) {
if( i.covers( bp->token ) && i.is_filthy() ) {
sum_cover += i.get_coverage();
}
}

// Chance of infection is damage (with cut and stab x4) * sum of coverage on affected body part, in percent.
// i.e. if the body part has a sum of 100 coverage from filthy clothing,
// each point of damage has a 1% change of causing infection.
if( sum_cover > 0 ) {
const int cut_type_dam = dealt_dams.type_damage( DT_CUT ) + dealt_dams.type_damage( DT_STAB );
const int combined_dam = dealt_dams.type_damage( DT_BASH ) + ( cut_type_dam * 4 );
const int infection_chance = ( combined_dam * sum_cover ) / 100;
if( x_in_y( infection_chance, 100 ) ) {
if( has_effect( effect_bite, bp->token ) ) {
add_effect( effect_bite, 40_minutes, bp->token, true );
} else if( has_effect( effect_infected, bp->token ) ) {
add_effect( effect_infected, 25_minutes, bp->token, true );
} else {
add_effect( effect_bite, 1_turns, bp->token, true );
}
add_msg_if_player( _( "Filth from your clothing has implanted deep in the wound." ) );
}
}

2 changes: 1 addition & 1 deletion src/iexamine.cpp
Original file line number Diff line number Diff line change
@@ -2154,7 +2154,7 @@ void iexamine::harvest_plant( player &p, const tripoint &examp, bool from_activi
///\EFFECT_SURVIVAL increases number of plants harvested from a seed
int plant_count = rng( skillLevel / 2, skillLevel );
plant_count *= g->m.furn( examp )->plant->harvest_multiplier;
const int max_harvest_count = get_option<int>( "MAX_HARVEST_COUNT" );
const int max_harvest_count = 12;
if( plant_count >= max_harvest_count ) {
plant_count = max_harvest_count;
} else if( plant_count <= 0 ) {
3 changes: 1 addition & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
@@ -9710,8 +9710,7 @@ skill_id item::contextualize_skill( const skill_id &id ) const

bool item::is_filthy() const
{
return has_flag( flag_FILTHY ) && ( get_option<bool>( "FILTHY_MORALE" ) ||
g->u.has_trait( trait_SQUEAMISH ) );
return has_flag( flag_FILTHY );
}

bool item::on_drop( const tripoint &pos )
2 changes: 1 addition & 1 deletion src/iuse_actor.cpp
Original file line number Diff line number Diff line change
@@ -3333,7 +3333,7 @@ int heal_actor::use( player &p, item &it, bool, const tripoint &pos ) const
p.add_msg_if_player( m_info, _( "You can't do that while mounted." ) );
return 0;
}
if( get_option<bool>( "FILTHY_WOUNDS" ) && it.is_filthy() ) {
if( it.is_filthy() ) {
p.add_msg_if_player( m_info, _( "You can't use filthy items for healing." ) );
return 0;
}
2 changes: 1 addition & 1 deletion src/monster.cpp
Original file line number Diff line number Diff line change
@@ -2391,7 +2391,7 @@ void monster::drop_items_on_death()

const auto dropped = g->m.spawn_items( pos(), items );

if( has_flag( MF_FILTHY ) && get_option<bool>( "FILTHY_CLOTHES" ) ) {
if( has_flag( MF_FILTHY ) ) {
for( const auto &it : dropped ) {
if( ( it->is_armor() || it->is_pet_armor() ) && !it->is_gun() ) {
// handle wearable guns as a special case
4 changes: 0 additions & 4 deletions src/morale.cpp
Original file line number Diff line number Diff line change
@@ -1088,10 +1088,6 @@ void player_morale::update_constrained_penalty()

void player_morale::update_squeamish_penalty()
{
if( !get_option<bool>( "FILTHY_MORALE" ) ) {
set_permanent( MORALE_PERM_FILTHY, 0 );
return;
}
int penalty = 0;
for( const std::pair<const bodypart_id, body_part_data> &bpt : body_parts ) {
if( bpt.second.filthy > 0 ) {
1 change: 0 additions & 1 deletion tests/item_tname_test.cpp
Original file line number Diff line number Diff line change
@@ -241,7 +241,6 @@ TEST_CASE( "wet item", "[item][tname][wet]" )

TEST_CASE( "filthy item", "[item][tname][filthy]" )
{
override_option opt( "FILTHY_MORALE", "true" );
item rag( "rag" );
rag.set_flag( flag_FILTHY );
REQUIRE( rag.is_filthy() );