Skip to content

Commit

Permalink
2.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewgdewar committed Jan 1, 2025
1 parent f0f324d commit abe6893
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 8 deletions.
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.3",
"version": "2.6.4",
"main": "src/mod.js",
"license": "MIT",
"author": "DewardianDev",
Expand Down
11 changes: 9 additions & 2 deletions src/Spawning/buildPmcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default function buildPmcs(
return BotZoneName;
})
),
...pmcHotZones,
]);

// Make labs have only named zones
Expand Down Expand Up @@ -70,9 +69,17 @@ export default function buildPmcs(
`${map} PMC wave count changed from ${pmcWaveCount} to ${totalWaves} due to escapeTimeLimit adjustment`
);
}

const timeLimit = locationList[index].base.EscapeTimeLimit * 60;

const waves = buildPmcWaves(pmcWaveCount, timeLimit, config, pmcZones);
const waves = buildPmcWaves(
totalWaves,
timeLimit,
config,
pmcZones,
pmcHotZones
);

locationList[index].base.BossLocationSpawn = [
...waves,
...locationList[index].base.BossLocationSpawn,
Expand Down
31 changes: 27 additions & 4 deletions src/Spawning/updateSpawnLocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ export default function updateSpawnLocations(
// console.log(map);
const limit = mapConfig[map].spawnMinDistance;

const InfiltrationList = [
...new Set(
locationList[index].base.SpawnPointParams.filter(
({ Infiltration }) => Infiltration
).map(({ Infiltration }) => Infiltration)
),
];

// console.log(map, InfiltrationList);
const getRandomInfil = (): string =>
InfiltrationList[Math.floor(Math.random() * InfiltrationList.length)];
// console.log(InfiltrationList);
// console.log("\n" + map);
locationList[index].base.SpawnPointParams.forEach(
(
Expand All @@ -30,20 +42,22 @@ export default function updateSpawnLocations(
!BotZoneName?.toLowerCase().includes("snipe") &&
DelayToCanSpawnSec < 41
) {
// Make it so players can spawn anywhere.
// Make it so players/pmcs can spawn anywhere.
if (
config.playerOpenZones &&
!!Infiltration &&
(Sides.includes("Pmc") || Sides.includes("All")) &&
Categories.length === 1 &&
Categories[0] === "Player"
(Sides.includes("Pmc") || Sides.includes("All"))
) {
locationList[index].base.SpawnPointParams[innerIndex].Categories = [
"Player",
"Coop",
innerIndex % 2 === 0 ? "Group" : "Opposite",
];

locationList[index].base.SpawnPointParams[innerIndex].Sides = [
"Pmc",
"All",
];
// console.log(
// BotZoneName || "none",
// locationList[index].base.SpawnPointParams[innerIndex].Categories,
Expand All @@ -65,12 +79,21 @@ export default function updateSpawnLocations(

if (!Infiltration && config.allOpenZones) {
locationList[index].base.SpawnPointParams[innerIndex].Categories = [
"All",
"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",
];
}
Expand Down
17 changes: 16 additions & 1 deletion src/Spawning/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,31 @@ export const buildPmcWaves = (
pmcTotal: number,
escapeTimeLimit: number,
config: typeof _config,
bossZones: string[]
bossZones: string[],
hotZones: string[]
): IBossLocationSpawn[] => {
// console.log(pmcTotal)
if (!pmcTotal) return [];
const halfIndex = Math.round(bossZones.length * 0.75); //Put hotzones in the 2 - 4 spawns
// console.log(bossZones.length);
bossZones = [
...bossZones.slice(0, halfIndex),
...hotZones,
...bossZones.slice(halfIndex),
];

// console.log(bossZones.length, hotZones.length);
// console.log(bossZones);
pmcTotal = pmcTotal + hotZones.length;

let {
pmcMaxGroupSize,
pmcDifficulty,
startingPmcs,
morePmcGroups,
pmcWaveDistribution,
} = config;

const averageTime = (escapeTimeLimit * 0.8) / pmcTotal;

const waves: IBossLocationSpawn[] = [];
Expand Down

0 comments on commit abe6893

Please sign in to comment.