diff --git a/data/json/bionics.json b/data/json/bionics.json index c195c15de4a95..3cc9c890c775f 100644 --- a/data/json/bionics.json +++ b/data/json/bionics.json @@ -258,7 +258,8 @@ "act_cost": "100 J", "react_cost": "100 J", "time": 1, - "flags": [ "BIONIC_TOGGLED" ] + "flags": [ "BIONIC_TOGGLED" ], + "active_flags": [ "CLIMATE_CONTROL" ] }, { "id": "bio_cloak", @@ -582,6 +583,7 @@ [ "foot_r", 1 ] ], "flags": [ "BIONIC_TOGGLED", "BIONIC_NPC_USABLE" ], + "active_flags": [ "HEATSINK" ], "act_cost": "1 kJ", "react_cost": "1 kJ", "time": 1 diff --git a/doc/JSON_FLAGS.md b/doc/JSON_FLAGS.md index a970ca43e483e..69ccb0472c6f4 100644 --- a/doc/JSON_FLAGS.md +++ b/doc/JSON_FLAGS.md @@ -1549,3 +1549,5 @@ Gun fault flags: - ```ALARMCLOCK``` You always can set alarms. - ```PARAIMMUNE``` You are immune to parasites. - ```IMMUNE_SPOIL``` You are immune to negative outcomes from spoiled food. +- ```CLIMATE_CONTROL``` You are resistant to extreme temperatures. +- ```HEATSINK``` You are resistant to extreme heat. \ No newline at end of file diff --git a/src/character.cpp b/src/character.cpp index 0499dd9420f18..d303ca10ef10a 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -276,12 +276,10 @@ static const trait_id trait_WOOLALLERGY( "WOOLALLERGY" ); static const bionic_id bio_ads( "bio_ads" ); static const bionic_id bio_blaster( "bio_blaster" ); -static const bionic_id bio_climate( "bio_climate" ); static const bionic_id bio_voice( "bio_voice" ); static const bionic_id bio_flashlight( "bio_flashlight" ); static const bionic_id bio_gills( "bio_gills" ); static const bionic_id bio_ground_sonar( "bio_ground_sonar" ); -static const bionic_id bio_heatsink( "bio_heatsink" ); static const bionic_id bio_hydraulics( "bio_hydraulics" ); static const bionic_id bio_jointservo( "bio_jointservo" ); static const bionic_id bio_laser( "bio_laser" ); @@ -387,6 +385,7 @@ static const json_character_flag json_flag_BLIND( "BLIND" ); static const json_character_flag json_flag_BULLET_IMMUNE( "BULLET_IMMUNE" ); static const json_character_flag json_flag_CLAIRVOYANCE( "CLAIRVOYANCE" ); static const json_character_flag json_flag_CLAIRVOYANCE_PLUS( "CLAIRVOYANCE_PLUS" ); +static const json_character_flag json_flag_CLIMATE_CONTROL( "CLIMATE_CONTROL" ); static const json_character_flag json_flag_COLD_IMMUNE( "COLD_IMMUNE" ); static const json_character_flag json_flag_CUT_IMMUNE( "CUT_IMMUNE" ); static const json_character_flag json_flag_DEAF( "DEAF" ); @@ -394,6 +393,7 @@ static const json_character_flag json_flag_ELECTRIC_IMMUNE( "ELECTRIC_IMMUNE" ); static const json_character_flag json_flag_ENHANCED_VISION( "ENHANCED_VISION" ); static const json_character_flag json_flag_EYE_MEMBRANE( "EYE_MEMBRANE" ); static const json_character_flag json_flag_HEATPROOF( "HEATPROOF" ); +static const json_character_flag json_flag_HEATSINK( "HEATSINK" ); static const json_character_flag json_flag_IMMUNE_HEARING_DAMAGE( "IMMUNE_HEARING_DAMAGE" ); static const json_character_flag json_flag_INFRARED( "INFRARED" ); static const json_character_flag json_flag_NIGHT_VISION( "NIGHT_VISION" ); @@ -4558,7 +4558,7 @@ bool Character::in_climate_control() { bool regulated_area = false; // Check - if( has_active_bionic( bio_climate ) ) { + if( has_flag( json_flag_CLIMATE_CONTROL ) ) { return true; } map &here = get_map(); @@ -6440,7 +6440,7 @@ void Character::update_bodytemp() 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_HEATPROOF ); - const bool has_heatsink = has_bionic( bio_heatsink ) || is_wearing( itype_rm13_armor_on ) || + const bool has_heatsink = has_flag( json_flag_HEATSINK ) || is_wearing( itype_rm13_armor_on ) || heat_immune; const bool has_common_cold = has_effect( effect_common_cold ); const bool has_climate_control = in_climate_control(); @@ -7458,7 +7458,7 @@ bool Character::is_immune_field( const field_type_id &fid ) const return is_elec_immune(); } if( ft.has_fire ) { - return has_active_bionic( bio_heatsink ) || is_wearing( itype_rm13_armor_on ); + return has_flag( json_flag_HEATSINK ) || is_wearing( itype_rm13_armor_on ); } if( ft.has_acid ) { return !is_on_ground() && get_env_resist( body_part_foot_l ) >= 15 && diff --git a/src/map_field.cpp b/src/map_field.cpp index ae320217bbc59..dfa2eacfc8623 100644 --- a/src/map_field.cpp +++ b/src/map_field.cpp @@ -72,8 +72,6 @@ static const itype_id itype_rock( "rock" ); static const species_id species_FUNGUS( "FUNGUS" ); -static const bionic_id bio_heatsink( "bio_heatsink" ); - static const efftype_id effect_badpoison( "badpoison" ); static const efftype_id effect_blind( "blind" ); static const efftype_id effect_corroding( "corroding" ); @@ -93,6 +91,8 @@ static const trait_id trait_M_SKIN3( "M_SKIN3" ); static const trait_id trait_THRESH_MARLOSS( "THRESH_MARLOSS" ); static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" ); +static const json_character_flag json_flag_HEATSINK( "HEATSINK" ); + using namespace map_field_processing; void map::create_burnproducts( const tripoint &p, const item &fuel, const units::mass &burned_mass ) @@ -1472,7 +1472,7 @@ void map::player_in_field( player &u ) } if( ft == fd_fire ) { // Heatsink or suit prevents ALL fire damage. - if( !u.has_active_bionic( bio_heatsink ) && !u.is_wearing( itype_rm13_armor_on ) ) { + if( !u.has_flag( json_flag_HEATSINK ) && !u.is_wearing( itype_rm13_armor_on ) ) { // To modify power of a field based on... whatever is relevant for the effect. int adjusted_intensity = cur.get_field_intensity(); @@ -1587,7 +1587,7 @@ void map::player_in_field( player &u ) if( !inside ) { // Fireballs can't touch you inside a car. // Heatsink or suit stops fire. - if( !u.has_active_bionic( bio_heatsink ) && + if( !u.has_flag( json_flag_HEATSINK ) && !u.is_wearing( itype_rm13_armor_on ) ) { u.add_msg_player_or_npc( m_bad, _( "You're torched by flames!" ), _( " is torched by flames!" ) );