New WIP feature

Prevent scav karma gain/lose
This commit is contained in:
Ereshkigal 2021-06-30 20:25:43 +02:00
parent 76c13d8d0a
commit 0abe190363

View File

@ -37,19 +37,17 @@ class PlayerModifications {
}
//Remove fall damages
if(config.player.DisableFallDamage === true){
if (config.player.DisableFallDamage === true) {
globals.Health.Falling.SafeHeight = 200
globals.Health.Falling.DamagePerMeter = 0
}
//PreventScavKarma
//Change staminas (unlimited or no)
if (typeof config.player.ChangeMaxStamina == "number" && config.player.UnlimitedStamina === false) {
globals.Stamina.Capacity = config.player.ChangeMaxStamina
} else if (config.player.ChangeMaxStamina === false && config.player.UnlimitedStamina === true) {
globals.Stamina.Capacity = 500,
globals.Stamina.BaseRestorationRate = 500;
globals.Stamina.BaseRestorationRate = 500;
globals.Stamina.StaminaExhaustionCausesJiggle = false;
globals.Stamina.StaminaExhaustionStartsBreathSound = false;
globals.Stamina.StaminaExhaustionRocksCamera = false;
@ -77,6 +75,12 @@ class PlayerModifications {
}
//PreventScavKarma
if (config.player.RemoveScavKarma == true) {
ProfileController.generateScav = this.generateScav
}
function maxSkills(url, info, sessionID) {
const config = require("../config/config.json")
let pmcData = null
@ -118,6 +122,35 @@ class PlayerModifications {
}
}
static generateScav(sessionID) {
const pmcData = ProfileController.getPmcProfile(sessionID);
let scavData = BotController.generate({
"conditions": [{
"Role": "playerScav",
"Limit": 1,
"Difficulty": "normal"
}]
})[0];
// add proper metadata
scavData._id = pmcData.savage;
scavData.aid = sessionID;
scavData.Info.Settings = {
"StandingForKill": 0,
"AggressorBonus": 0
};
// remove secure container
scavData = InventoryHelper.removeSecureContainer(scavData);
// set cooldown timer
scavData = ProfileController.setScavCooldownTimer(scavData, pmcData);
// add scav to the profile
ProfileController.setScavProfile(sessionID, scavData);
return scavData;
}
}