Skip to content

Commit

Permalink
Merge pull request #4 from ArchangelWTF/dev
Browse files Browse the repository at this point in the history
Dev -> Master (2.4.0)
  • Loading branch information
ArchangelWTF authored Nov 26, 2024
2 parents a4ac6ab + c45226a commit decb2b5
Show file tree
Hide file tree
Showing 338 changed files with 5,553 additions and 4,049 deletions.
4 changes: 2 additions & 2 deletions .buildignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/.buildignore
/.DS_Store
/.editorconfig
/.eslintignore
/.eslintrc.json
/.git
/.github
/.gitignore
/.gitlab
/.nvmrc
/.prettierrc
/.vscode
/biome.json
/README.md
/build.mjs
/dist
/images
Expand Down
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

98 changes: 0 additions & 98 deletions .eslintrc.json

This file was deleted.

4 changes: 3 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright (c) 2024 RainbowPC
Copyright (c) 2024 ArchangelWTF

Copyright (c) 2022-2024 RainbowPC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
43 changes: 43 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 320
},
"javascript": {
"parser": {
"unsafeParameterDecoratorsEnabled": true
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"complexity": {
"noStaticOnlyClass": "off"
},
"correctness": {
"noUndeclaredVariables": "error",
"noUnusedVariables": "error"
},
"performance": {
"noDelete": "warn"
},
"style": {
"useImportType": "off",
"noNamespace": "error"
},
"suspicious": {
"noEmptyBlockStatements": "error"
}
}
},
"files": {
"ignore": ["**/node_modules", "dist", "types", "build.mjs", "**/package-lock.json"]
}
}
6 changes: 3 additions & 3 deletions config/config.json5
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"disableFleaRestrictions": false,
//Allows the rusted key room on Streets of Tarkov to also spawn keycards
"rustedKeyRoomIncludesKeycards": false,
//Changes the max amount of items spawned in Loose Containers, Value: 0 - 1
//Changes the max amount of items spawned in Loose Containers (things like item cases, docs cases and such.. Setting this to 0 will turn this behavior off.) | Value: 0 - 1
"looseContainerModifier": 1,
//Changes the max amount of items spawned in Backpacks, Value: 0 - 1
//Changes the max amount of items spawned in Backpacks spawned in the world (Setting this to 0 will turn this off.) | Value: 0 - 1
"looseBackpackModifier": 1,
//Cheaper items are more likely to spawn in containers
"itemWeights": true,
Expand Down Expand Up @@ -65,7 +65,7 @@
"laboratory": 25000,
"rezervbase": 40000,
"shoreline": 15000,
"woods": 7500,
"woods": 10000,
"tarkovstreets": 50000,
"lighthouse": 20000,
"sandbox": 15000,
Expand Down
20 changes: 9 additions & 11 deletions mod.code-workspace
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"folders": [
{
"path": "."
}
],
"extensions": {
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
}
"folders": [
{
"path": "."
}
],
"extensions": {
"recommendations": ["biomejs.biome"]
}
}
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
{
"name": "LotsOfLoot Redux",
"version": "2.3.0",
"version": "2.4.0",
"main": "src/mod.js",
"license": "MIT",
"author": "ArchangelWTF",
"sptVersion": "~3.9",
"loadBefore": [],
"loadAfter": [],
"incompatibilities": [],
"contributors": ["RainbowPC"],
"isBundleMod": false,
"sptVersion": "~3.10",
"loadBefore": [],
"loadAfter": [],
"incompatibilities": [],
"contributors": ["RainbowPC"],
"isBundleMod": false,
"scripts": {
"setup": "npm i",
"lint": "npx @biomejs/biome lint ./",
"format": "npx @biomejs/biome check --write ./",
"build": "node ./build.mjs",
"buildinfo": "node ./build.mjs --verbose"
},
"devDependencies": {
"@types/node": "20.11",
"@typescript-eslint/eslint-plugin": "7.2",
"@typescript-eslint/parser": "7.2",
"@types/node": "~20.11",
"@biomejs/biome": "1.8.3",
"archiver": "^6.0",
"eslint": "8.57",
"fs-extra": "11.2",
"fs-extra": "~11.2",
"ignore": "^5.2",
"os": "^0.1",
"tsyringe": "4.8.0",
"typescript": "5.4",
"winston": "3.12",
"json5": "2.2.3"
"tsyringe": "~4.8",
"typescript": "~5.4",
"winston": "~3.13",
"json5": "~2.2"
}
}
2 changes: 1 addition & 1 deletion src/ILotsofLootConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export interface MarkedRoomConfig {
multiplier: Record<string, number>;
extraItems: Record<string, number>;
itemGroups: Record<string, number>;
}
}
42 changes: 42 additions & 0 deletions src/LotsofLoot.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { DependencyContainer, inject, injectable } from "tsyringe";

import { LocationLootGeneratorOverrides } from "./overrides/LocationLootGeneratorOverrides";
import { LotsofLootLogger } from "./utils/LotsofLootLogger";
import { LotsofLootController } from "./controllers/LotsofLootController";
import { LotsofLootMarkedRoomController } from "./controllers/LotsofLootMarkedRoomController";
import { LocationLootGenerator } from "@spt/generators/LocationLootGenerator";

@injectable()
export class LotsofLoot {
constructor(
@inject("LocationLootGeneratorOverrides") protected locationLootGeneratorOverrides: LocationLootGeneratorOverrides,
@inject("LotsofLootController") protected lotsofLootController: LotsofLootController,
@inject("LotsofLootMarkedRoomController") protected lotsofLootMarkedRoomController: LotsofLootMarkedRoomController,
@inject("LotsofLootLogger") protected logger: LotsofLootLogger,
) {
}

public async preSptLoadAsync(container: DependencyContainer): Promise<void> {
container.afterResolution(
"LocationLootGenerator",
(_t, result: LocationLootGenerator) => {
//Temporary cast to get rid of protected error
(result as any).createStaticLootItem = (tpl, staticAmmoDist, parentId) => {
return this.locationLootGeneratorOverrides.createStaticLootItem(tpl, staticAmmoDist, parentId);
};

result.generateDynamicLoot = (dynamicLootDist, staticAmmoDist, locationName) => {
return this.locationLootGeneratorOverrides.generateDynamicLoot(dynamicLootDist, staticAmmoDist, locationName);
};
},
{ frequency: "Always" },
);
}

public async postDBLoadAsync(_container: DependencyContainer): Promise<void> {
await this.lotsofLootController.applyLotsOfLootModifications();
await this.lotsofLootMarkedRoomController.adjustMarkedRoomItems();

this.logger.logInfo(`Finished loading`);
}
}
Loading

0 comments on commit decb2b5

Please sign in to comment.