From 70709d0b4574416f5057654cdcd3560420f6c279 Mon Sep 17 00:00:00 2001 From: Kamejeir <99511880+Kamejeir@users.noreply.github.com> Date: Sun, 19 May 2024 23:34:56 +0200 Subject: [PATCH 1/2] Bark (inherit upgrades & fix missability) --- data/json/mutations/mutations.json | 16 ++++++++++------ doc/JSON_FLAGS.md | 1 + src/character_body.cpp | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/data/json/mutations/mutations.json b/data/json/mutations/mutations.json index 693706ebec38e..6918472cdb6b0 100644 --- a/data/json/mutations/mutations.json +++ b/data/json/mutations/mutations.json @@ -3330,6 +3330,7 @@ { "type": "mutation", "id": "BARK", + "flags": [ "BARKY" ], "name": { "str": "Protective Bark" }, "points": 5, "visibility": 10, @@ -3344,6 +3345,7 @@ { "type": "mutation", "id": "BARK2_a", + "flags": [ "BARKY" ], "name": { "str": "Shifting Bark (Distributed)" }, "points": 6, "visibility": 10, @@ -3366,6 +3368,7 @@ { "type": "mutation", "id": "BARK2_b", + "flags": [ "BARKY" ], "name": { "str": "Shifting Bark (Consolidated)" }, "points": 6, "visibility": 10, @@ -3386,6 +3389,7 @@ { "type": "mutation", "id": "BARK2_c", + "flags": [ "BARKY" ], "name": { "str": "Shifting Bark (Latticed)" }, "points": 6, "visibility": 10, @@ -3424,7 +3428,7 @@ "ugliness": 3, "description": "All the hair on your body has turned to long, grass-like leaves. Apart from being physically striking, these provide you with a minor amount of nutrients while in sunlight when your head is uncovered. Slightly reduces wet effects.", "types": [ "HAIR" ], - "prereqs": [ "PLANTSKIN", "BARK" ], + "prereqs": [ "PLANTSKIN", "BARK", "BARK2_a", "BARK2_b", "BARK2_c" ], "changes_to": [ "LEAVES2" ], "category": [ "PLANT", "ELFA" ], "wet_protection": [ { "part": "head", "ignored": 1 } ] @@ -3470,7 +3474,7 @@ "visibility": 0, "ugliness": 0, "description": "You body has begun moving nutrients via the evaporation of water. This increases your thirst when it's hot, but reduces it when it's cold.", - "prereqs": [ "PLANTSKIN", "BARK" ], + "prereqs": [ "PLANTSKIN", "BARK", "BARK2_a", "BARK2_b", "BARK2_c" ], "prereqs2": [ "LEAVES" ], "threshreq": [ "THRESH_PLANT" ], "category": [ "PLANT" ] @@ -3483,7 +3487,7 @@ "visibility": 10, "ugliness": -4, "description": "You've started blooming where your scalp used to be. Your blossoms have a pleasant aroma, are visually striking, and are quite sensitive.", - "prereqs": [ "PLANTSKIN", "BARK" ], + "prereqs": [ "PLANTSKIN", "BARK", "BARK2_a", "BARK2_b", "BARK2_c" ], "prereqs2": [ "HAIRROOTS" ], "types": [ "SCENT" ], "threshreq": [ "THRESH_PLANT", "THRESH_ELFA" ], @@ -7497,7 +7501,7 @@ "ugliness": 5, "description": "You have developed several vines sprouting from your shoulder area. They're bulky, and get in the way.", "types": [ "WINGS" ], - "prereqs": [ "PLANTSKIN", "BARK" ], + "prereqs": [ "PLANTSKIN", "BARK", "BARK2_a", "BARK2_b", "BARK2_c" ], "changes_to": [ "VINES2" ], "category": [ "PLANT" ], "encumbrance_always": [ [ "torso", 10 ] ] @@ -7511,7 +7515,7 @@ "ugliness": 5, "description": "You've developed the ability to control your vines; they make good lashes. You can even rappel down sheer drops using them, but disconnecting HURTS.", "types": [ "WINGS" ], - "prereqs": [ "PLANTSKIN", "BARK" ], + "prereqs": [ "PLANTSKIN", "BARK", "BARK2_a", "BARK2_b", "BARK2_c" ], "prereqs2": [ "VINES1" ], "changes_to": [ "VINES3" ], "category": [ "PLANT" ], @@ -7534,7 +7538,7 @@ "ugliness": 6, "description": "You have full control of your vines, and can grow new ones and detach old ones more or less at will.", "types": [ "WINGS" ], - "prereqs": [ "PLANTSKIN", "BARK" ], + "prereqs": [ "PLANTSKIN", "BARK", "BARK2_a", "BARK2_b", "BARK2_c" ], "prereqs2": [ "VINES2" ], "threshreq": [ "THRESH_PLANT" ], "category": [ "PLANT" ], diff --git a/doc/JSON_FLAGS.md b/doc/JSON_FLAGS.md index bed9f637d5e67..ccf57fcf1c476 100644 --- a/doc/JSON_FLAGS.md +++ b/doc/JSON_FLAGS.md @@ -334,6 +334,7 @@ Character flags can be `trait_id`, `json_flag_id` or `flag_id`. Some of these a - ```ACID_IMMUNE``` You are immune to acid damage. - ```ALARMCLOCK``` You always can set alarms. - ```ALBINO``` Cause you to have painful sunburns. +- ```BARKY``` Makes you considered to be made of bark for the purposes of making blistering harder. - ```BASH_IMMUNE``` You are immune to bashing damage. - ```BG_OTHER_SURVIVORS_STORY``` Given to NPC when it has other survival story. - ```BG_SURVIVAL_STORY``` Given to NPC when it has a survival story. diff --git a/src/character_body.cpp b/src/character_body.cpp index fa9a6a4246d8f..ea3bea412b25b 100644 --- a/src/character_body.cpp +++ b/src/character_body.cpp @@ -90,6 +90,7 @@ static const efftype_id effect_wet( "wet" ); static const itype_id itype_rm13_armor_on( "rm13_armor_on" ); +static const json_character_flag json_flag_BARKY ( "BARKY" ); static const json_character_flag json_flag_COLDBLOOD( "COLDBLOOD" ); static const json_character_flag json_flag_COLDBLOOD2( "COLDBLOOD2" ); static const json_character_flag json_flag_COLDBLOOD3( "COLDBLOOD3" ); @@ -101,7 +102,6 @@ static const json_character_flag json_flag_LIMB_LOWER( "LIMB_LOWER" ); static const json_character_flag json_flag_NO_THIRST( "NO_THIRST" ); static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" ); -static const trait_id trait_BARK( "BARK" ); static const trait_id trait_CHITIN_FUR( "CHITIN_FUR" ); static const trait_id trait_CHITIN_FUR2( "CHITIN_FUR2" ); static const trait_id trait_CHITIN_FUR3( "CHITIN_FUR3" ); @@ -458,7 +458,7 @@ void Character::update_bodytemp() int bp_windpower = get_local_windpower( weather_man.windspeed + vehwindspeed, cur_om_ter, get_location(), weather_man.winddirection, sheltered ); // Let's cache this not to check it for every bodyparts - const bool has_bark = has_trait( trait_BARK ); + const bool has_bark = has_flag( json_flag_BARKY ); const bool has_sleep = has_effect( effect_sleep ); const bool has_sleep_state = has_sleep || in_sleep_state(); const bool heat_immune = has_flag( json_flag_HEAT_IMMUNE ); From 7f6bcbba6fca14df46331c60b791bb7718794ee6 Mon Sep 17 00:00:00 2001 From: Kamejeir <99511880+Kamejeir@users.noreply.github.com> Date: Mon, 20 May 2024 00:14:47 +0200 Subject: [PATCH 2/2] I honestly expected line ending, but this is just as valid a thing to watch over for.. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/character_body.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/character_body.cpp b/src/character_body.cpp index ea3bea412b25b..0c37177aef087 100644 --- a/src/character_body.cpp +++ b/src/character_body.cpp @@ -90,7 +90,7 @@ static const efftype_id effect_wet( "wet" ); static const itype_id itype_rm13_armor_on( "rm13_armor_on" ); -static const json_character_flag json_flag_BARKY ( "BARKY" ); +static const json_character_flag json_flag_BARKY( "BARKY" ); static const json_character_flag json_flag_COLDBLOOD( "COLDBLOOD" ); static const json_character_flag json_flag_COLDBLOOD2( "COLDBLOOD2" ); static const json_character_flag json_flag_COLDBLOOD3( "COLDBLOOD3" );