diff --git a/static/filterWeapons.js b/static/filterWeapons.js index 0111760..4789eca 100644 --- a/static/filterWeapons.js +++ b/static/filterWeapons.js @@ -232,16 +232,18 @@ function applyModifiers() { // Function to process global modifiers const processModifier = (mod) => { - if (mod.appliesNotTo && mod.appliesNotTo === selectedWeapon.guntype) { - return; // Skip this modifier - } - if (mod.appliesTo && mod.appliesTo !== selectedWeapon.guntype) { - return; // Skip this modifier - } - if (mod.operatives && selectedOperative && mod.operatives !== selectedOperative.category) { - return; // Skip this modifier if it doesn't apply to the current operative's category + // Ensure guntype is now an array of tags + const weaponTags = selectedWeapon.guntype; // This is now an array like ["PISTOL", "WW2", "SECONDARY"] + + // Skip the modifier if it should not apply to any of the current weapon's tags + if (mod.appliesNotTo && weaponTags.includes(mod.appliesNotTo)) { + return; // Skip this modifier } + // Check if the modifier applies to any of the current weapon's tags + if (mod.appliesTo && !weaponTags.includes(mod.appliesTo)) { + return; // Skip this modifier + } // Handle modifiers with multiple buffs if (mod.dataset.buffs) { const buffs = JSON.parse(mod.dataset.buffs); @@ -271,16 +273,17 @@ function applyModifiers() { // Function to process operative-specific modifiers const processOperativeModifier = (mod) => { - if (mod.appliesNotTo && mod.appliesNotTo === selectedWeapon.guntype) { - return; // Skip this modifier for this weapon type - } - if (mod.appliesTo && mod.appliesTo !== selectedWeapon.guntype) { - return; // Skip if the modifier does not apply to this weapon type + // Ensure guntype is now an array of tags + const weaponTags = selectedWeapon.guntype; // This is now an array like ["PISTOL", "WW2", "SECONDARY"] + + // Skip the modifier if it should not apply to any of the current weapon's tags + if (mod.appliesNotTo && weaponTags.includes(mod.appliesNotTo)) { + return; // Skip this modifier } - // Ensure that the modifier only applies if it matches the selected operative's category - if (mod.operatives && selectedOperative && mod.operatives !== selectedOperative.category) { - return; // Skip this modifier if it doesn't apply to the current operative's category + // Check if the modifier applies to any of the current weapon's tags + if (mod.appliesTo && !weaponTags.includes(mod.appliesTo)) { + return; // Skip this modifier } // Handle operative modifiers with multiple buffs diff --git a/static/json/data.json b/static/json/data.json index 77919ad..2a01576 100644 --- a/static/json/data.json +++ b/static/json/data.json @@ -7,7 +7,7 @@ "rpm": 550, "mag_size": 18, "reload_time": 2, - "guntype": "PISTOL" + "guntype": ["PISTOL", "SECONDARY"] }, { "id": 2, @@ -17,7 +17,7 @@ "rpm": 580, "mag_size": 8, "reload_time": 1.15, - "guntype": "PISTOL" + "guntype": ["PISTOL", "SECONDARY", "WW2"] }, { "id": 3, @@ -27,7 +27,7 @@ "rpm": 850, "mag_size": 15, "reload_time": 2, - "guntype": "PISTOL" + "guntype": ["PISTOL", "SECONDARY"] }, { "id": 4, @@ -37,7 +37,7 @@ "rpm": 720, "mag_size": 16, "reload_time": 3, - "guntype": "PISTOL" + "guntype": ["PISTOL", "SECONDARY"] }, { "id": 5, @@ -47,7 +47,7 @@ "rpm": 500, "mag_size": 8, "reload_time": 1.95, - "guntype": "PISTOL" + "guntype": ["PISTOL", "WW2", "SECONDARY"] }, { "id": 6, @@ -57,7 +57,7 @@ "rpm": 600, "mag_size": 30, "reload_time": 2.1, - "guntype": "RIFLE" + "guntype": ["RIFLE", "SOVIET"] }, { "id": 7, @@ -77,7 +77,7 @@ "rpm": 400, "mag_size": 24, "reload_time": 2.6, - "guntype": "RIFLE" + "guntype": "SEMI-AUTO" }, { "id": 9, @@ -107,7 +107,7 @@ "rpm": 60, "mag_size": 8, "reload_time": 2.8, - "guntype": "RIFLE" + "guntype": ["RIFLE", "WW2"] }, { "id": 12, @@ -177,7 +177,7 @@ "rpm": 750, "mag_size": 50, "reload_time": 2.5, - "guntype": "SMG" + "guntype": ["RIFLE", "WW2"] }, { "id": 22, @@ -267,7 +267,7 @@ "rpm": 550, "mag_size": 32, "reload_time": 3, - "guntype": "SMG" + "guntype": ["SMG", "WW2"] }, { "id": 31, @@ -277,7 +277,7 @@ "rpm": 750, "mag_size": 100, "reload_time": 5.5, - "guntype": "LMG" + "guntype": ["LMG", "SOVIET"] }, { "id": 32, @@ -337,7 +337,7 @@ "rpm": 30, "mag_size": 5, "reload_time": 3.5, - "guntype": "RIFLE" + "guntype": "SEMI-AUTO" }, { "id": 38, @@ -517,7 +517,7 @@ "rpm": 700, "mag_size": 34, "reload_time": 3.5, - "guntype": "PISTOL" + "guntype": ["PISTOL"] }, { "id": 57, @@ -527,7 +527,7 @@ "rpm": 440, "mag_size": 18, "reload_time": 3.5, - "guntype": "RIFLE" + "guntype": "SEMI-AUTO" }, { "id": 58, @@ -537,7 +537,7 @@ "rpm": 540, "mag_size": 18, "reload_time": 3.5, - "guntype": "RIFLE" + "guntype": "SEMI-AUTO" }, { "id": 59, @@ -557,7 +557,7 @@ "rpm": 900, "mag_size": 26, "reload_time": 2.5, - "guntype": "SMG?" + "guntype": ["PISTOL"] }, { "id": 61, @@ -567,7 +567,7 @@ "rpm": 1200, "mag_size": 26, "reload_time": 2, - "guntype": "SMG?" + "guntype": ["PISTOL"] }, { "id": 62, @@ -687,7 +687,7 @@ "rpm": 400, "mag_size": 18, "reload_time": 2.1, - "guntype": "PISTOL" + "guntype": ["PISTOL"] }, { "id": 74, @@ -697,7 +697,7 @@ "rpm": 400, "mag_size": 36, "reload_time": 3.5, - "guntype": "PISTOL" + "guntype": ["PISTOL"] }, { "id": 75, @@ -707,7 +707,7 @@ "rpm": 300, "mag_size": 10, "reload_time": 3, - "guntype": "RIFLE" + "guntype": "SEMI-AUTO" }, { "id": 76, @@ -717,7 +717,7 @@ "rpm": 700, "mag_size": 10, "reload_time": 2, - "guntype": "RIFLE?" + "guntype": "RIFLE" }, { "id": 77, @@ -727,7 +727,7 @@ "rpm": 1000, "mag_size": 71, "reload_time": 2.5, - "guntype": "UNKOWN" + "guntype": ["SMG", "SOVIET"] }, { "id": 78, @@ -737,7 +737,7 @@ "rpm": 690, "mag_size": 30, "reload_time": 2.5, - "guntype": "RIFLE" + "guntype": ["RIFLE", "SOVIET"] }, { "id": 79, diff --git a/static/json/operative.json b/static/json/operative.json index faa1ba6..87c746e 100644 --- a/static/json/operative.json +++ b/static/json/operative.json @@ -1180,12 +1180,12 @@ ] }, { - "id": "GRU-P-Specialist", - "name": "GRU-P Specialist", + "id": "winter-soldier", + "name": "Winter Soldier", "category": "GRU-P", "modifiers": [ { - "id": "well-taught-reload-perk", + "id": "snow-beast-reload-perk", "label": "Snow Beast (+25% Reload Speed)", "buffs": [ { @@ -1226,6 +1226,25 @@ "appliesTo": "" } ] + }, + { + "id": "shade", + "name": "Shade", + "category": "SCP", + "modifiers": [ + { + "id": "hell-bullets-damage-perk", + "label": "Hell Bullets (+10% Damage)", + "buffs": [ + { + "type": "damage", + "value": 1.1, + "buffType": "multiplicative" + } + ], + "appliesTo": "" + } + ] } ] } \ No newline at end of file