From 134ba954a26127b298d524135b64971d7570ccb7 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 25 Nov 2020 08:58:07 +0100 Subject: [PATCH 01/22] Filter? --- src/bionics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bionics.cpp b/src/bionics.cpp index 4999d7a70cd37..98b870f234d99 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -734,7 +734,8 @@ bool Character::activate_bionic( int b, bool eff_only, bool *close_bionics_ui ) effect_drunk, effect_cig, effect_high, effect_hallu, effect_visuals, effect_pblue, effect_iodine, effect_datura, effect_took_xanax, effect_took_prozac, effect_took_prozac_bad, - effect_took_flumed, effect_antifungal + effect_took_flumed, effect_antifungal, effect_venom_weaken, + effect_venom_dmg } }; From d49d4443d3eaa1ec8582a9299b32b4ab0cb72c34 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 25 Nov 2020 11:24:21 +0100 Subject: [PATCH 02/22] Update bionics.cpp --- src/bionics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bionics.cpp b/src/bionics.cpp index 98b870f234d99..1160994f793fe 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -117,6 +117,8 @@ static const efftype_id effect_took_prozac( "took_prozac" ); static const efftype_id effect_took_prozac_bad( "took_prozac_bad" ); static const efftype_id effect_took_xanax( "took_xanax" ); static const efftype_id effect_under_operation( "under_operation" ); +static const efftype_id effect_venom_dmg( "venom_dmg" ); +static const efftype_id effect_venom_weaken( "venom_weaken" ); static const efftype_id effect_visuals( "visuals" ); static const material_id fuel_type_battery( "battery" ); From 1147740a69b8528ed94bbf044b213a05ee63c30b Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 16 Dec 2020 10:42:13 +0100 Subject: [PATCH 03/22] Merge branch 'master' into PoisonTweak From 1a0179e201545f84f6314fe0526a7cd39f681066 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 16 Dec 2020 12:47:31 +0100 Subject: [PATCH 04/22] Analysis --- data/json/effects.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/json/effects.json b/data/json/effects.json index 99af6affa92b1..b5f1d7de5ba9b 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -477,6 +477,7 @@ "show_intensity": false, "rating": "bad", "resist_traits": [ "POISRESIST" ], + "blood_analysis_description": "Necrotizing Venom", "pain_sizing": true, "hurt_sizing": true, "main_parts_only": true, @@ -506,6 +507,7 @@ "remove_message": "The weight on your chest lessens.", "rating": "bad", "resist_traits": [ "POISRESIST" ], + "blood_analysis_description": "Exogenic Vasodilators" "max_intensity": 125, "max_effective_intensity": 100, "max_duration": 18000, From 57044d70a57daaae13ccba6637fa6d05298fb4cb Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 16 Dec 2020 12:48:08 +0100 Subject: [PATCH 05/22] Tickup --- data/json/effects.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/effects.json b/data/json/effects.json index b5f1d7de5ba9b..8b5b93ee11950 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -494,7 +494,7 @@ "hurt_amount": [ 5, 0 ], "hurt_min": [ 2, 1 ], "hurt_chance": [ 13, 100 ], - "hurt_tick": [ 30 ] + "hurt_tick": [ 36 ] }, "scaling_mods": { "pain_min": [ 0.05, 0.01 ], "pain_chance": [ -0.15, -0.8 ], "hurt_chance": [ -0.11, -0.81 ] } }, From 5f4c43c2402e42cebba68d80ef756eace535edf0 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:29:03 +0100 Subject: [PATCH 06/22] Extend filter --- data/json/effects.json | 2 +- src/bionics.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/data/json/effects.json b/data/json/effects.json index 8b5b93ee11950..3a0ec40ce5e17 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -507,7 +507,7 @@ "remove_message": "The weight on your chest lessens.", "rating": "bad", "resist_traits": [ "POISRESIST" ], - "blood_analysis_description": "Exogenic Vasodilators" + "blood_analysis_description": "Exogenic Vasodilators", "max_intensity": 125, "max_effective_intensity": 100, "max_duration": 18000, diff --git a/src/bionics.cpp b/src/bionics.cpp index b22a78755feaa..ca3c60d5c08a8 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -89,6 +89,7 @@ static const efftype_id effect_adrenaline( "adrenaline" ); static const efftype_id effect_antifungal( "antifungal" ); static const efftype_id effect_assisted( "assisted" ); static const efftype_id effect_asthma( "asthma" ); +static const efftype_id effect_badpoison( "badpoison" ); static const efftype_id effect_bleed( "bleed" ); static const efftype_id effect_bloodworms( "bloodworms" ); static const efftype_id effect_cig( "cig" ); @@ -103,6 +104,7 @@ static const efftype_id effect_iodine( "iodine" ); static const efftype_id effect_meth( "meth" ); static const efftype_id effect_narcosis( "narcosis" ); static const efftype_id effect_operating( "operating" ); +static const efftype_id effect_paralyzepoison( "paralysepoison" ); static const efftype_id effect_pblue( "pblue" ); static const efftype_id effect_pkill_l( "pkill_l" ); static const efftype_id effect_pkill1( "pkill1" ); @@ -732,13 +734,13 @@ bool Character::activate_bionic( int b, bool eff_only, bool *close_bionics_ui ) add_msg_activate(); static const std::vector removable = {{ effect_fungus, effect_dermatik, effect_bloodworms, - effect_tetanus, effect_poison, effect_stung, + effect_tetanus, effect_poison, effect_badpoison, effect_stung, effect_pkill1, effect_pkill2, effect_pkill3, effect_pkill_l, effect_drunk, effect_cig, effect_high, effect_hallu, effect_visuals, effect_pblue, effect_iodine, effect_datura, effect_took_xanax, effect_took_prozac, effect_took_prozac_bad, effect_took_flumed, effect_antifungal, effect_venom_weaken, - effect_venom_dmg + effect_venom_dmg, effect_paralyzepoison } }; From 0c0d994621889e2385f751c3113d875d49aa1ffa Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 16 Dec 2020 14:03:17 +0100 Subject: [PATCH 07/22] Lint --- data/json/effects.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/json/effects.json b/data/json/effects.json index 3a0ec40ce5e17..cdaab92ac3a55 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -477,7 +477,7 @@ "show_intensity": false, "rating": "bad", "resist_traits": [ "POISRESIST" ], - "blood_analysis_description": "Necrotizing Venom", + "blood_analysis_description": "Necrotizing Venom", "pain_sizing": true, "hurt_sizing": true, "main_parts_only": true, @@ -507,7 +507,7 @@ "remove_message": "The weight on your chest lessens.", "rating": "bad", "resist_traits": [ "POISRESIST" ], - "blood_analysis_description": "Exogenic Vasodilators", + "blood_analysis_description": "Exogenic Vasodilators", "max_intensity": 125, "max_effective_intensity": 100, "max_duration": 18000, From 12d7b731a4f4170511762b231b572cfd32e31e41 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:07:47 +0100 Subject: [PATCH 08/22] Update src/bionics.cpp Co-authored-by: anothersimulacrum --- src/bionics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bionics.cpp b/src/bionics.cpp index ca3c60d5c08a8..7723ce75fae3b 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -740,7 +740,7 @@ bool Character::activate_bionic( int b, bool eff_only, bool *close_bionics_ui ) effect_pblue, effect_iodine, effect_datura, effect_took_xanax, effect_took_prozac, effect_took_prozac_bad, effect_took_flumed, effect_antifungal, effect_venom_weaken, - effect_venom_dmg, effect_paralyzepoison + effect_venom_dmg, effect_paralysepoison } }; From 2d2f1566fd4b70e3a9f4d5ad08faff0f22e16499 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 16 Dec 2020 18:07:58 +0100 Subject: [PATCH 09/22] Update src/bionics.cpp Co-authored-by: anothersimulacrum --- src/bionics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bionics.cpp b/src/bionics.cpp index 7723ce75fae3b..50ac488763229 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -104,7 +104,7 @@ static const efftype_id effect_iodine( "iodine" ); static const efftype_id effect_meth( "meth" ); static const efftype_id effect_narcosis( "narcosis" ); static const efftype_id effect_operating( "operating" ); -static const efftype_id effect_paralyzepoison( "paralysepoison" ); +static const efftype_id effect_paralysepoison( "paralysepoison" ); static const efftype_id effect_pblue( "pblue" ); static const efftype_id effect_pkill_l( "pkill_l" ); static const efftype_id effect_pkill1( "pkill1" ); From e6755cd618a1a94d71e403a6ea848b9c50b24737 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Wed, 16 Dec 2020 21:36:14 +0100 Subject: [PATCH 10/22] Material restriction applies --- src/monster.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/monster.cpp b/src/monster.cpp index 8fd559d401584..5026c65a2bea0 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -88,6 +88,8 @@ static const efftype_id effect_run( "run" ); static const efftype_id effect_stunned( "stunned" ); static const efftype_id effect_supercharged( "supercharged" ); static const efftype_id effect_tied( "tied" ); +static const efftype_id effect_venom_dmg( "venom_dmg" ); +static const efftype_id effect_venom_weaken( "venom_weaken" ); static const efftype_id effect_webbed( "webbed" ); static const itype_id itype_corpse( "corpse" ); @@ -1289,6 +1291,8 @@ bool monster::is_immune_effect( const efftype_id &effect ) const if( effect == effect_paralyzepoison || effect == effect_badpoison || + effect == effect_venom_dmg || + effect == effect_venom_weaken || effect == effect_poison ) { return !has_flag( MF_WARM ) || ( !made_of( material_id( "flesh" ) ) && !made_of( material_id( "iflesh" ) ) ); From fad14a72e8be29c755c3f00b0d0bbe4316fac2e6 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Thu, 17 Dec 2020 09:47:56 +0100 Subject: [PATCH 11/22] Update effects.json --- data/json/effects.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/effects.json b/data/json/effects.json index cdaab92ac3a55..08b8fbdd1eec1 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -507,7 +507,7 @@ "remove_message": "The weight on your chest lessens.", "rating": "bad", "resist_traits": [ "POISRESIST" ], - "blood_analysis_description": "Exogenic Vasodilators", + "blood_analysis_description": "Systemic Inflammatory Agents", "max_intensity": 125, "max_effective_intensity": 100, "max_duration": 18000, From a33ddb8832769df0d77482bd974a414206a993c1 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Thu, 17 Dec 2020 20:36:27 +0100 Subject: [PATCH 12/22] Actually make it work --- src/monster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monster.cpp b/src/monster.cpp index 5026c65a2bea0..4af7dc0c53c5a 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1294,8 +1294,8 @@ bool monster::is_immune_effect( const efftype_id &effect ) const effect == effect_venom_dmg || effect == effect_venom_weaken || effect == effect_poison ) { - return !has_flag( MF_WARM ) || - ( !made_of( material_id( "flesh" ) ) && !made_of( material_id( "iflesh" ) ) ); + return type->in_species(species_ZOMBIE) || + !made_of_any( Creature::cmat_flesh); } if( effect == effect_stunned ) { From 0b872d8c8948de2c2a8629a1d0520d64c8317ff5 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Thu, 17 Dec 2020 20:47:36 +0100 Subject: [PATCH 13/22] Adjust Webber --- data/json/monsters/insect_spider.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/json/monsters/insect_spider.json b/data/json/monsters/insect_spider.json index eb2895258de7e..25a5b896ab826 100644 --- a/data/json/monsters/insect_spider.json +++ b/data/json/monsters/insect_spider.json @@ -947,8 +947,8 @@ "melee_dice": 1, "melee_dice_sides": 6, "melee_cut": 6, - "attack_effs": [ { "id": "venom_dmg", "duration": 750, "affect_hit_bp": true } ], - "//": "3 hits to max intensity, 3 hits to max duration", + "attack_effs": [ { "id": "venom_dmg", "duration": 400, "affect_hit_bp": true } ], + "//": "5 hits to max intensity, 6 hits to max duration", "dodge": 2, "armor_bash": 2, "armor_cut": 6, From b7820bd8801a1dcaac901be35a4f9448b228b9a9 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Thu, 17 Dec 2020 21:12:03 +0100 Subject: [PATCH 14/22] Astyle --- src/monster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monster.cpp b/src/monster.cpp index 4af7dc0c53c5a..fe3adf868abe5 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1294,8 +1294,8 @@ bool monster::is_immune_effect( const efftype_id &effect ) const effect == effect_venom_dmg || effect == effect_venom_weaken || effect == effect_poison ) { - return type->in_species(species_ZOMBIE) || - !made_of_any( Creature::cmat_flesh); + return type->in_species( species_ZOMBIE ) || + !made_of_any( Creature::cmat_flesh ); } if( effect == effect_stunned ) { From f2c01e5cdde6bf561bef41d02f6a68ad89ee1576 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Sat, 19 Dec 2020 13:48:55 +0100 Subject: [PATCH 15/22] Test --- tests/creature_effect_test.cpp | 92 ++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 33 deletions(-) diff --git a/tests/creature_effect_test.cpp b/tests/creature_effect_test.cpp index a760460ed1b5d..86666dd6898a5 100644 --- a/tests/creature_effect_test.cpp +++ b/tests/creature_effect_test.cpp @@ -8,6 +8,8 @@ #include "mtype.h" #include "type_id.h" +static const species_id species_ZOMBIE( "ZOMBIE" ); + // Test effect methods from `Creature` class on both `monster` and `player` // Functions covered: @@ -352,50 +354,52 @@ TEST_CASE( "monster is_immune_effect", "[creature][monster][effect][immune]" ) const efftype_id effect_poison( "poison" ); const efftype_id effect_badpoison( "badpoison" ); const efftype_id effect_paralyzepoison( "paralyzepoison" ); + const efftype_id effect_venom_dmg( "venom_dmg" ); + const efftype_id effect_venom_weaken( "venom_weaken" ); // TODO: Monster may be immune to: // - onfire (if is_immune_damage DT_HEAT, made_of LIQUID, has_flag MF_FIREY) // - stunned (if has_flag MF_STUN_IMMUNE) - WHEN( "monster is made of flesh and is warm-blooded" ) { - // Regular zombie - fleshy and warm - monster zed( mtype_id( "mon_zombie" ) ); - zed.clear_effects(); - REQUIRE( zed.made_of( material_id( "flesh" ) ) ); - REQUIRE( zed.has_flag( MF_WARM ) ); + WHEN( "monster is made of flesh and is not zombified" ) { + // Cow - fleshy and alive + monster cow( mtype_id( "mon_cow" ) ); + cow.clear_effects(); + REQUIRE( cow.made_of_any( Creature::cmat_flesh ) ); + REQUIRE_FALSE( cow.type->in_species( species_ZOMBIE ) ); THEN( "they can bleed" ) { - CHECK_FALSE( zed.is_immune_effect( effect_bleed ) ); + CHECK_FALSE( cow.is_immune_effect( effect_bleed ) ); } THEN( "they can be poisoned" ) { - CHECK_FALSE( zed.is_immune_effect( effect_bleed ) ); - CHECK_FALSE( zed.is_immune_effect( effect_poison ) ); - CHECK_FALSE( zed.is_immune_effect( effect_badpoison ) ); - CHECK_FALSE( zed.is_immune_effect( effect_paralyzepoison ) ); + CHECK_FALSE( cow.is_immune_effect( effect_poison ) ); + CHECK_FALSE( cow.is_immune_effect( effect_badpoison ) ); + CHECK_FALSE( cow.is_immune_effect( effect_paralyzepoison ) ); + CHECK_FALSE( cow.is_immune_effect( effect_venom_dmg ) ); + CHECK_FALSE( cow.is_immune_effect( effect_venom_weaken ) ); } - } - WHEN( "monster is not not made of flesh and not warm-blooded" ) { - // Skeleton - no flesh, not warm-blooded - monster skelly( mtype_id( "mon_skeleton" ) ); - skelly.clear_effects(); - REQUIRE_FALSE( skelly.made_of( material_id( "flesh" ) ) ); - REQUIRE_FALSE( skelly.made_of( material_id( "iflesh" ) ) ); - REQUIRE_FALSE( skelly.has_flag( MF_WARM ) ); + } + WHEN( "monster is made of flesh but is zombified" ) { + // Zombie - fleshy zombie + monster zed( mtype_id( "mon_zombie" ) ); + zed.clear_effects(); + REQUIRE( zed.made_of_any( Creature::cmat_flesh ) ); + REQUIRE( zed.type->in_species( species_ZOMBIE ) ); - THEN( "they are immune to the bleed effect" ) { - CHECK( skelly.is_immune_effect( effect_bleed ) ); + THEN( "they can bleed" ) { + CHECK_FALSE( zed.is_immune_effect( effect_bleed ) ); } - - THEN( "they are immune to all poison effects" ) { - CHECK( skelly.is_immune_effect( effect_bleed ) ); - CHECK( skelly.is_immune_effect( effect_poison ) ); - CHECK( skelly.is_immune_effect( effect_badpoison ) ); - CHECK( skelly.is_immune_effect( effect_paralyzepoison ) ); + THEN( "they can't be poisoned" ) { + CHECK( zed.is_immune_effect( effect_poison ) ); + CHECK( zed.is_immune_effect( effect_badpoison ) ); + CHECK( zed.is_immune_effect( effect_paralyzepoison ) ); + CHECK( zed.is_immune_effect( effect_venom_dmg ) ); + CHECK( zed.is_immune_effect( effect_venom_weaken ) ); } } - WHEN( "monster is made of flesh, but not warm-blooded" ) { + WHEN( "monster is made of flesh, but shouldn't bleed yet" ) { // Razorclaw - fleshy, with arthropod blood monster razorclaw( mtype_id( "mon_razorclaw" ) ); razorclaw.clear_effects(); @@ -406,11 +410,33 @@ TEST_CASE( "monster is_immune_effect", "[creature][monster][effect][immune]" ) CHECK( razorclaw.is_immune_effect( effect_bleed ) ); } - THEN( "they are immune to all poison effects" ) { - CHECK( razorclaw.is_immune_effect( effect_bleed ) ); - CHECK( razorclaw.is_immune_effect( effect_poison ) ); - CHECK( razorclaw.is_immune_effect( effect_badpoison ) ); - CHECK( razorclaw.is_immune_effect( effect_paralyzepoison ) ); + THEN( "they can be poisoned" ) { + CHECK_FALSE( razorclaw.is_immune_effect( effect_poison ) ); + CHECK_FALSE( razorclaw.is_immune_effect( effect_badpoison ) ); + CHECK_FALSE( razorclaw.is_immune_effect( effect_paralyzepoison ) ); + CHECK_FALSE( razorclaw.is_immune_effect( effect_venom_dmg ) ); + CHECK_FALSE( razorclaw.is_immune_effect( effect_venom_weaken ) ); + } + } + + WHEN( "monster is not made of flesh or iflesh" ) { + // Fungaloid - veggy + monster fungaloid( mtype_id( "mon_fungaloid" ) ); + fungaloid.clear_effects(); + REQUIRE_FALSE( fungaloid.made_of( material_id( "flesh" ) ) ); + REQUIRE_FALSE( fungaloid.made_of( material_id( "iflesh" ) ) ); + REQUIRE_FALSE( fungaloid.has_flag( MF_WARM ) ); + + THEN( "they are immune to the bleed effect" ) { + CHECK( fungaloid.is_immune_effect( effect_bleed ) ); + } + + THEN( "they can't be poisoned" ) { + CHECK( fungaloid.is_immune_effect( effect_poison ) ); + CHECK( fungaloid.is_immune_effect( effect_badpoison ) ); + CHECK( fungaloid.is_immune_effect( effect_paralyzepoison ) ); + CHECK( fungaloid.is_immune_effect( effect_venom_dmg ) ); + CHECK( fungaloid.is_immune_effect( effect_venom_weaken ) ); } } } From eefb4fd7dacf3dce4eb4b4ec9780aefef27d8817 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Sat, 19 Dec 2020 18:32:55 +0100 Subject: [PATCH 16/22] Revert "Material restriction applies" This reverts commit e6755cd618a1a94d71e403a6ea848b9c50b24737. --- src/monster.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/monster.cpp b/src/monster.cpp index fe3adf868abe5..4e3d8275f6286 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -88,8 +88,6 @@ static const efftype_id effect_run( "run" ); static const efftype_id effect_stunned( "stunned" ); static const efftype_id effect_supercharged( "supercharged" ); static const efftype_id effect_tied( "tied" ); -static const efftype_id effect_venom_dmg( "venom_dmg" ); -static const efftype_id effect_venom_weaken( "venom_weaken" ); static const efftype_id effect_webbed( "webbed" ); static const itype_id itype_corpse( "corpse" ); @@ -1291,8 +1289,6 @@ bool monster::is_immune_effect( const efftype_id &effect ) const if( effect == effect_paralyzepoison || effect == effect_badpoison || - effect == effect_venom_dmg || - effect == effect_venom_weaken || effect == effect_poison ) { return type->in_species( species_ZOMBIE ) || !made_of_any( Creature::cmat_flesh ); From f201cffed0f4c6b5bb8232c90a3fc21a81a7d8ce Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Sat, 19 Dec 2020 18:37:19 +0100 Subject: [PATCH 17/22] Update monster.cpp --- src/monster.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/monster.cpp b/src/monster.cpp index 4e3d8275f6286..17186f1375dd9 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1290,8 +1290,13 @@ bool monster::is_immune_effect( const efftype_id &effect ) const if( effect == effect_paralyzepoison || effect == effect_badpoison || effect == effect_poison ) { +<<<<<<< HEAD return type->in_species( species_ZOMBIE ) || !made_of_any( Creature::cmat_flesh ); +======= + return !has_flag( MF_WARM ) || + ( !made_of( material_id( "flesh" ) ) && !made_of( material_id( "iflesh" ) ) ); +>>>>>>> parent of a33ddb8832... Actually make it work } if( effect == effect_stunned ) { From 069af26120664ff6a53d18db8d30ebbbf64aeba5 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Sat, 19 Dec 2020 18:37:28 +0100 Subject: [PATCH 18/22] Revert "Revert "Material restriction applies"" This reverts commit eefb4fd7dacf3dce4eb4b4ec9780aefef27d8817. --- src/monster.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/monster.cpp b/src/monster.cpp index 17186f1375dd9..cc1a4ffa23399 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -88,6 +88,8 @@ static const efftype_id effect_run( "run" ); static const efftype_id effect_stunned( "stunned" ); static const efftype_id effect_supercharged( "supercharged" ); static const efftype_id effect_tied( "tied" ); +static const efftype_id effect_venom_dmg( "venom_dmg" ); +static const efftype_id effect_venom_weaken( "venom_weaken" ); static const efftype_id effect_webbed( "webbed" ); static const itype_id itype_corpse( "corpse" ); @@ -1289,6 +1291,8 @@ bool monster::is_immune_effect( const efftype_id &effect ) const if( effect == effect_paralyzepoison || effect == effect_badpoison || + effect == effect_venom_dmg || + effect == effect_venom_weaken || effect == effect_poison ) { <<<<<<< HEAD return type->in_species( species_ZOMBIE ) || From 1afe4a08b9a31693426c1c611ccd39d4891b4854 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Sat, 19 Dec 2020 18:37:35 +0100 Subject: [PATCH 19/22] Revert "Test" This reverts commit f2c01e5cdde6bf561bef41d02f6a68ad89ee1576. --- tests/creature_effect_test.cpp | 92 ++++++++++++---------------------- 1 file changed, 33 insertions(+), 59 deletions(-) diff --git a/tests/creature_effect_test.cpp b/tests/creature_effect_test.cpp index 86666dd6898a5..a760460ed1b5d 100644 --- a/tests/creature_effect_test.cpp +++ b/tests/creature_effect_test.cpp @@ -8,8 +8,6 @@ #include "mtype.h" #include "type_id.h" -static const species_id species_ZOMBIE( "ZOMBIE" ); - // Test effect methods from `Creature` class on both `monster` and `player` // Functions covered: @@ -354,52 +352,50 @@ TEST_CASE( "monster is_immune_effect", "[creature][monster][effect][immune]" ) const efftype_id effect_poison( "poison" ); const efftype_id effect_badpoison( "badpoison" ); const efftype_id effect_paralyzepoison( "paralyzepoison" ); - const efftype_id effect_venom_dmg( "venom_dmg" ); - const efftype_id effect_venom_weaken( "venom_weaken" ); // TODO: Monster may be immune to: // - onfire (if is_immune_damage DT_HEAT, made_of LIQUID, has_flag MF_FIREY) // - stunned (if has_flag MF_STUN_IMMUNE) - WHEN( "monster is made of flesh and is not zombified" ) { - // Cow - fleshy and alive - monster cow( mtype_id( "mon_cow" ) ); - cow.clear_effects(); - REQUIRE( cow.made_of_any( Creature::cmat_flesh ) ); - REQUIRE_FALSE( cow.type->in_species( species_ZOMBIE ) ); + WHEN( "monster is made of flesh and is warm-blooded" ) { + // Regular zombie - fleshy and warm + monster zed( mtype_id( "mon_zombie" ) ); + zed.clear_effects(); + REQUIRE( zed.made_of( material_id( "flesh" ) ) ); + REQUIRE( zed.has_flag( MF_WARM ) ); THEN( "they can bleed" ) { - CHECK_FALSE( cow.is_immune_effect( effect_bleed ) ); + CHECK_FALSE( zed.is_immune_effect( effect_bleed ) ); } THEN( "they can be poisoned" ) { - CHECK_FALSE( cow.is_immune_effect( effect_poison ) ); - CHECK_FALSE( cow.is_immune_effect( effect_badpoison ) ); - CHECK_FALSE( cow.is_immune_effect( effect_paralyzepoison ) ); - CHECK_FALSE( cow.is_immune_effect( effect_venom_dmg ) ); - CHECK_FALSE( cow.is_immune_effect( effect_venom_weaken ) ); + CHECK_FALSE( zed.is_immune_effect( effect_bleed ) ); + CHECK_FALSE( zed.is_immune_effect( effect_poison ) ); + CHECK_FALSE( zed.is_immune_effect( effect_badpoison ) ); + CHECK_FALSE( zed.is_immune_effect( effect_paralyzepoison ) ); } - } - WHEN( "monster is made of flesh but is zombified" ) { - // Zombie - fleshy zombie - monster zed( mtype_id( "mon_zombie" ) ); - zed.clear_effects(); - REQUIRE( zed.made_of_any( Creature::cmat_flesh ) ); - REQUIRE( zed.type->in_species( species_ZOMBIE ) ); - THEN( "they can bleed" ) { - CHECK_FALSE( zed.is_immune_effect( effect_bleed ) ); + WHEN( "monster is not not made of flesh and not warm-blooded" ) { + // Skeleton - no flesh, not warm-blooded + monster skelly( mtype_id( "mon_skeleton" ) ); + skelly.clear_effects(); + REQUIRE_FALSE( skelly.made_of( material_id( "flesh" ) ) ); + REQUIRE_FALSE( skelly.made_of( material_id( "iflesh" ) ) ); + REQUIRE_FALSE( skelly.has_flag( MF_WARM ) ); + + THEN( "they are immune to the bleed effect" ) { + CHECK( skelly.is_immune_effect( effect_bleed ) ); } - THEN( "they can't be poisoned" ) { - CHECK( zed.is_immune_effect( effect_poison ) ); - CHECK( zed.is_immune_effect( effect_badpoison ) ); - CHECK( zed.is_immune_effect( effect_paralyzepoison ) ); - CHECK( zed.is_immune_effect( effect_venom_dmg ) ); - CHECK( zed.is_immune_effect( effect_venom_weaken ) ); + + THEN( "they are immune to all poison effects" ) { + CHECK( skelly.is_immune_effect( effect_bleed ) ); + CHECK( skelly.is_immune_effect( effect_poison ) ); + CHECK( skelly.is_immune_effect( effect_badpoison ) ); + CHECK( skelly.is_immune_effect( effect_paralyzepoison ) ); } } - WHEN( "monster is made of flesh, but shouldn't bleed yet" ) { + WHEN( "monster is made of flesh, but not warm-blooded" ) { // Razorclaw - fleshy, with arthropod blood monster razorclaw( mtype_id( "mon_razorclaw" ) ); razorclaw.clear_effects(); @@ -410,33 +406,11 @@ TEST_CASE( "monster is_immune_effect", "[creature][monster][effect][immune]" ) CHECK( razorclaw.is_immune_effect( effect_bleed ) ); } - THEN( "they can be poisoned" ) { - CHECK_FALSE( razorclaw.is_immune_effect( effect_poison ) ); - CHECK_FALSE( razorclaw.is_immune_effect( effect_badpoison ) ); - CHECK_FALSE( razorclaw.is_immune_effect( effect_paralyzepoison ) ); - CHECK_FALSE( razorclaw.is_immune_effect( effect_venom_dmg ) ); - CHECK_FALSE( razorclaw.is_immune_effect( effect_venom_weaken ) ); - } - } - - WHEN( "monster is not made of flesh or iflesh" ) { - // Fungaloid - veggy - monster fungaloid( mtype_id( "mon_fungaloid" ) ); - fungaloid.clear_effects(); - REQUIRE_FALSE( fungaloid.made_of( material_id( "flesh" ) ) ); - REQUIRE_FALSE( fungaloid.made_of( material_id( "iflesh" ) ) ); - REQUIRE_FALSE( fungaloid.has_flag( MF_WARM ) ); - - THEN( "they are immune to the bleed effect" ) { - CHECK( fungaloid.is_immune_effect( effect_bleed ) ); - } - - THEN( "they can't be poisoned" ) { - CHECK( fungaloid.is_immune_effect( effect_poison ) ); - CHECK( fungaloid.is_immune_effect( effect_badpoison ) ); - CHECK( fungaloid.is_immune_effect( effect_paralyzepoison ) ); - CHECK( fungaloid.is_immune_effect( effect_venom_dmg ) ); - CHECK( fungaloid.is_immune_effect( effect_venom_weaken ) ); + THEN( "they are immune to all poison effects" ) { + CHECK( razorclaw.is_immune_effect( effect_bleed ) ); + CHECK( razorclaw.is_immune_effect( effect_poison ) ); + CHECK( razorclaw.is_immune_effect( effect_badpoison ) ); + CHECK( razorclaw.is_immune_effect( effect_paralyzepoison ) ); } } } From 2fbc45e1c7895d3bed1921ca7aca2cf9aee20aa4 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Sat, 19 Dec 2020 18:38:34 +0100 Subject: [PATCH 20/22] Update monster.cpp --- src/monster.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/monster.cpp b/src/monster.cpp index cc1a4ffa23399..390f5ef68b181 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1294,6 +1294,7 @@ bool monster::is_immune_effect( const efftype_id &effect ) const effect == effect_venom_dmg || effect == effect_venom_weaken || effect == effect_poison ) { +<<<<<<< HEAD <<<<<<< HEAD return type->in_species( species_ZOMBIE ) || !made_of_any( Creature::cmat_flesh ); @@ -1301,6 +1302,10 @@ bool monster::is_immune_effect( const efftype_id &effect ) const return !has_flag( MF_WARM ) || ( !made_of( material_id( "flesh" ) ) && !made_of( material_id( "iflesh" ) ) ); >>>>>>> parent of a33ddb8832... Actually make it work +======= + return type->in_species(species_ZOMBIE) || + !made_of_any( Creature::cmat_flesh); +>>>>>>> parent of b7820bd880... Astyle } if( effect == effect_stunned ) { From e3263e3c3175cb723159fbe5b2c5d549c99c48f7 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Sat, 19 Dec 2020 18:39:48 +0100 Subject: [PATCH 21/22] Update monster.cpp --- src/monster.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/monster.cpp b/src/monster.cpp index 390f5ef68b181..b360a36011f03 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1291,21 +1291,9 @@ bool monster::is_immune_effect( const efftype_id &effect ) const if( effect == effect_paralyzepoison || effect == effect_badpoison || - effect == effect_venom_dmg || - effect == effect_venom_weaken || effect == effect_poison ) { -<<<<<<< HEAD -<<<<<<< HEAD - return type->in_species( species_ZOMBIE ) || - !made_of_any( Creature::cmat_flesh ); -======= return !has_flag( MF_WARM ) || ( !made_of( material_id( "flesh" ) ) && !made_of( material_id( "iflesh" ) ) ); ->>>>>>> parent of a33ddb8832... Actually make it work -======= - return type->in_species(species_ZOMBIE) || - !made_of_any( Creature::cmat_flesh); ->>>>>>> parent of b7820bd880... Astyle } if( effect == effect_stunned ) { From d8d3f60c3e7f502f39f2ef033eabef0870430091 Mon Sep 17 00:00:00 2001 From: Venera3 <72006894+Venera3@users.noreply.github.com> Date: Sat, 19 Dec 2020 18:40:48 +0100 Subject: [PATCH 22/22] Update monster.cpp --- src/monster.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/monster.cpp b/src/monster.cpp index b360a36011f03..8fd559d401584 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -88,8 +88,6 @@ static const efftype_id effect_run( "run" ); static const efftype_id effect_stunned( "stunned" ); static const efftype_id effect_supercharged( "supercharged" ); static const efftype_id effect_tied( "tied" ); -static const efftype_id effect_venom_dmg( "venom_dmg" ); -static const efftype_id effect_venom_weaken( "venom_weaken" ); static const efftype_id effect_webbed( "webbed" ); static const itype_id itype_corpse( "corpse" );