From fd545448788046edb9b1a421c48e220d0285e142 Mon Sep 17 00:00:00 2001 From: Valiant Date: Wed, 21 Oct 2020 09:52:07 +0400 Subject: [PATCH 1/3] Added an external option to disable direct damage to monsters when they get bleeding effect --- data/core/game_balance.json | 7 +++++++ src/monster.cpp | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/data/core/game_balance.json b/data/core/game_balance.json index dc2794d4782fa..a3f96c2d40898 100644 --- a/data/core/game_balance.json +++ b/data/core/game_balance.json @@ -194,5 +194,12 @@ "info": "If false, examining workbench-type furniture will auto-execute pickup and undeploy (where applicable) actions, no crafting-related options will be listed.", "stype": "bool", "value": true + }, + { + "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.", + "stype": "bool", + "value": true } ] diff --git a/src/monster.cpp b/src/monster.cpp index e2154dd9e47d8..61903de754888 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -2441,7 +2441,8 @@ void monster::process_one_effect( effect &it, bool is_new ) effect_cache[FLEEING] = true; } else if( id == effect_no_sight || id == effect_blind ) { effect_cache[VISION_IMPAIRED] = true; - } else if( id == effect_bleed && x_in_y( it.get_intensity(), it.get_max_intensity() ) ) { + } else if( id == effect_bleed && x_in_y( it.get_intensity(), it.get_max_intensity() ) && + get_option( "MONSTERS_TAKE_DIRECT_DAMAGE_FROM_BLEEDING" ) ) { // monsters are simplified so they just take damage from bleeding apply_damage( it.get_source().resolve_creature(), bodypart_id( "torso" ), 1 ); // this is for balance only From b34fffc35b0708bbc0e5558e2455b2e3ec4c20ab Mon Sep 17 00:00:00 2001 From: Valiant Date: Wed, 21 Oct 2020 21:31:44 +0400 Subject: [PATCH 2/3] Corrected if check --- src/monster.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/monster.cpp b/src/monster.cpp index 61903de754888..e90673f754dac 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -2441,10 +2441,11 @@ void monster::process_one_effect( effect &it, bool is_new ) effect_cache[FLEEING] = true; } else if( id == effect_no_sight || id == effect_blind ) { effect_cache[VISION_IMPAIRED] = true; - } else if( id == effect_bleed && x_in_y( it.get_intensity(), it.get_max_intensity() ) && - get_option( "MONSTERS_TAKE_DIRECT_DAMAGE_FROM_BLEEDING" ) ) { + } 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 - apply_damage( it.get_source().resolve_creature(), bodypart_id( "torso" ), 1 ); + if( get_option( "MONSTERS_TAKE_DIRECT_DAMAGE_FROM_BLEEDING" ) ) { + 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(); From ea366b68957e8790b9098cbb9a2deb7bb038f158 Mon Sep 17 00:00:00 2001 From: Valiant Date: Thu, 22 Oct 2020 22:05:50 +0400 Subject: [PATCH 3/3] Made zombies immune to bleeding effect with the ZOMBIES_DONT_BLEED option --- data/core/game_balance.json | 6 +++--- src/monster.cpp | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/data/core/game_balance.json b/data/core/game_balance.json index a3f96c2d40898..ad3cdf4e410c9 100644 --- a/data/core/game_balance.json +++ b/data/core/game_balance.json @@ -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 } ] diff --git a/src/monster.cpp b/src/monster.cpp index e90673f754dac..9e41a7dc2cdca 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -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( "ZOMBIES_DONT_BLEED" ) && in_species( species_ZOMBIE ) ); } if( effect == effect_paralyzepoison || @@ -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( "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();