fixed some bugs
This commit is contained in:
+10
-3
@@ -5,7 +5,7 @@ let globalModifiers = [];
|
|||||||
|
|
||||||
// Function to fetch operatives data from JSON
|
// Function to fetch operatives data from JSON
|
||||||
function fetchOperativesData() {
|
function fetchOperativesData() {
|
||||||
fetch('static/json/operative.json') // Adjust the path to the actual location of your JSON file
|
fetch('/static/json/operative.json') // Adjust the path to the actual location of your JSON file
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
populateOperatives(data.operatives); // Populate the operative dropdown once data is loaded
|
populateOperatives(data.operatives); // Populate the operative dropdown once data is loaded
|
||||||
@@ -230,6 +230,8 @@ function applyModifiers() {
|
|||||||
let rpmModifier = {additive: 0, multiplicative: 1};
|
let rpmModifier = {additive: 0, multiplicative: 1};
|
||||||
let reloadTimeModifier = {additive: 0, multiplicative: 1};
|
let reloadTimeModifier = {additive: 0, multiplicative: 1};
|
||||||
|
|
||||||
|
// Function to process global modifiers
|
||||||
|
// Function to process global modifiers
|
||||||
// Function to process global modifiers
|
// Function to process global modifiers
|
||||||
const processModifier = (mod) => {
|
const processModifier = (mod) => {
|
||||||
// Ensure guntype is now an array of tags
|
// Ensure guntype is now an array of tags
|
||||||
@@ -242,8 +244,9 @@ function applyModifiers() {
|
|||||||
|
|
||||||
// Check if the modifier applies to any of the current weapon's tags
|
// Check if the modifier applies to any of the current weapon's tags
|
||||||
if (mod.appliesTo && !weaponTags.includes(mod.appliesTo)) {
|
if (mod.appliesTo && !weaponTags.includes(mod.appliesTo)) {
|
||||||
return; // Skip this modifier
|
return; // Skip this modifier if it does not apply to the selected weapon type
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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,6 +274,9 @@ function applyModifiers() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Function to process operative-specific modifiers
|
||||||
|
// Function to process operative-specific modifiers
|
||||||
// Function to process operative-specific modifiers
|
// Function to process operative-specific modifiers
|
||||||
const processOperativeModifier = (mod) => {
|
const processOperativeModifier = (mod) => {
|
||||||
// Ensure guntype is now an array of tags
|
// Ensure guntype is now an array of tags
|
||||||
@@ -283,7 +289,7 @@ function applyModifiers() {
|
|||||||
|
|
||||||
// Check if the modifier applies to any of the current weapon's tags
|
// Check if the modifier applies to any of the current weapon's tags
|
||||||
if (mod.appliesTo && !weaponTags.includes(mod.appliesTo)) {
|
if (mod.appliesTo && !weaponTags.includes(mod.appliesTo)) {
|
||||||
return; // Skip this modifier
|
return; // Skip this modifier if it does not apply to the selected weapon type
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle operative modifiers with multiple buffs
|
// Handle operative modifiers with multiple buffs
|
||||||
@@ -305,6 +311,7 @@ function applyModifiers() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Clear out listeners and avoid re-adding
|
// Clear out listeners and avoid re-adding
|
||||||
const modifiersContainer = document.getElementById('modifiers');
|
const modifiersContainer = document.getElementById('modifiers');
|
||||||
modifiersContainer.removeEventListener('change', applyModifiers);
|
modifiersContainer.removeEventListener('change', applyModifiers);
|
||||||
|
|||||||
+68
-10
@@ -117,7 +117,8 @@
|
|||||||
"value": 1.25,
|
"value": 1.25,
|
||||||
"buffType": "multiplicative"
|
"buffType": "multiplicative"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "multiple-buffs-firefight",
|
"id": "multiple-buffs-firefight",
|
||||||
@@ -134,14 +135,16 @@
|
|||||||
"buffType": "multiplicative"
|
"buffType": "multiplicative"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"operatives": ""
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "damage-ability-multiplicative-heath-spawn",
|
"id": "damage-ability-multiplicative-heath-spawn",
|
||||||
"label": "[All Operatives] Heath Spawn (+30% Damage)",
|
"label": "[All Operatives] Heath Spawn (+30% Damage)",
|
||||||
"value": 1.3,
|
"value": 1.3,
|
||||||
"type": "multiplicative",
|
"type": "multiplicative",
|
||||||
"operatives": ""
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "multiple-buffs-warcry",
|
"id": "multiple-buffs-warcry",
|
||||||
@@ -158,49 +161,104 @@
|
|||||||
"value": 1,
|
"value": 1,
|
||||||
"buffType": "multiplicative"
|
"buffType": "multiplicative"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "damage-ability-multiplicative-blackout",
|
"id": "damage-ability-multiplicative-blackout",
|
||||||
"label": "[All Operatives] Blackout (+30% Damage)",
|
"label": "[All Operatives] Blackout (+30% Damage)",
|
||||||
"value": 1.3,
|
"value": 1.3,
|
||||||
"type": "multiplicative",
|
"type": "multiplicative",
|
||||||
"operatives": ""
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "damage-ability-multiplicative-red-scan",
|
"id": "damage-ability-multiplicative-red-scan",
|
||||||
"label": "[All Operatives] Red Scan (+30% Damage)",
|
"label": "[All Operatives] Red Scan (+30% Damage)",
|
||||||
"value": 1.3,
|
"value": 1.3,
|
||||||
"type": "multiplicative",
|
"type": "multiplicative",
|
||||||
"operatives": ""
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "damage-ability-multiplicative-red-scan",
|
"id": "damage-ability-multiplicative-red-scan",
|
||||||
"label": "[All Operatives] Green Scan (+50% Damage)",
|
"label": "[All Operatives] Green Scan (+50% Damage)",
|
||||||
"value": 1.5,
|
"value": 1.5,
|
||||||
"type": "multiplicative",
|
"type": "multiplicative",
|
||||||
"operatives": ""
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "damage-ability-multiplicative-point-out",
|
"id": "damage-ability-multiplicative-point-out",
|
||||||
"label": "[All Operatives] Point Out (+50% Damage)",
|
"label": "[All Operatives] Point Out (+50% Damage)",
|
||||||
"value": 1.5,
|
"value": 1.5,
|
||||||
"type": "multiplicative",
|
"type": "multiplicative",
|
||||||
"operatives": ""
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "damage-item-additive-5-uiu-elite",
|
"id": "damage-item-additive-5-uiu-elite",
|
||||||
"label": "[All Operatives] 5 UIU Elite nearby (+25 damage)",
|
"label": "[All Operatives] 5 UIU Elite nearby (+25 damage)",
|
||||||
"value": 25,
|
"value": 25,
|
||||||
"type": "additive",
|
"type": "additive",
|
||||||
"operatives": ""
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "damage-item-additive-field-support",
|
"id": "damage-item-additive-field-support",
|
||||||
"label": "[All Operatives] MTF Commander Field Support (+8 damage)",
|
"label": "[All Operatives] MTF Commander Field Support (+8 damage)",
|
||||||
"value": 8,
|
"value": 8,
|
||||||
"type": "additive",
|
"type": "additive",
|
||||||
"operatives": ""
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "damage-ability-multiplicative-scan grenade",
|
||||||
|
"label": "[All Operatives] Scan Grenade (+15% Damage)",
|
||||||
|
"value": 1.15,
|
||||||
|
"type": "multiplicative",
|
||||||
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "damage-upgrade-multiplicative-upgraded-bullets",
|
||||||
|
"label": "[All Operatives] Experimental Bullets (+30% Damage)",
|
||||||
|
"value": 1.3,
|
||||||
|
"type": "multiplicative",
|
||||||
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "damage-item-additive-GOC",
|
||||||
|
"label": "[All Operatives] GOC Ally (+8 damage)",
|
||||||
|
"value": 8,
|
||||||
|
"type": "additive",
|
||||||
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "damage-item-additive-GOC-1",
|
||||||
|
"label": "[All Operatives] Weak Points (+8 damage)",
|
||||||
|
"value": 8,
|
||||||
|
"type": "additive",
|
||||||
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "damage-item-additive-GOC-3",
|
||||||
|
"label": "[All Operatives] GOC Ally: Kraken Buff (+3 damage)",
|
||||||
|
"value": 3,
|
||||||
|
"type": "additive",
|
||||||
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "damage-item-additive-uiu-1",
|
||||||
|
"label": "[All Operatives] UIU Upgraded Towers (+20% damage)",
|
||||||
|
"value": 1.2,
|
||||||
|
"type": "multiplicative",
|
||||||
|
"operatives": "",
|
||||||
|
"appliesTo": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user