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

Infrastructure: Add max_worn field, migrate ONLY_ONE flag #79607

Merged
merged 7 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 0 additions & 5 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,6 @@
"id": "CORROSIVE",
"type": "json_flag"
},
{
"id": "ONLY_ONE",
"type": "json_flag",
"info": "You can wear <info>only one</info>."
},
{
"id": "ONE_PER_LAYER",
"type": "json_flag",
Expand Down
6 changes: 4 additions & 2 deletions data/json/items/armor/ballistic_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
"color": "light_green",
"environmental_protection": 2,
"material_thickness": 15,
"flags": [ "STURDY", "OUTER", "RAINPROOF", "ONLY_ONE" ],
"flags": [ "STURDY", "OUTER", "RAINPROOF" ],
"max_worn": 1,
"use_action": [ { "type": "attach_molle", "size": 15 }, { "type": "detach_molle" } ],
"pocket_data": [
{
Expand Down Expand Up @@ -168,7 +169,8 @@
"color": "light_gray",
"environmental_protection": 2,
"material_thickness": 7,
"flags": [ "STURDY", "OUTER", "RAINPROOF", "ONLY_ONE" ],
"flags": [ "STURDY", "OUTER", "RAINPROOF" ],
"max_worn": 1,
"use_action": [ { "type": "attach_molle", "size": 15 }, { "type": "detach_molle" } ],
"pocket_data": [
{
Expand Down
12 changes: 2 additions & 10 deletions data/json/items/armor/cloaks.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,8 @@
"material": [ "ballistic_shield" ],
"material_thickness": 0.3,
"max_energy_shield_hp": 4,
"flags": [
"AURA",
"ENERGY_SHIELD",
"OVERSIZE",
"ONLY_ONE",
"TRADER_AVOID",
"NO_TAKEOFF",
"NONCONDUCTIVE",
"ALLOWS_NATURAL_ATTACKS"
],
"flags": [ "AURA", "ENERGY_SHIELD", "OVERSIZE", "TRADER_AVOID", "NO_TAKEOFF", "NONCONDUCTIVE", "ALLOWS_NATURAL_ATTACKS" ],
"max_worn": 1,
"armor": [
{
"encumbrance": 0,
Expand Down
3 changes: 2 additions & 1 deletion data/json/items/armor/gloves.json
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,8 @@
"material": [ "kevlar_layered" ],
"symbol": "[",
"color": "light_gray",
"flags": [ "STURDY", "OUTER", "ONLY_ONE", "NO_SALVAGE" ],
"flags": [ "STURDY", "OUTER", "NO_SALVAGE" ],
"max_worn": 1,
"armor": [
{
"encumbrance": 10,
Expand Down
9 changes: 6 additions & 3 deletions data/json/items/armor/helmets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,8 @@
"warmth": 5,
"environmental_protection": 1,
"techniques": [ "WBLOCK_1" ],
"flags": [ "STURDY", "CONDUCTIVE", "ONLY_ONE" ],
"flags": [ "STURDY", "CONDUCTIVE" ],
"max_worn": 1,
"melee_damage": { "bash": 3 }
},
{
Expand Down Expand Up @@ -2458,7 +2459,8 @@
"warmth": 5,
"environmental_protection": 1,
"techniques": [ "WBLOCK_1" ],
"flags": [ "STURDY", "CONDUCTIVE", "ONLY_ONE" ],
"flags": [ "STURDY", "CONDUCTIVE" ],
"max_worn": 1,
"melee_damage": { "bash": 8 }
},
{
Expand Down Expand Up @@ -2688,7 +2690,8 @@
"warmth": 5,
"environmental_protection": 1,
"techniques": [ "WBLOCK_1" ],
"flags": [ "STURDY", "CONDUCTIVE", "ONLY_ONE" ],
"flags": [ "STURDY", "CONDUCTIVE" ],
"max_worn": 1,
"melee_damage": { "bash": 8 }
},
{
Expand Down
1 change: 1 addition & 0 deletions data/json/items/armor/jewelry.json
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,7 @@
"volume": "10 ml",
"//": "Measured my own pin. Hopefully the NB ones are universal.",
"description": "A small piece of metal with a pin, meant to affix itself to an article of clothing. It's mainly used on jackets or backpacks, as a way to show off what bands you listen to, or other things like your pronouns.",
"max_worn": 18,
"variant_type": "generic",
"variants": [
{
Expand Down
6 changes: 4 additions & 2 deletions data/json/items/armor/legs_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,8 @@
"color": "light_green",
"environmental_protection": 2,
"material_thickness": 15,
"flags": [ "STURDY", "OUTER", "RAINPROOF", "ONLY_ONE" ],
"flags": [ "STURDY", "OUTER", "RAINPROOF" ],
"max_worn": 1,
"use_action": [ { "type": "attach_molle", "size": 4 }, { "type": "detach_molle" } ],
"armor": [
{
Expand Down Expand Up @@ -1481,7 +1482,8 @@
"color": "light_gray",
"environmental_protection": 2,
"material_thickness": 7,
"flags": [ "STURDY", "OUTER", "RAINPROOF", "ONLY_ONE" ],
"flags": [ "STURDY", "OUTER", "RAINPROOF" ],
"max_worn": 1,
"use_action": [ { "type": "attach_molle", "size": 6 }, { "type": "detach_molle" } ],
"armor": [
{
Expand Down
12 changes: 8 additions & 4 deletions data/json/items/armor/storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@
}
],
"use_action": { "type": "holster", "holster_prompt": "Sheath blade", "holster_msg": "You sheath your %s" },
"flags": [ "BELTED", "WATERPROOF", "ONLY_ONE", "OVERSIZE" ],
"flags": [ "BELTED", "WATERPROOF", "OVERSIZE" ],
"max_worn": 1,
"armor": [
{ "encumbrance": [ 10, 40 ], "coverage": 100, "covers": [ "torso" ], "specifically_covers": [ "torso_hanging_back" ] }
]
Expand Down Expand Up @@ -341,7 +342,8 @@
}
],
"use_action": [ { "type": "attach_molle", "size": 4 }, { "type": "detach_molle" } ],
"flags": [ "BELTED", "WATERPROOF", "ONLY_ONE" ],
"flags": [ "BELTED", "WATERPROOF" ],
"max_worn": 1,
"armor": [
{
"encumbrance": 10,
Expand Down Expand Up @@ -591,7 +593,8 @@
],
"warmth": 10,
"material_thickness": 2,
"flags": [ "BELTED", "WATERPROOF", "ONLY_ONE", "OVERSIZE" ],
"flags": [ "BELTED", "WATERPROOF", "OVERSIZE" ],
"max_worn": 1,
"armor": [
{ "encumbrance": [ 10, 55 ], "coverage": 100, "covers": [ "torso" ], "specifically_covers": [ "torso_hanging_back" ] }
]
Expand Down Expand Up @@ -703,7 +706,8 @@
],
"warmth": 10,
"material_thickness": 2,
"flags": [ "BELTED", "WATERPROOF", "ONLY_ONE", "OVERSIZE" ],
"flags": [ "BELTED", "WATERPROOF", "OVERSIZE" ],
"max_worn": 1,
"armor": [
{ "encumbrance": [ 16, 65 ], "coverage": 100, "covers": [ "torso" ], "specifically_covers": [ "torso_hanging_back" ] }
]
Expand Down
9 changes: 6 additions & 3 deletions data/json/items/armor/suits_protection.json
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@
"warmth": 20,
"longest_side": "60 cm",
"material_thickness": 2,
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "ONLY_ONE", "BLOCK_WHILE_WORN" ],
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "BLOCK_WHILE_WORN" ],
"max_worn": 1,
"armor": [
{
"material": [
Expand Down Expand Up @@ -709,7 +710,8 @@
"warmth": 20,
"longest_side": "60 cm",
"material_thickness": 4,
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "ONLY_ONE", "BLOCK_WHILE_WORN" ],
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "BLOCK_WHILE_WORN" ],
"max_worn": 1,
"armor": [
{
"material": [
Expand Down Expand Up @@ -837,7 +839,8 @@
"warmth": 20,
"longest_side": "60 cm",
"material_thickness": 6,
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "ONLY_ONE", "BLOCK_WHILE_WORN" ],
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "BLOCK_WHILE_WORN" ],
"max_worn": 1,
"armor": [
{
"material": [
Expand Down
12 changes: 8 additions & 4 deletions data/json/items/armor/torso_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@
"material": [ "cotton" ],
"warmth": 80,
"environmental_protection": 4,
"flags": [ "VARSIZE", "STURDY", "NORMAL", "RAINPROOF", "NO_REPAIR", "ONLY_ONE", "BLOCK_WHILE_WORN" ],
"flags": [ "VARSIZE", "STURDY", "NORMAL", "RAINPROOF", "NO_REPAIR", "BLOCK_WHILE_WORN" ],
"max_worn": 1,
"armor": [
{
"material": [
Expand Down Expand Up @@ -1548,7 +1549,8 @@
"warmth": 20,
"longest_side": "60 cm",
"material_thickness": 2,
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "ONLY_ONE" ],
"flags": [ "OUTER", "STURDY", "CONDUCTIVE" ],
"max_worn": 1,
"armor": [
{
"material": [
Expand Down Expand Up @@ -1664,7 +1666,8 @@
"warmth": 20,
"longest_side": "60 cm",
"material_thickness": 4,
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "ONLY_ONE" ],
"flags": [ "OUTER", "STURDY", "CONDUCTIVE" ],
"max_worn": 1,
"armor": [
{
"material": [
Expand Down Expand Up @@ -1780,7 +1783,8 @@
"warmth": 20,
"longest_side": "60 cm",
"material_thickness": 6,
"flags": [ "OUTER", "STURDY", "CONDUCTIVE", "ONLY_ONE" ],
"flags": [ "OUTER", "STURDY", "CONDUCTIVE" ],
"max_worn": 1,
"armor": [
{
"material": [
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/gun/flammable.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dispersion": 300,
"durability": 8,
"modes": [ [ "DEFAULT", "Jet", 1 ], [ "AUTO", "Gout", 4 ] ],
"extend": { "flags": [ "BELTED", "ONLY_ONE", "PRIMITIVE_RANGED_WEAPON", "IS_ARMOR" ] },
"extend": { "flags": [ "BELTED", "PRIMITIVE_RANGED_WEAPON", "IS_ARMOR" ] },
"armor_data": {
"armor": [
{
Expand Down
18 changes: 12 additions & 6 deletions data/json/items/tool_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3200,7 +3200,8 @@
"color": "light_gray",
"material_thickness": 3,
"use_action": [ "SOLARPACK" ],
"flags": [ "BELTED", "FRAGILE", "ONLY_ONE", "SOLARPACK", "WATER_BREAK", "ELECTRONIC" ],
"flags": [ "BELTED", "FRAGILE", "SOLARPACK", "WATER_BREAK", "ELECTRONIC" ],
"max_worn": 1,
"armor": [ { "encumbrance": 10, "coverage": 100, "covers": [ "torso" ], "specifically_covers": [ "torso_hanging_back" ] } ],
"melee_damage": { "bash": 10 }
},
Expand All @@ -3219,7 +3220,8 @@
"material_thickness": 1,
"use_action": [ "SOLARPACK_OFF" ],
"solar_efficiency": 0.05,
"flags": [ "BELTED", "FRAGILE", "ONLY_ONE", "SOLARPACK_ON", "WATER_BREAK", "ELECTRONIC" ],
"flags": [ "BELTED", "FRAGILE", "SOLARPACK_ON", "WATER_BREAK", "ELECTRONIC" ],
"max_worn": 1,
"armor": [ { "encumbrance": 10, "coverage": 100, "covers": [ "torso" ], "specifically_covers": [ "torso_hanging_back" ] } ],
"melee_damage": { "bash": 4 }
},
Expand Down Expand Up @@ -3434,7 +3436,8 @@
"pocket_data": [
{ "pocket_type": "MAGAZINE", "airtight": true, "rigid": true, "watertight": true, "ammo_restriction": { "nitrox": 60 } }
],
"flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD", "NO_RELOAD" ],
"flags": [ "WATER_FRIENDLY", "BELTED", "STURDY", "NO_UNLOAD", "NO_RELOAD" ],
"max_worn": 1,
"environmental_protection": 1,
"environmental_protection_with_filter": 16,
"material_thickness": 4,
Expand Down Expand Up @@ -3464,7 +3467,8 @@
"charges_per_use": 1,
"turns_per_charge": 60,
"revert_to": "scuba_tank",
"flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD", "NO_RELOAD" ],
"flags": [ "WATER_FRIENDLY", "BELTED", "STURDY", "NO_UNLOAD", "NO_RELOAD" ],
"max_worn": 1,
"environmental_protection": 3,
"environmental_protection_with_filter": 16,
"material_thickness": 4,
Expand Down Expand Up @@ -3494,7 +3498,8 @@
"pocket_data": [
{ "pocket_type": "MAGAZINE", "airtight": true, "rigid": true, "watertight": true, "ammo_restriction": { "nitrox": 20 } }
],
"flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD", "NO_RELOAD" ],
"flags": [ "WATER_FRIENDLY", "BELTED", "STURDY", "NO_UNLOAD", "NO_RELOAD" ],
"max_worn": 1,
"environmental_protection": 1,
"environmental_protection_with_filter": 16,
"material_thickness": 4,
Expand Down Expand Up @@ -3524,7 +3529,8 @@
"charges_per_use": 1,
"turns_per_charge": 60,
"revert_to": "small_scuba_tank",
"flags": [ "WATER_FRIENDLY", "BELTED", "ONLY_ONE", "STURDY", "NO_UNLOAD", "NO_RELOAD" ],
"flags": [ "WATER_FRIENDLY", "BELTED", "STURDY", "NO_UNLOAD", "NO_RELOAD" ],
"max_worn": 1,
"environmental_protection": 3,
"environmental_protection_with_filter": 16,
"material_thickness": 4,
Expand Down
9 changes: 6 additions & 3 deletions data/mods/Aftershock/items/armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"pocket_data": [ { "pocket_type": "CONTAINER", "max_contains_volume": "100 L", "max_contains_weight": "500 kg", "moves": 300 } ],
"warmth": 5,
"material_thickness": 2,
"flags": [ "BELTED", "ONLY_ONE", "LEAK_DAM" ],
"flags": [ "BELTED", "LEAK_DAM" ],
"max_worn": 1,
"armor": [ { "encumbrance": [ 5, 10 ], "coverage": 30, "covers": [ "torso" ] } ]
},
{
Expand Down Expand Up @@ -186,7 +187,8 @@
"color": "light_gray",
"material_thickness": 3,
"use_action": [ "SOLARPACK" ],
"flags": [ "FRAGILE", "OUTER", "ONLY_ONE", "SOLARPACK" ],
"flags": [ "FRAGILE", "OUTER", "SOLARPACK" ],
"max_worn": 1,
"armor": [ { "encumbrance": 12, "coverage": 40, "covers": [ "torso" ] } ],
"melee_damage": { "bash": 10 }
},
Expand All @@ -205,7 +207,8 @@
"material_thickness": 1,
"use_action": [ "SOLARPACK_OFF" ],
"solar_efficiency": 0.3,
"flags": [ "FRAGILE", "OUTER", "ONLY_ONE", "SOLARPACK_ON" ],
"flags": [ "FRAGILE", "OUTER", "SOLARPACK_ON" ],
"max_worn": 1,
"armor": [ { "encumbrance": 20, "coverage": 40, "covers": [ "torso" ] } ],
"melee_damage": { "bash": 4 }
},
Expand Down
5 changes: 3 additions & 2 deletions data/mods/Aftershock/items/armor/energy_shield.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"AURA",
"ENERGY_SHIELD",
"OVERSIZE",
"ONLY_ONE",
"TRADER_AVOID",
"NO_TAKEOFF",
"NONCONDUCTIVE",
Expand All @@ -26,6 +25,7 @@
"POWERARMOR_COMPATIBLE",
"UNRESTRICTED"
],
"max_worn": 1,
"tick_action": {
"type": "effect_on_conditions",
"effect_on_conditions": [ { "id": "_afs_energy_shield", "effect": { "run_eocs": "EOC_afs_do_shield" } } ]
Expand Down Expand Up @@ -64,7 +64,8 @@
"item_restriction": [ "afs_cartridge", "afs_bootleg_cartridge", "afs_archeotech_cartridge" ]
}
],
"flags": [ "BELTED", "WATERPROOF", "ONLY_ONE", "POWERARMOR_COMPATIBLE" ],
"flags": [ "BELTED", "WATERPROOF", "POWERARMOR_COMPATIBLE" ],
"max_worn": 1,
"use_action": {
"type": "effect_on_conditions",
"ammo_scale": 1,
Expand Down
Loading
Loading