Skip to content

Commit

Permalink
Made zombies immune to bleeding effect with the ZOMBIES_DONT_BLEED op…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
Valiant committed Oct 22, 2020
1 parent b34fffc commit ea366b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions data/core/game_balance.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@
},
{
"type": "EXTERNAL_OPTION",
"name": "MONSTERS_TAKE_DIRECT_DAMAGE_FROM_BLEEDING",
"info": "If false, warmblooded monsters won't take direct damage to the torso when they get bleeding effect.",
"name": "ZOMBIES_DONT_BLEED",
"info": "If true, zombies won't bleed and won't take direct damage to the torso when they get bleeding effect.",
"stype": "bool",
"value": true
"value": false
}
]
7 changes: 3 additions & 4 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,8 @@ bool monster::is_immune_effect( const efftype_id &effect ) const

if( effect == effect_bleed ) {
return !has_flag( MF_WARM ) ||
!made_of( material_id( "flesh" ) );
!made_of( material_id( "flesh" ) ) ||
( get_option<bool>( "ZOMBIES_DONT_BLEED" ) && in_species( species_ZOMBIE ) );
}

if( effect == effect_paralyzepoison ||
Expand Down Expand Up @@ -2443,9 +2444,7 @@ void monster::process_one_effect( effect &it, bool is_new )
effect_cache[VISION_IMPAIRED] = true;
} else if( id == effect_bleed && x_in_y( it.get_intensity(), it.get_max_intensity() ) ) {
// monsters are simplified so they just take damage from bleeding
if( get_option<bool>( "MONSTERS_TAKE_DIRECT_DAMAGE_FROM_BLEEDING" ) ) {
apply_damage( it.get_source().resolve_creature(), bodypart_id( "torso" ), 1 );
}
apply_damage( it.get_source().resolve_creature(), bodypart_id( "torso" ), 1 );
// this is for balance only
it.mod_duration( -rng( 1_turns, it.get_int_dur_factor() / 2 ) );
bleed();
Expand Down

0 comments on commit ea366b6

Please sign in to comment.