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

migrate miner hat to hard hat with flashlight #75844

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 1 addition & 10 deletions data/json/construction/zlvels_transition.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] ] ],
Expand Down
12 changes: 10 additions & 2 deletions data/json/itemgroups/Clothing_Gear/clothing.json
Original file line number Diff line number Diff line change
Expand Up @@ -665,19 +665,27 @@
{ "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",
"subtype": "collection",
"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 }
Expand Down Expand Up @@ -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 }
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/itemgroups/Locations_MapExtras/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
]
Expand Down
103 changes: 0 additions & 103 deletions data/json/items/tool_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion data/json/mapgen/cave.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
]
}
]
2 changes: 1 addition & 1 deletion data/json/monsterdrops/zombie_survivor.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down
6 changes: 3 additions & 3 deletions data/json/monsterdrops/zombie_technician.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/NC_JUNK_SHOPKEEP.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/mine/spiral_madman.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
]
},
{
Expand Down
12 changes: 12 additions & 0 deletions data/json/obsoletion_and_migration_0.I/migration_items.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion data/json/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" } ] },
Expand Down
22 changes: 0 additions & 22 deletions data/json/recipes/armor/head.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 0 additions & 19 deletions data/json/uncraft/recipe_deconstruction.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" } ] },
Expand Down
2 changes: 1 addition & 1 deletion data/mods/MindOverMatter/items/armor/head.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
]
Expand Down
8 changes: 4 additions & 4 deletions tests/item_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down
Loading