Skip to content

Commit

Permalink
Remove itch from conjunctivitis and make it even shorter when irrigat…
Browse files Browse the repository at this point in the history
…ed (#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 <[email protected]>
Co-authored-by: Maleclypse <[email protected]>
  • Loading branch information
3 people authored Sep 30, 2024
1 parent 454846f commit 98a16af
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 22 deletions.
4 changes: 3 additions & 1 deletion data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 2 additions & 16 deletions data/json/effects_on_condition/effects_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
Expand Down
4 changes: 4 additions & 0 deletions data/json/obsoletion_and_migration_0.I/obsolete_eoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
{
"type": "effect_on_condition",
"id": "bile_unstink"
},
{
"type": "effect_on_condition",
"id": "eoc_conjunctivitis_itch"
}
]
4 changes: 2 additions & 2 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,9 @@ std::optional<int> 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;
Expand Down
4 changes: 2 additions & 2 deletions tests/iuse_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 );
}
}
}
Expand Down

0 comments on commit 98a16af

Please sign in to comment.