Skip to content

Commit

Permalink
Add persistent boomer bile effect that causes a stench and skin irrit…
Browse files Browse the repository at this point in the history
…ation (#74920)

* Add bile effect

* Add EOC_boomer_bile_affliction

* Adjust resistances

* Add morale_bile

* Add morale effect to EOC_boomer_bile_affliction

* Add new scent sc_bile

* Split bile effect into bile_stink and bile_irritant

* Remove vomiting from boomered and add more resist_traits to bile_stink

* Update EOC_boomer_bile_affliction to reflect split of bile effect

* Allow towel to wipe off bile

* Add `bile_irritant` to `effects_description_for_creature`

* Allow swimming to remove bile from the skin

* Add bile_irritant to towel test

* Give resistance to bile morale impact with certain traits

* Apply suggestions from code review

Co-authored-by: Kevin Granade <[email protected]>

* Remove social modifiers from bile_stink and add intimidate to bile_irritant

* Remove intimidation bonus from bile_irritant

* Fix misc_effect_on_condition.json merge conflict

* Tweak effect values

* Change health mods to daily health mods

* Add bite effect duration scaling

* Add decay messages

* Fix towel test

* Make being covered in bile not a happy occasion

* Fix IRRITANT_IMMUNE check

* Reorder effects

* Fix cringe merge conflicts

* Update data/json/effects.json

* Update data/json/effects.json

---------

Co-authored-by: Kevin Granade <[email protected]>
Co-authored-by: Maleclypse <[email protected]>
  • Loading branch information
3 people authored Jul 23, 2024
1 parent eede056 commit aa5d1b1
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 5 deletions.
42 changes: 41 additions & 1 deletion data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@
"desc": [ "Your vision is obscured by a disgusting splatter of bile." ],
"apply_message": "You're covered in bile!",
"rating": "bad",
"base_mods": { "per_mod": [ -3 ], "vomit_chance": [ 500 ] },
"base_mods": { "per_mod": [ -3 ] },
"max_duration": "30 s",
"limb_score_mods": [
{ "limb_score": "vision", "modifier": 0.1 },
Expand All @@ -2077,6 +2077,45 @@
"rating": "bad",
"base_mods": { "vomit_chance": [ 500 ] }
},
{
"type": "effect_type",
"id": "bile_stink",
"name": [ "Bile Stink" ],
"desc": [ "You're splattered with a greasy layer of liquified putrescence." ],
"apply_message": "You're covered in a foul smelling fluid!",
"decay_messages": [ [ "The rancid smell of corpse bile finally goes away.", "good" ] ],
"rating": "bad",
"resist_traits": [ "SAPROVORE", "EATDEAD" ],
"base_mods": { "vomit_chance": [ 500, 2000 ] },
"enchantments": [ { "values": [ { "value": "SCENT_MASK", "add": 500 } ] } ],
"limb_score_mods": [ { "limb_score": "breathing", "modifier": 0.95, "resist_modifier": 1 } ],
"flags": [ "EFFECT_LIMB_SCORE_MOD" ],
"max_duration": "60 m",
"show_in_info": true
},
{
"type": "effect_type",
"id": "bile_irritant",
"name": [ "Bile Irritant" ],
"desc": [ "Acidic boomer bile is irritating your skin." ],
"decay_messages": [ [ "Your skin irritation stops.", "good" ] ],
"rating": "bad",
"resist_traits": [ "POISRESIST" ],
"resist_effects": [ "wet" ],
"immune_flags": [ "ACID_IMMUNE", "IRRITANT_IMMUNE" ],
"base_mods": {
"pain_amount": [ 1 ],
"pain_min": [ 1 ],
"pain_max_val": [ 4, 2 ],
"pain_chance": [ 150, 300 ],
"h_mod_min": [ -1 ],
"h_mod_chance": [ 1 ],
"h_mod_chance_bot": [ 120, 360 ],
"int_mod": [ -1, 0 ]
},
"effect_dur_scaling": [ { "effect_id": "bite", "modifier": 1.5, "same_bp": false } ],
"max_duration": "15 m"
},
{
"type": "effect_type",
"id": "skunk_spray",
Expand All @@ -2103,6 +2142,7 @@
"name": [ "Conjunctivitis" ],
"desc": [ "Your eyes are inflamed." ],
"apply_message": "The chemical irritant damaged your eyes!",
"decay_messages": [ [ "The irritation in your eyes stops.", "good" ] ],
"rating": "bad",
"resist_traits": [ "POISRESIST", "PER_SLIME_OK" ],
"immune_flags": [ "POISIMMUNE", "SEESLEEP" ],
Expand Down
49 changes: 49 additions & 0 deletions data/json/effects_on_condition/misc_effect_on_condition.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,55 @@
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_boomer_bile_affliction",
"eoc_type": "EVENT",
"required_event": "character_gains_effect",
"condition": { "and": [ { "compare_string": [ "boomered", { "context_val": "effect" } ] } ] },
"effect": [
{
"math": [ "BILE_STINK_DURATION", "=", "u_effect_duration('bile_stink') > 0 ? u_effect_duration('bile_stink') + 300 : 600" ]
},
{ "math": [ "MORALE_MULTIPLIER", "=", "u_has_trait('SQUEAMISH') ? -2 : -1" ] },
{ "u_add_effect": "bile_stink", "duration": { "global_val": "BILE_STINK_DURATION" } },
{
"if": { "not": { "or": [ { "u_has_flag": "IRRITANT_IMMUNE" }, { "u_has_worn_with_flag": "IRRITANT_IMMUNE" } ] } },
"then": [
{
"math": [
"BILE_IRRITANT_DURATION",
"=",
"u_effect_duration('bile_irritant') > 0 ? u_effect_duration('bile_irritant') + 120 + rand(90) : 240 + rand(180)"
]
},
{ "math": [ "MORALE_MULTIPLIER", "*=", "u_has_trait('SQUEAMISH') ? 4 : 2" ] },
{ "u_add_effect": "bile_irritant", "duration": { "global_val": "BILE_IRRITANT_DURATION" } }
]
},
{
"if": { "not": { "u_has_any_trait": [ "SAPROVORE", "EATDEAD", "THRESH_SLIME" ] } },
"then": [
{
"u_add_morale": "morale_bile",
"bonus": { "math": [ "MORALE_MULTIPLIER * 3" ] },
"max_bonus": { "math": [ "MORALE_MULTIPLIER * 6" ] },
"duration": { "global_val": "BILE_STINK_DURATION" },
"decay_start": { "math": [ "BILE_STINK_DURATION / 2" ] }
}
],
"else": [
{
"u_add_morale": "morale_bile",
"bonus": { "math": [ "MORALE_MULTIPLIER" ] },
"max_bonus": { "math": [ "MORALE_MULTIPLIER * 2" ] },
"duration": { "global_val": "BILE_STINK_DURATION / 2" },
"decay_start": { "math": [ "BILE_STINK_DURATION / 4" ] }
}
]
}
]
},
{
"type": "effect_on_condition",
"id": "sunrise_morale_buff",
Expand Down
5 changes: 5 additions & 0 deletions data/json/morale_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@
"type": "morale_type",
"text": "Spent time alone"
},
{
"id": "morale_bile",
"type": "morale_type",
"text": "Covered in bile"
},
{
"id": "morale_sunrise",
"type": "morale_type",
Expand Down
26 changes: 26 additions & 0 deletions data/json/scent_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,31 @@
"HUMAN",
"UNKNOWN"
]
},
{
"type": "scent_type",
"id": "sc_bile",
"receptive_species": [
"MAMMAL",
"BIRD",
"AMPHIBIAN",
"REPTILE",
"FISH",
"MUTANT",
"NETHER",
"SLIME",
"FUNGUS",
"INSECT",
"CENTIPEDE",
"SPIDER",
"PLANT",
"MOLLUSK",
"WORM",
"HORROR",
"ABERRATION",
"HALLUCINATION",
"HUMAN",
"UNKNOWN"
]
}
]
5 changes: 5 additions & 0 deletions src/avatar_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include "vpart_position.h"

static const efftype_id effect_amigara( "amigara" );
static const efftype_id effect_bile_irritant( "bile_irritant" );
static const efftype_id effect_glowing( "glowing" );
static const efftype_id effect_harnessed( "harnessed" );
static const efftype_id effect_hunger_engorged( "hunger_engorged" );
Expand Down Expand Up @@ -643,6 +644,10 @@ void avatar_action::swim( map &m, avatar &you, const tripoint &p )
add_msg( _( "The water washes off the glowing goo!" ) );
you.remove_effect( effect_glowing );
}
if( you.has_effect( effect_bile_irritant ) ) {
add_msg( _( "The water washes off the acidic bile!" ) );
you.remove_effect( effect_bile_irritant );
}

g->water_affect_items( you );

Expand Down
10 changes: 7 additions & 3 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ static const efftype_id effect_antibiotic_visible( "antibiotic_visible" );
static const efftype_id effect_antifungal( "antifungal" );
static const efftype_id effect_asthma( "asthma" );
static const efftype_id effect_beartrap( "beartrap" );
static const efftype_id effect_bile_irritant( "bile_irritant" );
static const efftype_id effect_bleed( "bleed" );
static const efftype_id effect_blind( "blind" );
static const efftype_id effect_blood_spiders( "blood_spiders" );
Expand Down Expand Up @@ -4958,7 +4959,8 @@ int iuse::towel_common( Character *p, item *it, bool )
bool slime = p->has_effect( effect_slimed );
bool boom = p->has_effect( effect_boomered );
bool glow = p->has_effect( effect_glowing );
int mult = slime + boom + glow; // cleaning off more than one at once makes it take longer
bool bile = p->has_effect( effect_bile_irritant );
int mult = slime + boom + glow + bile; // cleaning off more than one at once makes it take longer
bool towelUsed = false;
const std::string name = it ? it->tname() : _( "towel" );

Expand All @@ -4970,10 +4972,11 @@ int iuse::towel_common( Character *p, item *it, bool )
p->add_msg_if_player( m_info, _( "That %s is too wet to soak up any more liquid!" ),
it->tname() );
// clean off the messes first, more important
} else if( slime || boom || glow ) {
} else if( slime || boom || glow || bile ) {
p->remove_effect( effect_slimed ); // able to clean off all at once
p->remove_effect( effect_boomered );
p->remove_effect( effect_glowing );
p->remove_effect( effect_bile_irritant );
p->add_msg_if_player( _( "You use the %s to clean yourself off, saturating it with slime!" ),
name );

Expand Down Expand Up @@ -5881,9 +5884,10 @@ static std::string effects_description_for_creature( Creature *const creature, s
{ effect_beartrap, ef_con( to_translation( " is stuck in beartrap. " ) ) },
// NOLINTNEXTLINE(cata-text-style): spaces required for concatenation
{ effect_laserlocked, ef_con( to_translation( " have tiny <color_red>red dot</color> on body. " ) ) },
{ effect_boomered, ef_con( to_translation( " is covered in <color_magenta>bile</color>. " ) ) },
{ effect_boomered, ef_con( to_translation( " has <color_magenta>bile</color> covering their eyes. " ) ) },

Check failure on line 5887 in src/iuse.cpp

View workflow job for this annotation

GitHub Actions / build (src)

unnecessary spaces at end of string. [cata-text-style,-warnings-as-errors]
{ effect_glowing, ef_con( to_translation( " is covered in <color_yellow>glowing goo</color>. " ) ) },
{ effect_slimed, ef_con( to_translation( " is covered in <color_green>thick goo</color>. " ) ) },
{ effect_bile_irritant, ef_con( to_translation( " is covered in <color_magenta>bile</color>. " ) ) },
{ effect_corroding, ef_con( to_translation( " is covered in <color_light_green>acid</color>. " ) ) },
{ effect_sap, ef_con( to_translation( " is coated in <color_brown>sap</color>. " ) ) },
{ effect_webbed, ef_con( to_translation( " is covered in <color_dark_gray>webs</color>. " ) ) },
Expand Down
6 changes: 5 additions & 1 deletion tests/iuse_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

static const efftype_id effect_antifungal( "antifungal" );
static const efftype_id effect_asthma( "asthma" );
static const efftype_id effect_bile_irritant( "bile_irritant" );
static const efftype_id effect_bloodworms( "bloodworms" );
static const efftype_id effect_boomered( "boomered" );
static const efftype_id effect_brainworms( "brainworms" );
Expand Down Expand Up @@ -491,13 +492,15 @@ TEST_CASE( "towel", "[iuse][towel]" )
}
}

GIVEN( "avatar is slimed, boomered, and glowing" ) {
GIVEN( "avatar is slimed, boomered, glowing, and bile irritated." ) {
dummy.add_effect( effect_slimed, 1_hours );
dummy.add_effect( effect_boomered, 1_hours );
dummy.add_effect( effect_glowing, 1_hours );
dummy.add_effect( effect_bile_irritant, 1_hours );
REQUIRE( dummy.has_effect( effect_slimed ) );
REQUIRE( dummy.has_effect( effect_boomered ) );
REQUIRE( dummy.has_effect( effect_glowing ) );
REQUIRE( dummy.has_effect( effect_bile_irritant ) );

WHEN( "they use a dry towel" ) {
REQUIRE_FALSE( towel.has_flag( flag_WET ) );
Expand All @@ -507,6 +510,7 @@ TEST_CASE( "towel", "[iuse][towel]" )
CHECK_FALSE( dummy.has_effect( effect_slimed ) );
CHECK_FALSE( dummy.has_effect( effect_boomered ) );
CHECK_FALSE( dummy.has_effect( effect_glowing ) );
CHECK_FALSE( dummy.has_effect( effect_bile_irritant ) );

AND_THEN( "the towel becomes filthy" ) {
CHECK( towel.is_filthy() );
Expand Down

0 comments on commit aa5d1b1

Please sign in to comment.