mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-12 22:26:12 -05:00
Clean up the object-dmg.json
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user