Clean up the object-dmg.json

This commit is contained in:
Kalle
2023-06-23 10:40:44 +03:00
parent 5c6b61b892
commit 4adb396d56
2 changed files with 104 additions and 2915 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,12 @@ import subWeapons from "./dicts/WeaponInfoSub.json";
import specialWeapons from "./dicts/WeaponInfoSpecial.json";
import fs from "node:fs";
import path from "node:path";
import {
mainWeaponIds,
specialWeaponIds,
subWeaponIds,
} from "~/modules/in-game-lists";
import { DAMAGE_RECEIVERS } from "~/features/object-damage-calculator/calculator-constants";
const OUTPUT_DIR_PATH = path.join(__dirname, "output");
@@ -32,17 +38,36 @@ const weaponParamsToWeaponIds = (
const result = {};
for (const cell of Object.values(params.CellList)) {
if (!DAMAGE_RECEIVERS.includes(cell.ColumnKey)) continue;
if (!cell.DamageRate) continue;
if (!result[cell.RowKey]) {
result[cell.RowKey] = {
mainWeaponIds: weaponParamsToWeaponIds(weapons, cell.RowKey),
subWeaponIds: weaponParamsToWeaponIds(subWeapons, cell.RowKey),
specialWeaponIds: weaponParamsToWeaponIds(specialWeapons, cell.RowKey),
mainWeaponIds: weaponParamsToWeaponIds(weapons, cell.RowKey).filter(
(id) => mainWeaponIds.includes(id)
),
subWeaponIds: weaponParamsToWeaponIds(subWeapons, cell.RowKey).filter(
(id) => subWeaponIds.includes(id)
),
specialWeaponIds: weaponParamsToWeaponIds(
specialWeapons,
cell.RowKey
).filter((id) => specialWeaponIds.includes(id)),
rates: [],
};
}
// if it has applies to no PvP weapons, we don't care about it
if (
result[cell.RowKey].mainWeaponIds.length === 0 &&
result[cell.RowKey].subWeaponIds.length === 0 &&
result[cell.RowKey].specialWeaponIds.length === 0 &&
cell.RowKey !== "ObjectEffect_Up"
) {
result[cell.RowKey] = undefined;
continue;
}
result[cell.RowKey].rates.push({
target: cell.ColumnKey,
rate: cell.DamageRate,