Skip to content

Commit

Permalink
Reduce gear pool size, prevent bosses using other bosses gear, update…
Browse files Browse the repository at this point in the history
… sniper equipment and weighting
  • Loading branch information
Andrewgdewar committed Dec 29, 2024
1 parent 5daeaf3 commit 0fb4b4d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 17 deletions.
6 changes: 3 additions & 3 deletions config/nonPmcBotConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scavLootBlacklist": [],
"additionalScavLoot": ["5c94bbff86f7747ee735c08f"],
"botAmmoRandomness": 0.1,
"botEquipmentRandomness": 0.1,
"botEquipmentRandomness": 0.3,
"nonPmcBots": {
"infectedpmc": {
"tiers": [
Expand Down Expand Up @@ -80,8 +80,8 @@
],
"AllowSniperRifles": true,
"HasModdedWeapons": false,
"FirstPrimaryWeapon": [0.4, 0.8],
"Backpack": [0.1, 0.3],
"FirstPrimaryWeapon": [0, 0.8],
"Backpack": [0, 0.3],
"Ammo": [0.3, 0.8],
"ArmorVest": [0.3, 0.6],
"TacticalVest": [0.3, 0.6],
Expand Down
Binary file removed dist/AlgorithmicLevelProgression-5.4.2.zip
Binary file not shown.
Binary file added dist/AlgorithmicLevelProgression-5.4.3.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": "AlgorithmicLevelProgression",
"version": "5.4.2",
"version": "5.4.3",
"main": "src/mod.js",
"license": "MIT",
"author": "DewardianDev",
Expand Down
28 changes: 19 additions & 9 deletions src/NonPmcBotChanges/NonPmcUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export const buldTieredItemTypes = (items: Record<string, ITemplateItem>) => {
const result = {};

botWeights.forEach((weight, index) => {
if (index < 4) // Prevents boss related gear appearing on normal bots
if (index < 4)
// Prevents boss related gear appearing on normal bots
for (const key in weight.equipment.edit) {
Object.keys(weight.equipment.edit[key]).forEach((id) => {
if (blackList.has(id)) return;
Expand Down Expand Up @@ -196,7 +197,8 @@ export const normalizeMedianInventoryValues = (inventory: IInventory) => {
export const addItemsToBotInventory = (
inventory: IInventory,
botToUpdate: BotUpdateInterface,
items: Record<string, ITemplateItem>
items: Record<string, ITemplateItem>,
isMarksman = false
) => {
const { Ammo: botToUpdateAmmo, BasePlateChance, ...equipment } = botToUpdate;

Expand All @@ -215,13 +217,21 @@ export const addItemsToBotInventory = (
.slice(startIndex, endIndex)
.forEach(({ id, value }) => {
if (
!botToUpdate.AllowSniperRifles &&
checkParentRecursive(id, items, [
weaponTypeNameToId.SniperRifle,
weaponTypeNameToId.MarksmanRifle,
])
(!botToUpdate.AllowSniperRifles &&
checkParentRecursive(id, items, [
weaponTypeNameToId.SniperRifle,
weaponTypeNameToId.MarksmanRifle,
])) ||
(isMarksman &&
key === "FirstPrimaryWeapon" &&
!checkParentRecursive(id, items, [
weaponTypeNameToId.SniperRifle,
weaponTypeNameToId.MarksmanRifle,
weaponTypeNameToId.AssaultCarbine,
]))
) {
// console.log(items[id]._name);
// if (isMarksman && key === "FirstPrimaryWeapon")
// console.log(items[id]._name);
return;
}

Expand Down Expand Up @@ -253,7 +263,7 @@ export const addItemsToBotInventory = (
break;
}
inventory.mods[id] = mappedPresets[id];

// if (isMarksman) console.log(items[id]._name);
if (cachedInventory.mods[id]["patron_in_weapon"]) {
mappedPresets[id]["patron_in_weapon"] =
cachedInventory.mods[id]["patron_in_weapon"];
Expand Down
14 changes: 10 additions & 4 deletions src/NonPmcBotChanges/SetupNonPMCBotChanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ export default function SetupNonPMCBotChanges(
// saveToFile(tables.bots.types[name].inventory, `refDBS/marksman.json`);
// }
// console.log("\n", name);
addItemsToBotInventory(inventory, nonPmcBotConfig.nonPmcBots[name], items);

addItemsToBotInventory(
inventory,
nonPmcBotConfig.nonPmcBots[name],
items,
name === "marksman"
);

if (nonPmcBotConfig.nonPmcBots[name].HasModdedWeapons) {
inventory.mods = tables.bots.types.usec.inventory.mods;
Expand All @@ -101,9 +107,9 @@ export default function SetupNonPMCBotChanges(
);

applyValuesToStoredEquipment(inventory, items, storedEquipmentValues);

// if (name === "assault") {
// saveToFile(tables.bots.types[name].inventory, `refDBS/assault1.json`);
// if (name === "marksman") {
// saveToFile(tables.bots.types[name].inventory, `refDBS/marksman2.json`);
// }

globalValues.storedEquipmentValues[name] = storedEquipmentValues;
Expand Down

0 comments on commit 0fb4b4d

Please sign in to comment.