Add: armor plates support with new database tables and loadout functionality

fix: only required mods are applied to guns for weight management.
This commit is contained in:
serversdwn
2026-02-24 16:08:58 +00:00
parent 84768ae587
commit 9d572f5d15
7 changed files with 471 additions and 126 deletions

View File

@@ -60,6 +60,26 @@ CREATE TABLE IF NOT EXISTS gun_slot_items (
CREATE INDEX IF NOT EXISTS idx_gun_slot_items_item ON gun_slot_items(item_id);
-- Open plate slots on armor/rig carriers (ItemArmorSlotOpen from tarkov API)
-- Weight of a carrier does NOT include plates in these slots
CREATE TABLE IF NOT EXISTS armor_open_slots (
carrier_id TEXT NOT NULL REFERENCES gear_items(id) ON DELETE CASCADE,
slot_nameid TEXT NOT NULL, -- e.g. "front_plate", "back_plate", "left_side_plate"
zones TEXT, -- comma-separated zone names e.g. "FR. PLATE,BCK. PLATE"
PRIMARY KEY (carrier_id, slot_nameid)
);
-- Which plates are compatible with each open slot on a carrier
CREATE TABLE IF NOT EXISTS armor_slot_plates (
carrier_id TEXT NOT NULL,
slot_nameid TEXT NOT NULL,
plate_id TEXT NOT NULL REFERENCES gear_items(id) ON DELETE CASCADE,
PRIMARY KEY (carrier_id, slot_nameid, plate_id),
FOREIGN KEY (carrier_id, slot_nameid) REFERENCES armor_open_slots(carrier_id, slot_nameid) ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS idx_armor_slot_plates_plate ON armor_slot_plates(plate_id);
-- Saved loadout builds
CREATE TABLE IF NOT EXISTS saved_builds (
id INTEGER PRIMARY KEY AUTOINCREMENT,