Restrict to one slot wide

This commit is contained in:
Platinum 2023-06-11 16:13:19 +10:00
parent f67e582e08
commit 459ec0d101
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,4 @@
{ {
"minMagazineSizeToBeIncluded": 30, "minMagazineCapacityToBeIncluded": 40,
"maxMagazineSizeToBeIncluded": 60, "maxMagazineCapacityToBeIncluded": 50
"newMagazineInventorySlotSize": 2
} }

View File

@ -35,20 +35,22 @@ class TwoSlotExtendedMags implements IPostDBLoadMod {
} }
private updateInventorySlotSize(itemProp: Props): void { private updateInventorySlotSize(itemProp: Props): void {
itemProp.Height = config.newMagazineInventorySlotSize; itemProp.Height = 2;
// itemProp.ExtraSizeDown = config.newMagazineInventorySlotSize--; // itemProp.ExtraSizeDown = config.newMagazineInventorySlotSize--;
} }
private isExtendedMag(item: ITemplateItem): boolean { private isExtendedMag(item: ITemplateItem): boolean {
const magazineCategoryId = "5448bc234bdc2d3c308b4569"; const magazineCategoryId = "5448bc234bdc2d3c308b4569";
return item._parent == magazineCategoryId && this.isMagazineSizeWithinCapacity(item._props); return item._parent == magazineCategoryId &&
item._props.Width == 1 && // We don't want to make horizontal mags like P90's to be 4 squares wide or change drum mags (for now)
this.isWithinMagazineSizeCapacity(item._props);
} }
private isMagazineSizeWithinCapacity(itemProp: Props): boolean { private isWithinMagazineSizeCapacity(itemProp: Props): boolean {
const capacity = this.getMagazineCapacity(itemProp); const capacity = this.getMagazineCapacity(itemProp);
return capacity >= config.minMagazineSizeToBeIncluded && capacity <= config.maxMagazineSizeToBeIncluded; return capacity >= config.minMagazineCapacityToBeIncluded && capacity <= config.maxMagazineCapacityToBeIncluded;
} }
private getMagazineCapacity(itemProp: Props): number { private getMagazineCapacity(itemProp: Props): number {