added 'WW2', 'SOVIET' and 'SECONDARY' detection and added Shade

This commit is contained in:
IM23a-spirgif
2024-09-21 15:05:09 +02:00
parent ea61296d0d
commit 4766540fc5
3 changed files with 64 additions and 42 deletions
+19 -16
View File
@@ -232,16 +232,18 @@ function applyModifiers() {
// Function to process global modifiers // Function to process global modifiers
const processModifier = (mod) => { const processModifier = (mod) => {
if (mod.appliesNotTo && mod.appliesNotTo === selectedWeapon.guntype) { // Ensure guntype is now an array of tags
return; // Skip this modifier const weaponTags = selectedWeapon.guntype; // This is now an array like ["PISTOL", "WW2", "SECONDARY"]
}
if (mod.appliesTo && mod.appliesTo !== selectedWeapon.guntype) { // Skip the modifier if it should not apply to any of the current weapon's tags
return; // Skip this modifier if (mod.appliesNotTo && weaponTags.includes(mod.appliesNotTo)) {
} 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
} }
// 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 // Handle modifiers with multiple buffs
if (mod.dataset.buffs) { if (mod.dataset.buffs) {
const buffs = JSON.parse(mod.dataset.buffs); const buffs = JSON.parse(mod.dataset.buffs);
@@ -271,16 +273,17 @@ function applyModifiers() {
// Function to process operative-specific modifiers // Function to process operative-specific modifiers
const processOperativeModifier = (mod) => { const processOperativeModifier = (mod) => {
if (mod.appliesNotTo && mod.appliesNotTo === selectedWeapon.guntype) { // Ensure guntype is now an array of tags
return; // Skip this modifier for this weapon type const weaponTags = selectedWeapon.guntype; // This is now an array like ["PISTOL", "WW2", "SECONDARY"]
}
if (mod.appliesTo && mod.appliesTo !== selectedWeapon.guntype) { // Skip the modifier if it should not apply to any of the current weapon's tags
return; // Skip if the modifier does not apply to this weapon type 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 // Check if the modifier applies to any of the current weapon's tags
if (mod.operatives && selectedOperative && mod.operatives !== selectedOperative.category) { if (mod.appliesTo && !weaponTags.includes(mod.appliesTo)) {
return; // Skip this modifier if it doesn't apply to the current operative's category return; // Skip this modifier
} }
// Handle operative modifiers with multiple buffs // Handle operative modifiers with multiple buffs
+23 -23
View File
@@ -7,7 +7,7 @@
"rpm": 550, "rpm": 550,
"mag_size": 18, "mag_size": 18,
"reload_time": 2, "reload_time": 2,
"guntype": "PISTOL" "guntype": ["PISTOL", "SECONDARY"]
}, },
{ {
"id": 2, "id": 2,
@@ -17,7 +17,7 @@
"rpm": 580, "rpm": 580,
"mag_size": 8, "mag_size": 8,
"reload_time": 1.15, "reload_time": 1.15,
"guntype": "PISTOL" "guntype": ["PISTOL", "SECONDARY", "WW2"]
}, },
{ {
"id": 3, "id": 3,
@@ -27,7 +27,7 @@
"rpm": 850, "rpm": 850,
"mag_size": 15, "mag_size": 15,
"reload_time": 2, "reload_time": 2,
"guntype": "PISTOL" "guntype": ["PISTOL", "SECONDARY"]
}, },
{ {
"id": 4, "id": 4,
@@ -37,7 +37,7 @@
"rpm": 720, "rpm": 720,
"mag_size": 16, "mag_size": 16,
"reload_time": 3, "reload_time": 3,
"guntype": "PISTOL" "guntype": ["PISTOL", "SECONDARY"]
}, },
{ {
"id": 5, "id": 5,
@@ -47,7 +47,7 @@
"rpm": 500, "rpm": 500,
"mag_size": 8, "mag_size": 8,
"reload_time": 1.95, "reload_time": 1.95,
"guntype": "PISTOL" "guntype": ["PISTOL", "WW2", "SECONDARY"]
}, },
{ {
"id": 6, "id": 6,
@@ -57,7 +57,7 @@
"rpm": 600, "rpm": 600,
"mag_size": 30, "mag_size": 30,
"reload_time": 2.1, "reload_time": 2.1,
"guntype": "RIFLE" "guntype": ["RIFLE", "SOVIET"]
}, },
{ {
"id": 7, "id": 7,
@@ -77,7 +77,7 @@
"rpm": 400, "rpm": 400,
"mag_size": 24, "mag_size": 24,
"reload_time": 2.6, "reload_time": 2.6,
"guntype": "RIFLE" "guntype": "SEMI-AUTO"
}, },
{ {
"id": 9, "id": 9,
@@ -107,7 +107,7 @@
"rpm": 60, "rpm": 60,
"mag_size": 8, "mag_size": 8,
"reload_time": 2.8, "reload_time": 2.8,
"guntype": "RIFLE" "guntype": ["RIFLE", "WW2"]
}, },
{ {
"id": 12, "id": 12,
@@ -177,7 +177,7 @@
"rpm": 750, "rpm": 750,
"mag_size": 50, "mag_size": 50,
"reload_time": 2.5, "reload_time": 2.5,
"guntype": "SMG" "guntype": ["RIFLE", "WW2"]
}, },
{ {
"id": 22, "id": 22,
@@ -267,7 +267,7 @@
"rpm": 550, "rpm": 550,
"mag_size": 32, "mag_size": 32,
"reload_time": 3, "reload_time": 3,
"guntype": "SMG" "guntype": ["SMG", "WW2"]
}, },
{ {
"id": 31, "id": 31,
@@ -277,7 +277,7 @@
"rpm": 750, "rpm": 750,
"mag_size": 100, "mag_size": 100,
"reload_time": 5.5, "reload_time": 5.5,
"guntype": "LMG" "guntype": ["LMG", "SOVIET"]
}, },
{ {
"id": 32, "id": 32,
@@ -337,7 +337,7 @@
"rpm": 30, "rpm": 30,
"mag_size": 5, "mag_size": 5,
"reload_time": 3.5, "reload_time": 3.5,
"guntype": "RIFLE" "guntype": "SEMI-AUTO"
}, },
{ {
"id": 38, "id": 38,
@@ -517,7 +517,7 @@
"rpm": 700, "rpm": 700,
"mag_size": 34, "mag_size": 34,
"reload_time": 3.5, "reload_time": 3.5,
"guntype": "PISTOL" "guntype": ["PISTOL"]
}, },
{ {
"id": 57, "id": 57,
@@ -527,7 +527,7 @@
"rpm": 440, "rpm": 440,
"mag_size": 18, "mag_size": 18,
"reload_time": 3.5, "reload_time": 3.5,
"guntype": "RIFLE" "guntype": "SEMI-AUTO"
}, },
{ {
"id": 58, "id": 58,
@@ -537,7 +537,7 @@
"rpm": 540, "rpm": 540,
"mag_size": 18, "mag_size": 18,
"reload_time": 3.5, "reload_time": 3.5,
"guntype": "RIFLE" "guntype": "SEMI-AUTO"
}, },
{ {
"id": 59, "id": 59,
@@ -557,7 +557,7 @@
"rpm": 900, "rpm": 900,
"mag_size": 26, "mag_size": 26,
"reload_time": 2.5, "reload_time": 2.5,
"guntype": "SMG?" "guntype": ["PISTOL"]
}, },
{ {
"id": 61, "id": 61,
@@ -567,7 +567,7 @@
"rpm": 1200, "rpm": 1200,
"mag_size": 26, "mag_size": 26,
"reload_time": 2, "reload_time": 2,
"guntype": "SMG?" "guntype": ["PISTOL"]
}, },
{ {
"id": 62, "id": 62,
@@ -687,7 +687,7 @@
"rpm": 400, "rpm": 400,
"mag_size": 18, "mag_size": 18,
"reload_time": 2.1, "reload_time": 2.1,
"guntype": "PISTOL" "guntype": ["PISTOL"]
}, },
{ {
"id": 74, "id": 74,
@@ -697,7 +697,7 @@
"rpm": 400, "rpm": 400,
"mag_size": 36, "mag_size": 36,
"reload_time": 3.5, "reload_time": 3.5,
"guntype": "PISTOL" "guntype": ["PISTOL"]
}, },
{ {
"id": 75, "id": 75,
@@ -707,7 +707,7 @@
"rpm": 300, "rpm": 300,
"mag_size": 10, "mag_size": 10,
"reload_time": 3, "reload_time": 3,
"guntype": "RIFLE" "guntype": "SEMI-AUTO"
}, },
{ {
"id": 76, "id": 76,
@@ -717,7 +717,7 @@
"rpm": 700, "rpm": 700,
"mag_size": 10, "mag_size": 10,
"reload_time": 2, "reload_time": 2,
"guntype": "RIFLE?" "guntype": "RIFLE"
}, },
{ {
"id": 77, "id": 77,
@@ -727,7 +727,7 @@
"rpm": 1000, "rpm": 1000,
"mag_size": 71, "mag_size": 71,
"reload_time": 2.5, "reload_time": 2.5,
"guntype": "UNKOWN" "guntype": ["SMG", "SOVIET"]
}, },
{ {
"id": 78, "id": 78,
@@ -737,7 +737,7 @@
"rpm": 690, "rpm": 690,
"mag_size": 30, "mag_size": 30,
"reload_time": 2.5, "reload_time": 2.5,
"guntype": "RIFLE" "guntype": ["RIFLE", "SOVIET"]
}, },
{ {
"id": 79, "id": 79,
+22 -3
View File
@@ -1180,12 +1180,12 @@
] ]
}, },
{ {
"id": "GRU-P-Specialist", "id": "winter-soldier",
"name": "GRU-P Specialist", "name": "Winter Soldier",
"category": "GRU-P", "category": "GRU-P",
"modifiers": [ "modifiers": [
{ {
"id": "well-taught-reload-perk", "id": "snow-beast-reload-perk",
"label": "Snow Beast (+25% Reload Speed)", "label": "Snow Beast (+25% Reload Speed)",
"buffs": [ "buffs": [
{ {
@@ -1226,6 +1226,25 @@
"appliesTo": "" "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": ""
}
]
} }
] ]
} }