diff --git a/data/json/items/armor/power_armor.json b/data/json/items/armor/power_armor.json index 22e38d8b61ae3..9a0c85fdb7964 100644 --- a/data/json/items/armor/power_armor.json +++ b/data/json/items/armor/power_armor.json @@ -237,7 +237,14 @@ "flags": [ "USE_UPS", "WATERPROOF", "STURDY", "ELECTRIC_IMMUNE", "TRADER_AVOID", "CLIMATE_CONTROL", "COMBAT_TOGGLEABLE" ], "power_draw": 4000000, "revert_to": "power_armor_basic", - "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s armor disengages.", "target": "power_armor_basic" } + "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s armor disengages.", "target": "power_armor_basic" }, + "armor": [ + { + "encumbrance": 10, + "coverage": 100, + "covers": [ "torso", "arm_l", "arm_r", "hand_l", "hand_r", "leg_l", "leg_r", "foot_l", "foot_r" ] + } + ] }, { "id": "power_armor_frame", @@ -385,11 +392,18 @@ "flags": [ "USE_UPS", "WATERPROOF", "STURDY", "ELECTRIC_IMMUNE", "TRADER_AVOID", "CLIMATE_CONTROL", "COMBAT_TOGGLEABLE" ], "power_draw": 4000000, "revert_to": "power_armor_heavy", - "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s armor disengages.", "target": "power_armor_heavy" } + "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s armor disengages.", "target": "power_armor_heavy" }, + "armor": [ + { + "encumbrance": 20, + "coverage": 100, + "covers": [ "torso", "arm_l", "arm_r", "hand_l", "hand_r", "leg_l", "leg_r", "foot_l", "foot_r" ] + } + ] }, { "id": "power_armor_helmet_basic", - "type": "ARMOR", + "type": "TOOL_ARMOR", "category": "armor", "name": { "str": "environmental combat helmet" }, "description": "A fully enclosed combat helmet for hazardous environments, this was designed to fit with a powered exoskeleton, using cameras to expand visual range. In practice, the cameras were unreliable and easily fouled. The environmental controls function best with direct-skin contact.", @@ -405,15 +419,37 @@ "color": "light_gray", "warmth": 90, "power_armor": true, + "ammo": "battery", + "use_action": { + "type": "transform", + "menu_text": "Turn on", + "msg": "The %s engages.", + "target": "power_armor_helmet_basic_on", + "active": true + }, "material_thickness": 14, "environmental_protection": 16, "qualities": [ [ "GLARE", 1 ] ], "flags": [ "WATCH", "WATERPROOF", "STURDY", "PARTIAL_DEAF", "THERMOMETER", "SUN_GLASSES", "COMBAT_TOGGLEABLE" ], "armor": [ { "encumbrance": 50, "coverage": 100, "covers": [ "head", "eyes", "mouth" ] } ] }, + { + "id": "power_armor_helmet_basic_on", + "type": "TOOL_ARMOR", + "copy-from": "power_armor_helmet_basic", + "repairs_like": "power_armor_helmet_basic", + "looks_like": "power_armor_helmet_basic", + "name": { "str": "environmental combat helmet (on)", "str_pl": "environmental combat helmets (on)" }, + "description": "A fully enclosed combat helmet for hazardous environments, this was designed to fit with a powered exoskeleton, using cameras to expand visual range. In practice, the cameras were unreliable and easily fouled. The environmental controls function best with direct-skin contact. The environmental controls function best with direct-skin contact. It is turned on and continually drawing power. Use it to turn it off.", + "power_draw": 435, + "revert_to": "power_armor_helmet_basic", + "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s disengages.", "target": "power_armor_helmet_basic" }, + "extend": { "flags": [ "USE_UPS" ] }, + "armor": [ { "encumbrance": 10, "coverage": 100, "covers": [ "head", "eyes", "mouth" ] } ] + }, { "id": "power_armor_helmet_heavy", - "type": "ARMOR", + "type": "TOOL_ARMOR", "category": "armor", "name": { "str": "heavy environmental combat helmet" }, "description": "An extremely heavy-duty fully enclosed combat helmet for hazardous environments, this was designed to fit with a powered exoskeleton. In the field, soldiers reported that the protection was not worth the awkward size and limited visuals. The environmental controls function best with direct-skin contact.", @@ -432,12 +468,34 @@ "material_thickness": 16, "environmental_protection": 16, "qualities": [ [ "GLARE", 1 ] ], + "ammo": "battery", + "use_action": { + "type": "transform", + "menu_text": "Turn on", + "msg": "The %s engages.", + "target": "power_armor_helmet_heavy_on", + "active": true + }, "flags": [ "WATCH", "WATERPROOF", "STURDY", "PARTIAL_DEAF", "THERMOMETER", "SUN_GLASSES", "COMBAT_TOGGLEABLE" ], "armor": [ { "encumbrance": 60, "coverage": 100, "covers": [ "head", "eyes", "mouth" ] } ] }, + { + "id": "power_armor_helmet_heavy_on", + "type": "TOOL_ARMOR", + "copy-from": "power_armor_helmet_heavy", + "repairs_like": "power_armor_helmet_heavy", + "looks_like": "power_armor_helmet_heavy", + "name": { "str": "heavy environmental combat helmet (on)", "str_pl": "heavy environmental combat helmets (on)" }, + "description": "An extremely heavy-duty fully enclosed combat helmet for hazardous environments, this was designed to fit with a powered exoskeleton. In the field, soldiers reported that the protection was not worth the awkward size and limited visuals. The environmental controls function best with direct-skin contact. It is turned on and continually drawing power. Use it to turn it off.", + "power_draw": 435, + "revert_to": "power_armor_helmet_heavy", + "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s disengages.", "target": "power_armor_helmet_heavy" }, + "extend": { "flags": [ "USE_UPS" ] }, + "armor": [ { "encumbrance": 20, "coverage": 100, "covers": [ "head", "eyes", "mouth" ] } ] + }, { "id": "power_armor_helmet_light", - "type": "ARMOR", + "type": "TOOL_ARMOR", "category": "armor", "name": { "str": "light environmental combat helmet" }, "description": "This full-enclosure helmet was designed based on commercial diving equipment, in response to complaints that earlier designs were impossible to use in combat. While still a little more restrictive than regular combat headgear - and frustrating should your nose itch - this one received far better reviews from soldiers. Sadly, civilization ended before they could roll out in significant numbers. The environmental controls function best with direct-skin contact.", @@ -453,11 +511,33 @@ "color": "dark_gray", "warmth": 60, "power_armor": true, + "ammo": "battery", + "use_action": { + "type": "transform", + "menu_text": "Turn on", + "msg": "The %s engages.", + "target": "power_armor_helmet_light_on", + "active": true + }, "material_thickness": 8, "environmental_protection": 16, "flags": [ "WATCH", "WATERPROOF", "STURDY", "THERMOMETER", "SUN_GLASSES", "SWIM_GOGGLES", "COMBAT_TOGGLEABLE" ], "armor": [ { "encumbrance": 40, "coverage": 100, "covers": [ "head", "eyes", "mouth" ] } ] }, + { + "id": "power_armor_helmet_light_on", + "type": "TOOL_ARMOR", + "copy-from": "power_armor_helmet_light", + "repairs_like": "power_armor_helmet_light", + "looks_like": "power_armor_helmet_light", + "name": { "str": "light environmental combat helmet (on)", "str_pl": "light environmental combat helmets (on)" }, + "description": "This full-enclosure helmet was designed based on commercial diving equipment, in response to complaints that earlier designs were impossible to use in combat. While still a little more restrictive than regular combat headgear - and frustrating should your nose itch - this one received far better reviews from soldiers. Sadly, civilization ended before they could roll out in significant numbers. The environmental controls function best with direct-skin contact. It is turned on and continually drawing power. Use it to turn it off.", + "power_draw": 435, + "revert_to": "power_armor_helmet_light", + "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s disengages.", "target": "power_armor_helmet_light" }, + "extend": { "flags": [ "USE_UPS" ] }, + "armor": [ { "encumbrance": 0, "coverage": 100, "covers": [ "head", "eyes", "mouth" ] } ] + }, { "id": "power_armor_light", "type": "TOOL_ARMOR", @@ -572,6 +652,13 @@ "flags": [ "USE_UPS", "WATERPROOF", "STURDY", "ELECTRIC_IMMUNE", "TRADER_AVOID", "CLIMATE_CONTROL", "COMBAT_TOGGLEABLE" ], "power_draw": 4000000, "revert_to": "power_armor_light", - "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s armor disengages.", "target": "power_armor_light" } + "use_action": { "type": "transform", "menu_text": "Turn off", "msg": "The %s armor disengages.", "target": "power_armor_light" }, + "armor": [ + { + "encumbrance": 0, + "coverage": 100, + "covers": [ "torso", "arm_l", "arm_r", "hand_l", "hand_r", "leg_l", "leg_r", "foot_l", "foot_r" ] + } + ] } ] diff --git a/data/json/items/tool_armor.json b/data/json/items/tool_armor.json index 486354230aae7..fc787fc3d9afa 100644 --- a/data/json/items/tool_armor.json +++ b/data/json/items/tool_armor.json @@ -1116,6 +1116,13 @@ "PSYSHIELD_PARTIAL", "GNV_EFFECT", "CLIMATE_CONTROL" + ], + "armor": [ + { + "encumbrance": 10, + "coverage": 100, + "covers": [ "head", "mouth", "eyes", "torso", "arm_l", "arm_r", "hand_l", "hand_r", "leg_l", "leg_r", "foot_l", "foot_r" ] + } ] }, { diff --git a/src/character_attire.cpp b/src/character_attire.cpp index 6ed9c93f2ff7a..5e8462492996f 100644 --- a/src/character_attire.cpp +++ b/src/character_attire.cpp @@ -778,7 +778,7 @@ bool Character::is_wearing_active_optcloak() const } static void layer_item( std::map &vals, const item &it, - std::map &highest_layer_so_far, bool power_armor, const Character &c ) + std::map &highest_layer_so_far, const Character &c ) { body_part_set covered_parts = it.get_covered_body_parts(); for( const bodypart_id &bp : c.get_all_body_parts() ) { @@ -800,9 +800,6 @@ static void layer_item( std::map &vals, const ite layering_encumbrance = 0; } - const int armorenc = !power_armor || !it.is_power_armor() ? - encumber_val : std::max( 0, encumber_val - 40 ); - for( layer_level item_layer : item_layers ) { // do the sublayers of this armor conflict bool conflicts = false; @@ -822,7 +819,7 @@ static void layer_item( std::map &vals, const ite penalty_layer <= highest_layer_so_far[bp]; ++penalty_layer ) { vals[bp].layer( penalty_layer, layering_encumbrance, conflicts ); } - vals[bp].armor_encumbrance += armorenc; + vals[bp].armor_encumbrance += encumber_val; } } } @@ -864,16 +861,15 @@ void Character::item_encumb( std::map &vals, // items std::map highest_layer_so_far; - const bool power_armored = is_wearing_active_power_armor(); for( auto w_it = worn.begin(); w_it != worn.end(); ++w_it ) { if( w_it == new_item_position ) { - layer_item( vals, new_item, highest_layer_so_far, power_armored, *this ); + layer_item( vals, new_item, highest_layer_so_far, *this ); } - layer_item( vals, *w_it, highest_layer_so_far, power_armored, *this ); + layer_item( vals, *w_it, highest_layer_so_far, *this ); } if( worn.end() == new_item_position && !new_item.is_null() ) { - layer_item( vals, new_item, highest_layer_so_far, power_armored, *this ); + layer_item( vals, new_item, highest_layer_so_far, *this ); } // make sure values are sane diff --git a/src/item.cpp b/src/item.cpp index 489f6ac2a5926..e832927b1de6b 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -3592,7 +3592,6 @@ void item::armor_info( std::vector &info, const iteminfo_query *parts, insert_separation_line( info ); if( covers_anything ) { - int power_armor_encumbrance_reduction = 40; if( is_power_armor() || type->get_id() == itype_rm13_armor ) { item tmp = *this; @@ -3618,7 +3617,7 @@ void item::armor_info( std::vector &info, const iteminfo_query *parts, if( type->get_id() == itype_rm13_armor ) { print_prot = !tmp.armor_encumbrance_info( info, parts ); } else { - print_prot = !tmp.armor_encumbrance_info( info, parts, true, power_armor_encumbrance_reduction ); + print_prot = !tmp.armor_encumbrance_info( info, parts, true ); } } if( print_prot ) {