diff --git a/data/json/construction/zlvels_transition.json b/data/json/construction/zlvels_transition.json index 96457f3d66196..be3ed0eb626de 100644 --- a/data/json/construction/zlvels_transition.json +++ b/data/json/construction/zlvels_transition.json @@ -134,16 +134,7 @@ "tools": [ [ [ "pickaxe_list", 1, "LIST" ], [ "jackhammer", 160 ], [ "elec_jackhammer", 2112 ] ], [ [ "tool_rope_long", 1, "LIST" ] ], - [ - "miner_hat", - "hat_hard", - "firehelmet", - "helmet_ball", - "helmet_army", - "helmet_riot", - "tac_helmet", - "miner_hat_on" - ] + [ "hat_hard", "firehelmet", "helmet_ball", "helmet_army", "helmet_riot", "tac_helmet" ] ], "//": "Helmets are essential because you're digging up and things may fall on you.", "components": [ [ [ "2x4", 18 ] ], [ [ "wood_beam", 2 ] ], [ [ "nails", 90, "LIST" ], [ "nuts_bolts", 90 ] ] ], diff --git a/data/json/itemgroups/Clothing_Gear/clothing.json b/data/json/itemgroups/Clothing_Gear/clothing.json index e44b9771e31c8..f3db327a07bbf 100644 --- a/data/json/itemgroups/Clothing_Gear/clothing.json +++ b/data/json/itemgroups/Clothing_Gear/clothing.json @@ -665,12 +665,19 @@ { "group": "hat_hard_modified", "prob": 30 }, { "item": "hat_hard_hooded", "prob": 10 }, { "group": "hat_hard_hooded_modified", "prob": 5 }, - { "item": "miner_hat", "prob": 10, "charges": [ 0, 100 ] }, + { "group": "hat_hard_flashlight", "prob": 10 }, { "item": "wearable_light", "prob": 15, "charges": [ 0, 100 ] }, { "item": "hat_hard", "variant": "flag_hat_hard", "prob": 70, "event": "independence_day" }, { "item": "hat_hard_hooded", "variant": "flag_hat_hard", "prob": 20, "event": "independence_day" } ] }, + { + "id": "hat_hard_flashlight", + "type": "item_group", + "subtype": "collection", + "container-item": "hat_hard", + "items": [ { "item": "light_disposable_cell", "charges": [ 0, -1 ], "container-item": "flashlight" } ] + }, { "id": "hat_hard_modified", "type": "item_group", @@ -678,6 +685,7 @@ "container-item": "hat_hard", "items": [ { "group": "common_nape_protectors", "prob": 50 }, + { "item": "light_minus_disposable_cell", "charges": 100, "container-item": "flashlight", "prob": 50 }, { "group": "common_face_shields", "prob": 15 }, { "item": "plastic_chin_guard", "prob": 10 }, { "item": "attachable_ear_muffs", "prob": 5 } @@ -805,7 +813,7 @@ [ "gloves_leather", 40 ], [ "gloves_work", 45 ], { "item": "wearable_light", "prob": 10, "charges": [ 0, 100 ] }, - { "item": "miner_hat", "prob": 1, "charges": [ 0, 100 ] } + { "group": "hat_hard_flashlight", "prob": 1 } ] }, { diff --git a/data/json/itemgroups/Locations_MapExtras/locations.json b/data/json/itemgroups/Locations_MapExtras/locations.json index c3c840d82eb22..b0082931b0f46 100644 --- a/data/json/itemgroups/Locations_MapExtras/locations.json +++ b/data/json/itemgroups/Locations_MapExtras/locations.json @@ -1332,7 +1332,7 @@ [ "lamp_oil", 5 ], [ "shovel", 10 ], [ "e_tool", 5 ], - { "item": "miner_hat", "prob": 40, "charges": [ 0, 100 ] }, + { "group": "hat_hard_flashlight", "prob": 40 }, [ "bucket", 5 ], [ "bucket_5gal", 20 ], [ "grapnel", 1 ], diff --git a/data/json/itemgroups/Locations_MapExtras/locations_commercial.json b/data/json/itemgroups/Locations_MapExtras/locations_commercial.json index 7b563dc59848d..47f71f6934e37 100644 --- a/data/json/itemgroups/Locations_MapExtras/locations_commercial.json +++ b/data/json/itemgroups/Locations_MapExtras/locations_commercial.json @@ -552,7 +552,7 @@ [ "maid_dress", 3 ], [ "maid_dress_short", 3 ], [ "maid_hat", 3 ], - [ "miner_hat", 3 ], + { "group": "hat_hard_flashlight", "prob": 3 }, [ "grapnel", 1 ], [ "razor_blade", 6 ], [ "scabbard", 4 ], diff --git a/data/json/itemgroups/Monsters_Animals_Lairs/monster_drops_lairs.json b/data/json/itemgroups/Monsters_Animals_Lairs/monster_drops_lairs.json index 4d6c6cc425fae..32885508f37bf 100644 --- a/data/json/itemgroups/Monsters_Animals_Lairs/monster_drops_lairs.json +++ b/data/json/itemgroups/Monsters_Animals_Lairs/monster_drops_lairs.json @@ -72,7 +72,7 @@ { "item": "rock_large", "prob": 5 }, { "item": "stick", "prob": 95 }, { "item": "survivormap", "prob": 1 }, - { "item": "miner_hat", "prob": 10 }, + { "group": "hat_hard_flashlight", "prob": 10 }, { "item": "honey_ant", "prob": 30, "count": 2 }, { "item": "homemade_bomb_act", "prob": 1 } ] diff --git a/data/json/items/tool_armor.json b/data/json/items/tool_armor.json index 469d46421b3d9..35574a99c6d7e 100644 --- a/data/json/items/tool_armor.json +++ b/data/json/items/tool_armor.json @@ -338,109 +338,6 @@ "price_postapoc": "50 cent", "flags": [ "UNDERSIZE", "PREFIX_XS", "WATER_FRIENDLY", "OUTER", "SPLINT", "ALLOWS_TAIL" ] }, - { - "id": "miner_hat", - "type": "TOOL_ARMOR", - "category": "armor", - "symbol": "[", - "color": "yellow", - "name": { "str": "mining helmet" }, - "description": "A mining helmet with a heavy-duty LED flashlight. Using this will turn the flashlight on and provide light, assuming it is charged with batteries.", - "flags": [ "WATERPROOF", "PADDED" ], - "price": "125 USD", - "price_postapoc": "2 USD 50 cent", - "material": [ "plastic" ], - "weight": "1196 g", - "volume": "3 L", - "charges_per_use": 1, - "ammo": "battery", - "use_action": { - "type": "transform", - "msg": "You turn the helmet on.", - "target": "miner_hat_on", - "active": true, - "need_charges": 1, - "need_charges_msg": "The helmet's batteries are dead." - }, - "techniques": [ "WBLOCK_1" ], - "warmth": 8, - "material_thickness": 4, - "environmental_protection": 1, - "pocket_data": [ - { - "pocket_type": "MAGAZINE_WELL", - "rigid": true, - "flag_restriction": [ "BATTERY_LIGHT", "BATTERY_ULTRA_LIGHT" ], - "default_magazine": "light_battery_cell" - }, - { - "pocket_type": "CONTAINER", - "ablative": true, - "volume_encumber_modifier": 0, - "max_contains_volume": "500 ml", - "max_contains_weight": "500 g", - "moves": 250, - "description": "Pocket for a face shield or a shield visor.", - "flag_restriction": [ "HELMET_FACE_SHIELD" ] - }, - { - "pocket_type": "CONTAINER", - "ablative": true, - "volume_encumber_modifier": 0, - "max_contains_volume": "500 ml", - "max_contains_weight": "400 g", - "moves": 250, - "description": "Pocket for an ear attachment.", - "flag_restriction": [ "HELMET_EAR_ATTACHMENT" ], - "inherits_flags": true - }, - { - "pocket_type": "CONTAINER", - "ablative": true, - "volume_encumber_modifier": 0, - "max_contains_volume": "500 ml", - "max_contains_weight": "250 g", - "moves": 250, - "description": "Pocket for a nape protector.", - "flag_restriction": [ "HELMET_NAPE_PROTECTOR" ] - }, - { - "pocket_type": "CONTAINER", - "ablative": true, - "volume_encumber_modifier": 0, - "max_contains_volume": "500 ml", - "max_contains_weight": "400 g", - "moves": 250, - "description": "Pocket for a strapped mandible guard.", - "flag_restriction": [ "HELMET_MANDIBLE_GUARD_STRAPPED" ] - }, - { - "pocket_type": "CONTAINER", - "volume_encumber_modifier": 0, - "max_contains_volume": "400 ml", - "max_contains_weight": "400 g", - "moves": 250, - "description": "Pocket for a counterweight pouch.", - "flag_restriction": [ "HELMET_BACK_POUCH" ] - } - ], - "armor": [ - { "encumbrance": 15, "coverage": 100, "covers": [ "head" ], "specifically_covers": [ "head_crown", "head_forehead" ] } - ], - "melee_damage": { "bash": 6 } - }, - { - "id": "miner_hat_on", - "copy-from": "miner_hat", - "type": "TOOL_ARMOR", - "name": { "str": "mining helmet (on)", "str_pl": "mining helmets (on)" }, - "description": "A mining helmet with a heavy-duty LED flashlight. The flashlight is turned on, and continually draining its batteries. Use it to turn it off.", - "flags": [ "LIGHT_450", "CHARGEDIM", "WATERPROOF", "TRADER_AVOID", "PADDED" ], - "power_draw": "15 W", - "revert_to": "miner_hat", - "use_action": { "ammo_scale": 0, "menu_text": "Turn off", "type": "transform", "msg": "The %s flicks off.", "target": "miner_hat" }, - "techniques": [ "WBLOCK_1" ] - }, { "id": "welding_mask", "type": "ARMOR", diff --git a/data/json/mapgen/cave.json b/data/json/mapgen/cave.json index 0169b6fb9ad93..02e7e032a7e5b 100644 --- a/data/json/mapgen/cave.json +++ b/data/json/mapgen/cave.json @@ -809,7 +809,7 @@ { "item": "chipper", "prob": 75 }, { "item": "g_shovel", "prob": 75 }, { "item": "stepladder", "prob": 50 }, - { "item": "miner_hat", "prob": 75 } + { "group": "hat_hard_flashlight", "prob": 75 } ] } ] diff --git a/data/json/monsterdrops/zombie_survivor.json b/data/json/monsterdrops/zombie_survivor.json index 3651b4e4e73ad..9c9b08068c3bc 100644 --- a/data/json/monsterdrops/zombie_survivor.json +++ b/data/json/monsterdrops/zombie_survivor.json @@ -337,7 +337,7 @@ [ "pot_helmet", 7 ], [ "helmet_army", 4 ], [ "hat_hard", 22 ], - [ "miner_hat", 9 ], + { "group": "hat_hard_flashlight", "prob": 9 }, [ "firehelmet", 10 ], [ "chainmail_junk_hood", 1 ], [ "pickelhaube", 1 ] diff --git a/data/json/monsterdrops/zombie_technician.json b/data/json/monsterdrops/zombie_technician.json index 83bcaa046f46d..c2c89c8045ddb 100644 --- a/data/json/monsterdrops/zombie_technician.json +++ b/data/json/monsterdrops/zombie_technician.json @@ -87,10 +87,10 @@ ] }, { - "item": "miner_hat", - "charges": [ 50, 100 ], + "group": "hat_hard_flashlight", "damage": [ 1, 4 ], - "contents-group": "worker_kitted_hard_hat" + "contents-group": "worker_kitted_hard_hat", + "prob": 40 } ] }, diff --git a/data/json/npcs/NC_JUNK_SHOPKEEP.json b/data/json/npcs/NC_JUNK_SHOPKEEP.json index 7b04a5746323c..99097f5a111c5 100644 --- a/data/json/npcs/NC_JUNK_SHOPKEEP.json +++ b/data/json/npcs/NC_JUNK_SHOPKEEP.json @@ -260,7 +260,7 @@ { "item": "book_icef", "prob": 8 }, { "item": "textbook_fabrication", "prob": 12 }, { "item": "sm_extinguisher", "prob": 10 }, - { "item": "miner_hat", "prob": 1 }, + { "group": "hat_hard_flashlight", "prob": 1 }, { "group": "quicklime_bag", "prob": 30 }, { "item": "amplifier", "prob": 8 }, { "item": "mag_electronics", "prob": 15 }, diff --git a/data/json/npcs/mine/spiral_madman.json b/data/json/npcs/mine/spiral_madman.json index 86cb784a43e7e..b61f4d860897a 100644 --- a/data/json/npcs/mine/spiral_madman.json +++ b/data/json/npcs/mine/spiral_madman.json @@ -43,7 +43,7 @@ ] }, { "group": "underwear", "damage": [ 0, 1 ] }, - { "item": "miner_hat", "prob": 90, "damage": [ 0, 2 ] } + { "group": "hat_hard_flashlight", "damage": [ 0, 2 ], "prob": 90 } ] }, { diff --git a/data/json/obsoletion_and_migration_0.I/migration_items.json b/data/json/obsoletion_and_migration_0.I/migration_items.json index 74fabad31c18c..6c5c9c703bb24 100644 --- a/data/json/obsoletion_and_migration_0.I/migration_items.json +++ b/data/json/obsoletion_and_migration_0.I/migration_items.json @@ -138,6 +138,18 @@ "type": "MIGRATION", "replace": "m26_mass" }, + { + "id": "miner_hat", + "type": "MIGRATION", + "replace": "hat_hard", + "contents": [ { "id": "flashlight", "count": 1 } ] + }, + { + "id": "miner_hat_on", + "type": "MIGRATION", + "replace": "hat_hard", + "contents": [ { "id": "flashlight", "count": 1 } ] + }, { "id": "ts12_aux_shotgun", "type": "MIGRATION", diff --git a/data/json/professions.json b/data/json/professions.json index 4f763a2005817..14d20f5485275 100644 --- a/data/json/professions.json +++ b/data/json/professions.json @@ -5723,7 +5723,7 @@ { "item": "ear_plugs", "custom-flags": [ "no_auto_equip" ] }, { "item": "jackhammer", "charges": 0 }, { "item": "light_minus_disposable_cell", "charges": 100 }, - { "item": "light_minus_disposable_cell", "charges": 100, "container-item": "miner_hat" } + { "group": "hat_hard_flashlight" } ] }, "male": { "entries": [ { "item": "boxer_shorts" } ] }, diff --git a/data/json/recipes/armor/head.json b/data/json/recipes/armor/head.json index 27ada589827a0..a32fab7f5f89d 100644 --- a/data/json/recipes/armor/head.json +++ b/data/json/recipes/armor/head.json @@ -1938,28 +1938,6 @@ [ [ "wax_any", 2, "LIST" ], [ "any_tallow", 6, "LIST" ] ] ] }, - { - "result": "miner_hat", - "type": "recipe", - "activity_level": "LIGHT_EXERCISE", - "category": "CC_ARMOR", - "subcategory": "CSC_ARMOR_HEAD", - "skill_used": "fabrication", - "time": "10 m", - "autolearn": true, - "reversible": true, - "components": [ - [ [ "hat_hard", 1 ], [ "helmet_bike", 1 ] ], - [ [ "flashlight", 1 ] ], - [ - [ "cotton_patchwork", 2 ], - [ "leather", 2 ], - [ "cordage", 1, "LIST" ], - [ "duct_tape", 10 ], - [ "medical_tape", 20 ] - ] - ] - }, { "result": "nomex_hood", "type": "recipe", diff --git a/data/json/uncraft/recipe_deconstruction.json b/data/json/uncraft/recipe_deconstruction.json index 460a098379e26..466e366f0d9b6 100644 --- a/data/json/uncraft/recipe_deconstruction.json +++ b/data/json/uncraft/recipe_deconstruction.json @@ -5116,25 +5116,6 @@ "qualities": [ { "id": "CUT", "level": 1 } ], "components": [ [ [ "heavy_flashlight", 1 ] ], [ [ "cotton_patchwork", 4 ] ] ] }, - { - "result": "miner_hat", - "type": "uncraft", - "activity_level": "LIGHT_EXERCISE", - "skill_used": "fabrication", - "time": "3 m", - "qualities": [ { "id": "CUT", "level": 2 } ], - "components": [ - [ [ "hat_hard", 1 ], [ "helmet_bike", 1 ] ], - [ [ "flashlight", 1 ] ], - [ - [ "cotton_patchwork", 2 ], - [ "leather", 2 ], - [ "cordage", 1, "LIST" ], - [ "duct_tape", 10 ], - [ "medical_tape", 20 ] - ] - ] - }, { "result": "adobe_pallet_done", "type": "uncraft", diff --git a/data/mods/Magiclysm/professions.json b/data/mods/Magiclysm/professions.json index 6b9ce3d58b01c..50d84c8885c51 100644 --- a/data/mods/Magiclysm/professions.json +++ b/data/mods/Magiclysm/professions.json @@ -635,7 +635,7 @@ { "item": "ear_plugs", "custom-flags": [ "no_auto_equip" ] }, { "item": "water_clean", "container-item": "canteen" }, { "item": "light_minus_disposable_cell", "charges": 100 }, - { "item": "light_minus_disposable_cell", "charges": 100, "container-item": "miner_hat" } + { "group": "hat_hard_flashlight", "prob": 40 } ] }, "male": { "entries": [ { "item": "boxer_shorts" } ] }, diff --git a/data/mods/MindOverMatter/items/armor/head.json b/data/mods/MindOverMatter/items/armor/head.json index 875b24490b0f3..3d0611427c1cb 100644 --- a/data/mods/MindOverMatter/items/armor/head.json +++ b/data/mods/MindOverMatter/items/armor/head.json @@ -27,7 +27,7 @@ "price": "30 USD", "price_postapoc": "25 cent", "material": [ { "type": "steel", "portion": 12 }, { "type": "nether_crystal" } ], - "looks_like": "miner_hat", + "looks_like": "hat_hard", "symbol": "[", "color": "white", "material_thickness": 0.33, diff --git a/data/mods/TropiCataclysm/itemgroups/Monsters_Animals_Lairs/monster_drops_lairs.json b/data/mods/TropiCataclysm/itemgroups/Monsters_Animals_Lairs/monster_drops_lairs.json index 4977166da0f7f..c7512f93bc426 100644 --- a/data/mods/TropiCataclysm/itemgroups/Monsters_Animals_Lairs/monster_drops_lairs.json +++ b/data/mods/TropiCataclysm/itemgroups/Monsters_Animals_Lairs/monster_drops_lairs.json @@ -53,7 +53,7 @@ { "item": "rock_large", "prob": 5 }, { "item": "stick", "prob": 95 }, { "item": "survivormap", "prob": 1 }, - { "item": "miner_hat", "prob": 10 }, + { "group": "hat_hard_flashlight", "prob": 10 }, { "item": "honey_ant", "prob": 30 }, { "item": "homemade_bomb_act", "prob": 1 } ] diff --git a/tests/item_test.cpp b/tests/item_test.cpp index 68c207ab6f063..bd07b6480e413 100644 --- a/tests/item_test.cpp +++ b/tests/item_test.cpp @@ -859,11 +859,11 @@ TEST_CASE( "module_inheritance", "[item][armor]" ) CHECK( guy.worn.worn_with_flag( json_flag_FIX_NEARSIGHT ) ); clear_avatar(); - item miner_hat( "miner_hat" ); + item hat_hard( "hat_hard" ); item ear_muffs( "attachable_ear_muffs" ); - REQUIRE( miner_hat.put_in( ear_muffs, pocket_type::CONTAINER ).success() ); - REQUIRE( !miner_hat.has_flag( json_flag_DEAF ) ); - guy.wear_item( miner_hat ); + REQUIRE( hat_hard.put_in( ear_muffs, pocket_type::CONTAINER ).success() ); + REQUIRE( !hat_hard.has_flag( json_flag_DEAF ) ); + guy.wear_item( hat_hard ); item_location worn_hat = guy.worn.top_items_loc( guy ).front(); item_location worn_muffs( worn_hat, &worn_hat->only_item() ); avatar_action::use_item( guy, worn_muffs, "transform" );