mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-04 23:32:54 +01:00
somewhat through PrimaryArmorSceneComponent
This commit is contained in:
1 parent
488451d71f
commit
e18d6f58f9
13 files changed
+110
-66
No files matched your search
@@ -1,23 +0,0 @@
|
||||
import { api } from "../../api/dynamic";
|
||||
import type { EquipmentMatrix } from "../../stores/duel";
|
||||
|
||||
const equipmentDefinitions = await api.equipment();
|
||||
|
||||
export function hasEquipment(
|
||||
id: number,
|
||||
equipmentPreset: string,
|
||||
equipmentMatrix: EquipmentMatrix,
|
||||
) {
|
||||
const preset = equipmentDefinitions.presets[equipmentPreset];
|
||||
return preset.slots.some((slot, index) => {
|
||||
const row = Math.floor(index / 3);
|
||||
const column = index % 3;
|
||||
const choice = equipmentMatrix[row][column];
|
||||
|
||||
if (choice === 0) return false;
|
||||
|
||||
const equipped = slot[choice === -1 ? "left" : "right"];
|
||||
|
||||
return equipped === id;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user