Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boomers Actually Do Something #69410

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6cc7f68
Boomers don't suck
worm-girl Nov 15, 2023
8689a48
Update data/json/effects.json
worm-girl Nov 15, 2023
c2fd7b4
Update data/json/effects.json
worm-girl Nov 15, 2023
d9b8ecc
Update data/json/effects.json
worm-girl Nov 15, 2023
adf9156
Update data/json/effects.json
worm-girl Nov 15, 2023
6f8525f
Update src/character.cpp
worm-girl Nov 15, 2023
350d62d
Update src/character.cpp
worm-girl Nov 15, 2023
cc2ef61
Update src/character.cpp
worm-girl Nov 15, 2023
28e4cde
Update src/character.cpp
worm-girl Nov 15, 2023
5b636ea
Update src/character.cpp
worm-girl Nov 15, 2023
4185ff6
Update character.cpp
worm-girl Nov 16, 2023
cbffa1e
Update src/character.cpp
worm-girl Nov 17, 2023
14d7cab
slip on slime lol
worm-girl Nov 18, 2023
ae2f3bf
Merge branch 'boomerbuff' of https://github.com/fairyarmadillo/Catacl…
worm-girl Nov 18, 2023
75dd01a
remove old stuff
worm-girl Nov 18, 2023
32ed56b
Update field_type.json
worm-girl Nov 18, 2023
3f38b72
bugs
worm-girl Nov 18, 2023
481f8fa
monsters can slip
worm-girl Nov 18, 2023
92882ce
Update character.cpp
worm-girl Nov 18, 2023
9c5d0be
balance fix
worm-girl Nov 18, 2023
9534696
Liquid attacks
worm-girl Nov 18, 2023
723afb1
stick to strength
worm-girl Nov 18, 2023
26e58fa
more fixes
worm-girl Nov 18, 2023
963444d
liquids can't pass through airtight suits
worm-girl Nov 18, 2023
4b52b54
Update character_body.cpp
worm-girl Nov 18, 2023
d0fa661
Update character.cpp
worm-girl Nov 19, 2023
c8e5f86
Eyewear update
worm-girl Nov 19, 2023
f241f1e
bugfixin
worm-girl Nov 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 79 additions & 2 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -2643,8 +2643,9 @@
"id": "formication",
"name": [ "Itchy Skin", "Writhing Skin", "Bugs in Skin" ],
"desc": [ "You stop to scratch yourself frequently; high INT helps you resist the urge." ],
"apply_message": "Your skin feels extremely itchy!",
"apply_message": "You feel extremely itchy!",
"rating": "bad",
"resist_effects": [ "took_flumed", "took_antihistamine" ],
"main_parts_only": true,
"max_intensity": 3,
"base_mods": { "str_mod": [ -0.34 ], "int_mod": [ -1 ] },
Expand Down Expand Up @@ -2795,6 +2796,72 @@
"max_duration": 14515200,
"dur_add_perc": 50
},
{
"//": "For player, indistinguishable from pre_conjunctivitis_bacterial, but separate here to allow for separate resistances from antibiotics.",
"type": "effect_type",
"id": "pre_conjunctivitis_viral",
"show_in_info": false,
"blood_analysis_description": "Viral Infection",
"max_duration": "71 h"
},
{
"//": "For player, indistinguishable from pre_conjunctivitis_viral, but separate here to allow for separate resistances from antibiotics.",
"type": "effect_type",
"id": "pre_conjunctivitis_bacterial",
"show_in_info": false,
"blood_analysis_description": "Bacterial Infection",
"max_duration": "71 h"
},
{
"//": "For player, indistinguishable from conjunctivitis_bacterial, but separate here to allow for separate resistances from antibiotics.",
"type": "effect_type",
"id": "conjunctivitis_viral",
"name": [ "Conjunctivitis" ],
"desc": [
"Commonly known as pinkeye, this minor infection can be treated with antihistamines. If it's bacterial, antibiotics may help, but you can't tell without a lab analysis."
],
"apply_memorial_log": "Got pinkeye.",
"remove_memorial_log": "Got over a pinkeye infection.",
"apply_message": "Your eye leaks a filmy discharge.",
"rating": "bad",
"resist_effects": [ "took_antihistamine", "took_flumed" ],
"resist_traits": [ "INFRESIST", "PER_SLIME_OK" ],
"immune_flags": [ "NO_DISEASE", "SEESLEEP" ],
"int_dur_factor": "50 m",
"base_mods": { "per_mod": [ -2 ], "pain_min": [ 1 ], "pain_chance": [ 400, 1000 ] },
"limb_score_mods": [
{ "limb_score": "vision", "modifier": 0.8, "resist_modifier": 0.9 },
{ "limb_score": "night_vis", "modifier": 0.8, "resist_modifier": 0.9 }
],
"miss_messages": [ [ "It feels like there's sand in your eye.", 1 ] ],
"flags": [ "EFFECT_LIMB_SCORE_MOD" ],
"blood_analysis_description": "Viral Infection"
},
{
"//": "For player, indistinguishable from conjunctivitis_bacterial, but separate here to allow for separate resistances from antibiotics.",
"type": "effect_type",
"id": "conjunctivitis_bacterial",
"name": [ "Conjunctivitis" ],
"desc": [
"Commonly known as pinkeye, this minor infection can be treated with antihistamines. If it's bacterial, antibiotics may help, but you can't tell without a lab analysis."
],
"apply_memorial_log": "Got pinkeye.",
"remove_memorial_log": "Got over a pinkeye infection.",
"apply_message": "Your eye leaks a filmy discharge.",
"rating": "bad",
"resist_effects": [ "took_antihistamine", "took_flumed" ],
"resist_traits": [ "INFRESIST", "PER_SLIME_OK" ],
"immune_flags": [ "NO_DISEASE", "SEESLEEP" ],
"int_dur_factor": "50 m",
"base_mods": { "per_mod": [ -2 ], "pain_min": [ 1 ], "pain_chance": [ 400, 1000 ] },
"miss_messages": [ [ "It feels like there's sand in your eye.", 1 ] ],
"limb_score_mods": [
{ "limb_score": "vision", "modifier": 0.8, "resist_modifier": 0.9 },
{ "limb_score": "night_vis", "modifier": 0.8, "resist_modifier": 0.9 }
],
"flags": [ "EFFECT_LIMB_SCORE_MOD" ],
"blood_analysis_description": "Bacterial Infection"
},
{
"type": "effect_type",
"id": "prophylactic_antivenom",
Expand All @@ -2812,6 +2879,14 @@
"max_duration": 86400,
"blood_analysis_description": "Antiasthmatics"
},
{
"type": "effect_type",
"id": "took_antihistamine",
"name": [ "Took Antihistamine Drugs" ],
"desc": [ "You have taken an antihistamine drug recently." ],
"rating": "good",
"blood_analysis_description": "Antihistamines"
},
{
"type": "effect_type",
"id": "cureall",
Expand All @@ -2835,7 +2910,9 @@
"infected",
"asthma",
"common_cold",
"flu"
"flu",
"conjunctivitis_viral",
"conjunctivitis_bacterial"
],
"base_mods": { "pkill_min": [ 5 ] }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,29 @@
{
"type": "effect_on_condition",
"id": "EOC_RASHY_SKIN",
"recurrence": [ "2 hour", "24 hours" ],
"recurrence": [ "2 hours", "24 hours" ],
"condition": { "and": [ { "u_has_trait": "SKIN_RASHY" }, { "not": { "u_has_effect": "formication" } } ] },
"effect": [ { "u_add_effect": "formication", "duration": "10 minutes", "target_part": "random" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_PRE_CONJUNCTIVITIS_VIRAL",
"recurrence": [ "24 hours", "72 hours" ],
"condition": { "and": [ { "u_has_effect": "pre_conjunctivitis_viral" }, { "not": { "u_has_effect": "conjunctivitis_bacterial" } }, { "not": { "u_has_effect": "conjunctivitis_viral" } }, { "not": { "u_has_trait": "SEESLEEP" } }, { "not": { "u_has_bionics": "armor_bio_eyes" } } ] },
"effect": [ { "u_add_effect": "conjunctivitis_viral", "duration": { "math": [ "rand(259200) + 432000" ] }, "target_part": "eyes" }, { "u_lose_effect": "pre_conjunctivitis_bacterial" }, { "u_lose_effect": "pre_conjunctivitis_viral" } ]
worm-girl marked this conversation as resolved.
Show resolved Hide resolved
},
{
"type": "effect_on_condition",
"id": "EOC_PRE_CONJUNCTIVITIS_BACTERIAL",
"recurrence": [ "24 hours", "72 hours" ],
"condition": { "and": [ { "u_has_effect": "pre_conjunctivitis_bacterial" }, { "not": { "u_has_effect": "conjunctivitis_bacterial" } }, { "not": { "u_has_effect": "conjunctivitis_viral" } }, { "not": { "u_has_trait": "SEESLEEP" } }, { "not": { "u_has_bionics": "armor_bio_eyes" } } ] },
"effect": [ { "u_add_effect": "conjunctivitis_bacterial", "duration": { "math": [ "rand(259200) + 432000" ] }, "target_part": "eyes" }, { "u_lose_effect": "pre_conjunctivitis_viral" }, { "u_lose_effect": "pre_conjunctivitis_bacterial" } ]
Comment on lines +244 to +245
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JSON & C++ formatters] reported by reviewdog 🐶

Suggested change
"condition": { "and": [ { "u_has_effect": "pre_conjunctivitis_bacterial" }, { "not": { "u_has_effect": "conjunctivitis_bacterial" } }, { "not": { "u_has_effect": "conjunctivitis_viral" } }, { "not": { "u_has_trait": "SEESLEEP" } }, { "not": { "u_has_bionics": "armor_bio_eyes" } } ] },
"effect": [ { "u_add_effect": "conjunctivitis_bacterial", "duration": { "math": [ "rand(259200) + 432000" ] }, "target_part": "eyes" }, { "u_lose_effect": "pre_conjunctivitis_viral" }, { "u_lose_effect": "pre_conjunctivitis_bacterial" } ]
"condition": {
"and": [
{ "u_has_effect": "pre_conjunctivitis_bacterial" },
{ "not": { "u_has_effect": "conjunctivitis_bacterial" } },
{ "not": { "u_has_effect": "conjunctivitis_viral" } },
{ "not": { "u_has_trait": "SEESLEEP" } },
{ "not": { "u_has_bionics": "armor_bio_eyes" } }
]
},
"effect": [
{
"u_add_effect": "conjunctivitis_bacterial",
"duration": { "math": [ "rand(259200) + 432000" ] },
"target_part": "eyes"
},
{ "u_lose_effect": "pre_conjunctivitis_viral" },
{ "u_lose_effect": "pre_conjunctivitis_bacterial" }
]

},
{
"type": "effect_on_condition",
"id": "EOC_CONJUNCTIVITIS",
"recurrence": [ "10 minutes", "45 minutes" ],
"condition": { "and": [ { "or": [ { "u_has_effect": "conjunctivitis_viral" }, { "u_has_effect": "conjunctivitis_bacterial" } ] }, { "not": { "u_has_effect": "formication" } }, { "not": { "u_has_effect": "took_antihistamine" } }, { "not": { "u_has_effect": "sleep" } } ] },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JSON & C++ formatters] reported by reviewdog 🐶

Suggested change
"condition": { "and": [ { "or": [ { "u_has_effect": "conjunctivitis_viral" }, { "u_has_effect": "conjunctivitis_bacterial" } ] }, { "not": { "u_has_effect": "formication" } }, { "not": { "u_has_effect": "took_antihistamine" } }, { "not": { "u_has_effect": "sleep" } } ] },
"condition": {
"and": [
{ "or": [ { "u_has_effect": "conjunctivitis_viral" }, { "u_has_effect": "conjunctivitis_bacterial" } ] },
{ "not": { "u_has_effect": "formication" } },
{ "not": { "u_has_effect": "took_antihistamine" } },
{ "not": { "u_has_effect": "sleep" } }
]
},

"effect": [ { "u_add_effect": "formication", "duration": "5 minutes", "target_part": "head" } ]
}
]
2 changes: 2 additions & 0 deletions data/json/field_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"is_splattering": true,
"half_life": "1 days",
"phase": "liquid",
"slippery": true,
"accelerated_decay": true,
"display_field": true,
"looks_like": "fd_acid"
Expand Down Expand Up @@ -186,6 +187,7 @@
"is_splattering": true,
"half_life": "1 days",
"phase": "liquid",
"slippery": true,
"accelerated_decay": true,
"display_field": true,
"looks_like": "fd_blood_veggy"
Expand Down
8 changes: 8 additions & 0 deletions data/json/itemgroups/Drugs_Tobacco_Alcohol/drugs.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
{ "prob": 25, "group": "caffeine_bottle_plastic_pill_supplement_1_10" },
{ "prob": 15, "group": "pills_sleep_bottle_plastic_pill_prescription_1_10" },
{ "prob": 10, "group": "melatonin_tablet_bottle_plastic_pill_supplement_1_30" },
{ "prob": 15, "group": "antihistamine_bottle_plastic_pill_supplement_1_30" },
{ "prob": 5, "group": "iodine_bottle_plastic_pill_supplement_1_10" },
{ "prob": 5, "group": "prussian_blue_bottle_plastic_pill_supplement_1_10" },
{ "item": "dayquil", "prob": 70, "charges": [ 1, 5 ] },
Expand Down Expand Up @@ -585,6 +586,13 @@
"container-item": "bottle_plastic_pill_prescription",
"entries": [ { "item": "melatonin_tablet", "container-item": "null", "count": 30 } ]
},
{
"type": "item_group",
"id": "antihistamine_bottle_full",
"subtype": "collection",
"container-item": "bottle_plastic_pill_prescription",
"entries": [ { "item": "antihistamine", "container-item": "null", "count": 30 } ]
},
{
"type": "item_group",
"id": "protein_bottle_full",
Expand Down
8 changes: 8 additions & 0 deletions data/json/itemgroups/collections_domestic.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
[ "holy_symbol", 5 ],
[ "pills_sleep", 5 ],
{ "prob": 3, "group": "melatonin_tablet_bottle_plastic_pill_supplement_1_30" },
{ "prob": 5, "group": "antihistamine_bottle_plastic_pill_supplement_1_30" },
{ "item": "nyquil", "prob": 5, "charges": [ 1, 5 ] },
{ "group": "mansion_guns", "prob": 3 },
{ "group": "harddrugs", "prob": 1 },
Expand Down Expand Up @@ -1491,6 +1492,13 @@
"container-item": "bottle_plastic_pill_supplement",
"entries": [ { "item": "melatonin_tablet", "container-item": "null", "count": [ 1, 30 ] } ]
},
{
"type": "item_group",
"id": "antihistamine_bottle_plastic_pill_supplement_1_30",
"subtype": "collection",
"container-item": "bottle_plastic_pill_supplement",
"entries": [ { "item": "antihistamine", "container-item": "null", "count": [ 1, 30 ] } ]
},
{
"type": "item_group",
"id": "coke_bag_zipper_1_8",
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/stashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"id": "stash_drugs",
"items": [
{ "prob": 15, "group": "pills_sleep_bottle_plastic_pill_prescription_1_10" },
{ "prob": 10, "group": "antihistamine_bottle_plastic_pill_supplement_1_30" },
{ "prob": 5, "group": "melatonin_tablet_bottle_plastic_pill_supplement_1_30" },
{ "prob": 4, "group": "oxycodone_bottle_plastic_pill_prescription_1_10" },
{ "item": "morphine", "prob": 4, "count": [ 1, 4 ] },
Expand Down
24 changes: 24 additions & 0 deletions data/json/items/comestibles/med.json
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,30 @@
"addiction_type": "sleeping pill",
"use_action": [ "FLUSLEEP" ]
},
{
"id": "antihistamine",
"type": "COMESTIBLE",
"comestible_type": "MED",
"name": { "str_sp": "antihistamine pill" },
"description": "Over-the-counter allergy medication. The label advises taking one a day and warns that they can cause drowsiness.",
"//": "Flu meds contain antihistamines among other things, so it's intended that there's some overlap between this and cough syrup.",
"weight": "1 g",
"volume": "1 ml",
"price": "25 cent",
"price_postapoc": "25 cent",
"symbol": "!",
"color": "light_red",
"container": "bottle_plastic_pill_supplement",
"stim": -6,
"flags": [ "IRREPLACEABLE_CONSUMABLE" ],
"addiction_potential": 4,
"addiction_type": "sleeping pill",
"use_action": {
"type": "consume_drug",
"activation_message": "You take an antihistamine pill.",
"effects": [ { "id": "took_antihistamine", "duration": "10 h" } ]
}
},
{
"id": "oxycodone",
"type": "COMESTIBLE",
Expand Down
6 changes: 6 additions & 0 deletions src/avatar_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
class gun_mode;

static const efftype_id effect_amigara( "amigara" );
static const efftype_id effect_downed( "downed" );

Check failure on line 63 in src/avatar_action.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Variable 'effect_downed' declared but not used. [cata-unused-statics,-warnings-as-errors]
static const efftype_id effect_glowing( "glowing" );
static const efftype_id effect_harnessed( "harnessed" );
static const efftype_id effect_hunger_engorged( "hunger_engorged" );
Expand All @@ -79,7 +80,12 @@

static const skill_id skill_swimming( "swimming" );

static const trait_id trait_AQUEOUS( "AQUEOUS" );

Check failure on line 83 in src/avatar_action.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Variable 'trait_AQUEOUS' declared but not used. [cata-unused-statics,-warnings-as-errors]
static const trait_id trait_CLUMSY( "CLUMSY" );

Check failure on line 84 in src/avatar_action.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Variable 'trait_CLUMSY' declared but not used. [cata-unused-statics,-warnings-as-errors]
static const trait_id trait_DEFT( "DEFT" );

Check failure on line 85 in src/avatar_action.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Variable 'trait_DEFT' declared but not used. [cata-unused-statics,-warnings-as-errors]
static const trait_id trait_GASTROPOD_BALANCE( "GASTROPOD_BALANCE" );

Check failure on line 86 in src/avatar_action.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Variable 'trait_GASTROPOD_BALANCE' declared but not used. [cata-unused-statics,-warnings-as-errors]
static const trait_id trait_GRAZER( "GRAZER" );
static const trait_id trait_PROF_SKATER( "PROF_SKATER" );

Check failure on line 88 in src/avatar_action.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Variable 'trait_PROF_SKATER' declared but not used. [cata-unused-statics,-warnings-as-errors]
static const trait_id trait_RUMINANT( "RUMINANT" );
static const trait_id trait_SHELL2( "SHELL2" );
static const trait_id trait_SHELL3( "SHELL3" );
Expand Down
42 changes: 38 additions & 4 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

struct dealt_projectile_attack;

static const activity_id ACT_ADV_INVENTORY( "ACT_ADV_INVENTORY" );

Check failure on line 128 in src/character.cpp

View workflow job for this annotation

GitHub Actions / build (src)

string_id declarations should be sorted. [cata-static-string_id-constants,-warnings-as-errors]
static const activity_id ACT_AUTODRIVE( "ACT_AUTODRIVE" );
static const activity_id ACT_CONSUME_DRINK_MENU( "ACT_CONSUME_DRINK_MENU" );
static const activity_id ACT_CONSUME_FOOD_MENU( "ACT_CONSUME_FOOD_MENU" );
Expand Down Expand Up @@ -256,6 +256,10 @@
static const efftype_id effect_pkill1( "pkill1" );
static const efftype_id effect_pkill2( "pkill2" );
static const efftype_id effect_pkill3( "pkill3" );
static const efftype_id effect_pre_conjunctivitis_viral( "pre_conjunctivitis_viral" );
static const efftype_id effect_pre_conjunctivitis_bacterial( "pre_conjunctivitis_bacterial" );
static const efftype_id effect_conjunctivitis_viral( "conjunctivitis_viral" );
static const efftype_id effect_conjunctivitis_bacterial( "conjunctivitis_bacterial" );
static const efftype_id effect_recently_coughed( "recently_coughed" );
static const efftype_id effect_recover( "recover" );
static const efftype_id effect_ridden( "ridden" );
Expand Down Expand Up @@ -309,7 +313,7 @@
static const json_character_flag json_flag_INFECTION_IMMUNE( "INFECTION_IMMUNE" );
static const json_character_flag json_flag_INFRARED( "INFRARED" );
static const json_character_flag json_flag_INSECTBLOOD( "INSECTBLOOD" );
static const json_character_flag json_flag_INVERTERBRATEBLOOD( "INVERTERBRATEBLOOD" );
static const json_character_flag json_flag_INVERTEBRATEBLOOD( "INVERTEBRATEBLOOD" );
static const json_character_flag json_flag_INVISIBLE( "INVISIBLE" );
static const json_character_flag json_flag_MYOPIC( "MYOPIC" );
static const json_character_flag json_flag_MYOPIC_IN_LIGHT( "MYOPIC_IN_LIGHT" );
Expand Down Expand Up @@ -431,6 +435,7 @@
static const trait_id trait_HEAVYSLEEPER2( "HEAVYSLEEPER2" );
static const trait_id trait_HIBERNATE( "HIBERNATE" );
static const trait_id trait_ILLITERATE( "ILLITERATE" );
static const trait_id trait_INFRESIST( "INFRESIST" );
static const trait_id trait_INSOMNIA( "INSOMNIA" );
static const trait_id trait_INT_SLIME( "INT_SLIME" );
static const trait_id trait_LEG_TENT_BRACE( "LEG_TENT_BRACE" );
Expand Down Expand Up @@ -747,7 +752,7 @@
if( has_flag( json_flag_INSECTBLOOD ) ) {
return fd_blood_insect;
}
if( has_flag( json_flag_INVERTERBRATEBLOOD ) ) {
if( has_flag( json_flag_INVERTEBRATEBLOOD ) ) {
return fd_blood_invertebrate;
}
return fd_blood;
Expand Down Expand Up @@ -7982,14 +7987,19 @@

map &here = get_map();
const optional_vpart_position veh_part = here.veh_at( pos() );
const field &fields = get_map().field_at( pos() );
bool slippery = false;
for( const auto &field : fields ) {
slippery = field.first.obj().slippery;
}
bool in_skater_vehicle = in_vehicle && veh_part.part_with_feature( "SEAT_REQUIRES_BALANCE", false );

if( ( worn_with_flag( flag_REQUIRES_BALANCE ) || in_skater_vehicle ) && !is_on_ground() ) {
if( ( ( slippery && here.has_flag( ter_furn_flag::TFLAG_FLAT, pos() ) ) || worn_with_flag( flag_REQUIRES_BALANCE ) || in_skater_vehicle ) && !is_on_ground() ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JSON & C++ formatters] reported by reviewdog 🐶

Suggested change
if( ( ( slippery && here.has_flag( ter_furn_flag::TFLAG_FLAT, pos() ) ) || worn_with_flag( flag_REQUIRES_BALANCE ) || in_skater_vehicle ) && !is_on_ground() ) {
if( ( ( slippery && here.has_flag( ter_furn_flag::TFLAG_FLAT, pos() ) ) ||
worn_with_flag( flag_REQUIRES_BALANCE ) || in_skater_vehicle ) && !is_on_ground() ) {

int rolls = 4;
if( worn_with_flag( flag_ROLLER_ONE ) && !in_skater_vehicle ) {
rolls += 2;
}
if( has_trait( trait_PROF_SKATER ) ) {
if( !slippery || has_trait( trait_PROF_SKATER ) ) {
rolls--;
}
if( has_trait( trait_DEFT ) ) {
Expand Down Expand Up @@ -10706,6 +10716,30 @@
terminating_effects.pop();
}

if ( has_effect( effect_boomered ) && one_in( 30 ) && !has_effect( effect_pre_conjunctivitis_bacterial ) && !has_effect( effect_pre_conjunctivitis_viral ) && !has_effect( effect_conjunctivitis_bacterial ) && !has_effect( effect_conjunctivitis_viral ) && !has_trait_flag( json_flag_INFECTION_IMMUNE ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JSON & C++ formatters] reported by reviewdog 🐶

Suggested change
if ( has_effect( effect_boomered ) && one_in( 30 ) && !has_effect( effect_pre_conjunctivitis_bacterial ) && !has_effect( effect_pre_conjunctivitis_viral ) && !has_effect( effect_conjunctivitis_bacterial ) && !has_effect( effect_conjunctivitis_viral ) && !has_trait_flag( json_flag_INFECTION_IMMUNE ) ) {
if( has_effect( effect_boomered ) && one_in( 30 ) &&
!has_effect( effect_pre_conjunctivitis_bacterial ) &&
!has_effect( effect_pre_conjunctivitis_viral ) && !has_effect( effect_conjunctivitis_bacterial ) &&
!has_effect( effect_conjunctivitis_viral ) && !has_trait_flag( json_flag_INFECTION_IMMUNE ) ) {

//Washing your eyes out in time may save you from getting pinkeye.
float checked_health = get_lifestyle() + 200.0;
//Some animal eyes are more vulnerable to infection.
if ( has_trait_flag( json_flag_EYE_MEMBRANE ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JSON & C++ formatters] reported by reviewdog 🐶

Suggested change
if ( has_trait_flag( json_flag_EYE_MEMBRANE ) ) {
if( has_trait_flag( json_flag_EYE_MEMBRANE ) ) {

checked_health -= 50;
}
if ( has_trait( trait_INFRESIST ) ) {
worm-girl marked this conversation as resolved.
Show resolved Hide resolved
worm-girl marked this conversation as resolved.
Show resolved Hide resolved
worm-girl marked this conversation as resolved.
Show resolved Hide resolved
checked_health += 50;
}
add_msg( _( "Checked health is %s!" ), checked_health );
int pinkeye_chance = round( 4 + 96 * log ( checked_health + 1 ) / log ( 401 ) );
worm-girl marked this conversation as resolved.
Show resolved Hide resolved
worm-girl marked this conversation as resolved.
Show resolved Hide resolved
worm-girl marked this conversation as resolved.
Show resolved Hide resolved
add_msg( _( "Pinkeye chance is 1 in %s!" ), pinkeye_chance );
if( one_in( ( pinkeye_chance ) ) ) {

Check failure on line 10732 in src/character.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Redundant parentheses. [cata-redundant-parentheses,-warnings-as-errors]
if( one_in( 2 ) ) {
add_msg( _( "Got bacterial pinkeye with a probability of 1 in %s!" ), pinkeye_chance );
add_effect( effect_pre_conjunctivitis_bacterial, 70_hours );
} else {
add_msg( _( "Got viral pinkeye with a resistance probability of 1 in %s!" ), pinkeye_chance );
add_effect( effect_pre_conjunctivitis_viral, 70_hours );
}
}
}
worm-girl marked this conversation as resolved.
Show resolved Hide resolved

Creature::process_effects();
}

Expand Down
1 change: 1 addition & 0 deletions src/field_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ void field_type::load( const JsonObject &jo, const std::string_view )
optional( jo, was_loaded, "has_acid", has_acid, false );
optional( jo, was_loaded, "has_elec", has_elec, false );
optional( jo, was_loaded, "has_fume", has_fume, false );
optional( jo, was_loaded, "slippery", slippery, false );
optional( jo, was_loaded, "priority", priority, 0 );
optional( jo, was_loaded, "half_life", half_life, 0_turns );
const auto description_affix_reader = enum_flags_reader<description_affix> { "description affixes" };
Expand Down
1 change: 1 addition & 0 deletions src/field_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ struct field_type {
bool has_acid = false;
bool has_elec = false;
bool has_fume = false;
bool slippery = false;
description_affix desc_affix = description_affix::DESCRIPTION_AFFIX_NUM;
map_bash_info bash_info;

Expand Down
2 changes: 2 additions & 0 deletions src/monattack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
static const efftype_id effect_paid( "paid" );
static const efftype_id effect_paralyzepoison( "paralyzepoison" );
static const efftype_id effect_pet( "pet" );
static const efftype_id effect_pre_conjunctivitis_bacterial( "pre_conjunctivitis_bacterial" );

Check failure on line 137 in src/monattack.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Variable 'effect_pre_conjunctivitis_bacterial' declared but not used. [cata-unused-statics,-warnings-as-errors]
static const efftype_id effect_pre_conjunctivitis_viral( "pre_conjunctivitis_viral" );

Check failure on line 138 in src/monattack.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Variable 'effect_pre_conjunctivitis_viral' declared but not used. [cata-unused-statics,-warnings-as-errors]
static const efftype_id effect_raising( "raising" );
static const efftype_id effect_rat( "rat" );
static const efftype_id effect_shrieking( "shrieking" );
Expand Down
Loading