Skip to content

Commit

Permalink
2.6.6 Boss update
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewgdewar committed Jan 3, 2025
1 parent 980798c commit f4dd4e8
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 62 deletions.
5 changes: 2 additions & 3 deletions config/Presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
"scavWaveQuantity": 1.2
},
"more-pmcs": {
"scavWaveDistribution": 0.4,
"morePmcGroups": true,
"pmcMaxGroupSize": 5,
"pmcWaveQuantity": 1.2
},
"more-scavs-and-pmcs": {
"maxBotCap": 30,
"scavWaveDistribution": 0.4,
"moreScavGroups": true,
"scavMaxGroupSize": 5,
"morePmcGroups": true,
Expand Down Expand Up @@ -39,8 +40,6 @@
"scavWaveDistribution": 0.4,
"scavWaveQuantity": 1.3,
"pmcWaveQuantity": 1.3,
"maxBotCap": 30,
"maxBotPerZone": 9,
"moreScavGroups": true,
"morePmcGroups": true,
"pmcMaxGroupSize": 6,
Expand Down
Binary file removed dist/DewardianDev-MOAR-2.6.5.zip
Binary file not shown.
Binary file added dist/DewardianDev-MOAR-2.6.6.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MOAR",
"version": "2.6.5",
"version": "2.6.6",
"main": "src/mod.js",
"license": "MIT",
"author": "DewardianDev",
Expand Down
8 changes: 4 additions & 4 deletions src/Routes/routes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DependencyContainer } from "tsyringe";
import { buildWaves } from "../Spawning/Spawning";
import { StaticRouterModService } from "@spt/services/mod/staticRouter/StaticRouterModService";
import { DynamicRouterModService } from "@spt/services/mod/dynamicRouter/DynamicRouterModService";
// import { DynamicRouterModService } from "@spt/services/mod/dynamicRouter/DynamicRouterModService";
import { globalValues } from "../GlobalValues";
import { kebabToTitle } from "../utils";
import PresetWeightingsConfig from "../../config/PresetWeightings.json";
Expand All @@ -11,9 +11,9 @@ export const setupRoutes = (container: DependencyContainer) => {
"StaticRouterModService"
);

const dynamicRouterModService = container.resolve<DynamicRouterModService>(
"DynamicRouterModService"
);
// const dynamicRouterModService = container.resolve<DynamicRouterModService>(
// "DynamicRouterModService"
// );

// Make buildwaves run on game end
staticRouterModService.registerStaticRouter(
Expand Down
14 changes: 7 additions & 7 deletions src/Spawning/Spawning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export const buildWaves = (container: DependencyContainer) => {
}
});

config.debug &&
console.log(
globalValues.forcedPreset === "custom"
? "custom"
: globalValues.currentPreset
);
// config.debug &&
console.log(
globalValues.forcedPreset === "custom"
? "custom"
: globalValues.currentPreset
);

const {
bigmap: customs,
Expand Down Expand Up @@ -147,7 +147,7 @@ export const buildWaves = (container: DependencyContainer) => {
}

buildPmcs(config, locationList);

originalMapList.forEach((name, index) => {
if (!locations[name]) {
console.log("[MOAR] OH CRAP we have a problem!", name);
Expand Down
35 changes: 17 additions & 18 deletions src/Spawning/buildBossWaves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,36 +139,20 @@ export function buildBossWaves(

for (let key = 0; key < locationList.length; key++) {
//Gather bosses to avoid duplicating.
let bossLocations = "";

const duplicateBosses = [
...locationList[key].base.BossLocationSpawn.filter(
({ BossName, BossZone }) => {
bossLocations += BossZone + ",";
return bossList.includes(BossName);
}
({ BossName, BossZone }) => bossList.includes(BossName)
).map(({ BossName }) => BossName),
"bossKnight", // So knight doesn't invade
];

const uniqueBossZones = bossOpenZones
? ""
: [
...new Set(
bossLocations
.split(",")
.filter(
(zone) => !!zone && !zone.toLowerCase().includes("snipe")
)
),
].join(",");

//Build bosses to add
const bossesToAdd = shuffle<IBossLocationSpawn[]>(Object.values(bosses))
.filter(({ BossName }) => !duplicateBosses.includes(BossName))
.map((boss, j) => ({
...boss,
BossZone: uniqueBossZones,
BossZone: "",
BossEscortAmount:
boss.BossEscortAmount === "0" ? boss.BossEscortAmount : "1",
...(gradualBossInvasion ? { Time: j * 20 + 1 } : {}),
Expand Down Expand Up @@ -268,7 +252,22 @@ export function buildBossWaves(
configLocations[index]
}: ${bossesToAdd.map(({ BossName }) => BossName)}`
);
// console.log(locationList[index].base.BossLocationSpawn.length);

// Apply the percentages on all bosses, cull those that won't spawn, make all bosses 100 chance that remain.
locationList[index].base.BossLocationSpawn = locationList[
index
].base.BossLocationSpawn.filter(({ BossChance, BossName }, bossIndex) => {
if (BossChance < 100 && BossChance / 100 < Math.random()) {
return false;
}
return true;
}).map((boss) => ({ ...boss, ...{ BossChance: 100 } }));

// if (mapName === "customs")
// console.log(mapName, locationList[index].base.BossLocationSpawn);
});

if (hasChangedBossSpawns) {
console.log(
`[MOAR]: --- Adjusting default boss spawn rates complete --- \n`
Expand Down
64 changes: 35 additions & 29 deletions src/Spawning/updateSpawnLocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,44 @@ export default function updateSpawnLocations(
// locationList[index].base.SpawnPointParams[innerIndex].Sides
// );
}
if (!Infiltration) {
if (
!config.allOpenZones &&
config.pmcOpenZones &&
Categories.includes("Bot") &&
Sides[0] === "Savage"
) {
locationList[index].base.SpawnPointParams[innerIndex].Categories =
["Player", "Bot"];
}

if (
!config.allOpenZones &&
config.pmcOpenZones &&
Categories.includes("Bot") &&
Sides[0] === "Savage" &&
!Infiltration
) {
locationList[index].base.SpawnPointParams[innerIndex].Categories = [
"Player",
"Bot",
];
}
if (config.allOpenZones) {
locationList[index].base.SpawnPointParams[innerIndex].Categories =
[
"Bot",
"Player",
"Coop",
innerIndex % 2 === 0 ? "Group" : "Opposite",
];

if (!Infiltration && config.allOpenZones) {
locationList[index].base.SpawnPointParams[innerIndex].Categories = [
"Bot",
"Player",
"Coop",
innerIndex % 2 === 0 ? "Group" : "Opposite",
];
locationList[index].base.SpawnPointParams[
innerIndex
].Infiltration = getRandomInfil();
// console.log(
// locationList[index].base.SpawnPointParams[innerIndex].Infiltration
// );
locationList[index].base.SpawnPointParams[innerIndex].Sides = [
"Pmc",
"Savage",
"All",
];
}

locationList[index].base.SpawnPointParams[innerIndex].Infiltration =
getRandomInfil();
// console.log(
// locationList[index].base.SpawnPointParams[innerIndex].Infiltration
// );
locationList[index].base.SpawnPointParams[innerIndex].Sides = [
"Pmc",
"Savage",
"All",
];
if (config.bossOpenZones && Categories.includes("Bot")) {
locationList[index].base.SpawnPointParams[
innerIndex
].Categories.push("Boss");
}
}

if (
Expand Down

0 comments on commit f4dd4e8

Please sign in to comment.