From 98a16af4e66967e61653020223d99bff5db6d0e6 Mon Sep 17 00:00:00 2001 From: Zachary Johnson Date: Sun, 29 Sep 2024 22:35:20 -0400 Subject: [PATCH] Remove itch from conjunctivitis and make it even shorter when irrigated (#75725) * Remove itch from chemical conjunctivitis * Remove itch from chemical conjunctivitis * Reduce minimum conjunctivitis duration * Reduce vision penalty of conjunctivitis and add duration cap * Lint effects.json * Change eyedrops test and code to reflect new minimum duration --------- Co-authored-by: zach.johnson Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com> --- data/json/effects.json | 4 +++- .../effects_on_condition/effects_eocs.json | 18 ++---------------- .../misc_effect_on_condition.json | 2 +- .../obsolete_eoc.json | 4 ++++ src/iuse.cpp | 4 ++-- tests/iuse_test.cpp | 4 ++-- 6 files changed, 14 insertions(+), 22 deletions(-) diff --git a/data/json/effects.json b/data/json/effects.json index 49c549b04354e..c0a73f9e408f2 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -2157,7 +2157,9 @@ "base_mods": { "per_mod": [ -1 ], "pain_min": [ 1 ], "pain_max_val": [ 4, 2 ], "pain_chance": [ 400, 1000 ] }, "limb_score_mods": [ { "limb_score": "vision", "modifier": 0.85, "resist_modifier": 0.95 } ], "miss_messages": [ [ "It feels like there's sand in your eye.", 1 ] ], - "flags": [ "EFFECT_LIMB_SCORE_MOD" ] + "flags": [ "EFFECT_LIMB_SCORE_MOD" ], + "max_duration": "7 days", + "dur_add_perc": 35 }, { "type": "effect_type", diff --git a/data/json/effects_on_condition/effects_eocs.json b/data/json/effects_on_condition/effects_eocs.json index d13499745be8b..5ae601d73bf7d 100644 --- a/data/json/effects_on_condition/effects_eocs.json +++ b/data/json/effects_on_condition/effects_eocs.json @@ -64,29 +64,15 @@ ], "false_effect": [ { "u_lose_morale": "morale_asocial_dissatisfied" } ] }, - { - "type": "effect_on_condition", - "id": "eoc_conjunctivitis_itch", - "recurrence": [ "10 minutes", "45 minutes" ], - "condition": { - "and": [ - { "u_has_effect": "conjunctivitis", "bodypart": "eyes" }, - { "not": { "u_has_effect": "formication" } }, - { "not": { "u_has_effect": "took_antihistamine" } }, - { "not": { "u_has_effect": "sleep" } } - ] - }, - "effect": [ { "u_add_effect": "formication", "duration": 300, "target_part": "head" } ] - }, { "type": "effect_on_condition", "id": "eoc_conjunctivitis_sting", - "recurrence": [ "10 minutes", "45 minutes" ], + "recurrence": [ "45 minutes", "120 minutes" ], "condition": { "and": [ { "u_has_effect": "conjunctivitis", "bodypart": "eyes" }, { "not": { "u_has_effect": "sleep" } } ] }, "effect": [ { "u_add_effect": "smoke_eyes", - "duration": 180, + "duration": 300, "intensity": { "math": [ "u_effect_intensity('smoke_eyes', 'bodypart': 'eyes') + 1" ] }, "target_part": "eyes" } diff --git a/data/json/effects_on_condition/misc_effect_on_condition.json b/data/json/effects_on_condition/misc_effect_on_condition.json index b56f83c2598f3..6fcb6fee6830e 100644 --- a/data/json/effects_on_condition/misc_effect_on_condition.json +++ b/data/json/effects_on_condition/misc_effect_on_condition.json @@ -243,7 +243,7 @@ }, { "u_add_effect": "conjunctivitis", - "duration": { "math": [ "( 1 - u_coverage('eyes') / 100 ) * rand(259200) + 172800" ] }, + "duration": { "math": [ "( 1 - u_coverage('eyes') / 100 ) * rand(345600) + 86400" ] }, "target_part": "eyes" } ] diff --git a/data/json/obsoletion_and_migration_0.I/obsolete_eoc.json b/data/json/obsoletion_and_migration_0.I/obsolete_eoc.json index cb980dbecf23b..d485c374d40b5 100644 --- a/data/json/obsoletion_and_migration_0.I/obsolete_eoc.json +++ b/data/json/obsoletion_and_migration_0.I/obsolete_eoc.json @@ -26,5 +26,9 @@ { "type": "effect_on_condition", "id": "bile_unstink" + }, + { + "type": "effect_on_condition", + "id": "eoc_conjunctivitis_itch" } ] diff --git a/src/iuse.cpp b/src/iuse.cpp index 09c2a04c196bf..1d53745072ebc 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -681,9 +681,9 @@ std::optional iuse::eyedrops( Character *p, item *it, const tripoint & ) } if( p->has_effect( effect_conjunctivitis, bodypart_id( "eyes" ) ) ) { effect &eff = p->get_effect( effect_conjunctivitis, bodypart_id( "eyes" ) ); - if( eff.get_duration() > 2_days ) { + if( eff.get_duration() > 1_days ) { p->add_msg_if_player( m_good, _( "You wash some of the chemical irritant from your eyes." ) ); - eff.set_duration( 2_days ); + eff.set_duration( 1_days ); } } return 1; diff --git a/tests/iuse_test.cpp b/tests/iuse_test.cpp index 943121ed8c92b..78d1861c8c93b 100644 --- a/tests/iuse_test.cpp +++ b/tests/iuse_test.cpp @@ -100,7 +100,7 @@ TEST_CASE( "eyedrops", "[iuse][eyedrops]" ) GIVEN( "avatar gets conjunctivitis" ) { dummy.add_effect( effect_conjunctivitis, 72_hours, bodypart_id( "eyes" ) ); REQUIRE( dummy.has_effect( effect_conjunctivitis, bodypart_id( "eyes" ) ) ); - REQUIRE( dummy.get_effect_dur( effect_conjunctivitis, bodypart_id( "eyes" ) ) > 48_hours ); + REQUIRE( dummy.get_effect_dur( effect_conjunctivitis, bodypart_id( "eyes" ) ) > 24_hours ); WHEN( "they use eye drops" ) { dummy.consume( eyedrops ); @@ -109,7 +109,7 @@ TEST_CASE( "eyedrops", "[iuse][eyedrops]" ) CHECK( eyedrops.charges == charges_before - 1 ); AND_THEN( "it shortens the duration of conjunctivitis" ) { - CHECK( dummy.get_effect_dur( effect_conjunctivitis, bodypart_id( "eyes" ) ) <= 48_hours ); + CHECK( dummy.get_effect_dur( effect_conjunctivitis, bodypart_id( "eyes" ) ) <= 24_hours ); } } }