New WIP feature
Prevent scav karma gain/lose
This commit is contained in:
parent
76c13d8d0a
commit
0abe190363
@ -37,19 +37,17 @@ class PlayerModifications {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Remove fall damages
|
//Remove fall damages
|
||||||
if(config.player.DisableFallDamage === true){
|
if (config.player.DisableFallDamage === true) {
|
||||||
globals.Health.Falling.SafeHeight = 200
|
globals.Health.Falling.SafeHeight = 200
|
||||||
globals.Health.Falling.DamagePerMeter = 0
|
globals.Health.Falling.DamagePerMeter = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
//PreventScavKarma
|
|
||||||
|
|
||||||
//Change staminas (unlimited or no)
|
//Change staminas (unlimited or no)
|
||||||
if (typeof config.player.ChangeMaxStamina == "number" && config.player.UnlimitedStamina === false) {
|
if (typeof config.player.ChangeMaxStamina == "number" && config.player.UnlimitedStamina === false) {
|
||||||
globals.Stamina.Capacity = config.player.ChangeMaxStamina
|
globals.Stamina.Capacity = config.player.ChangeMaxStamina
|
||||||
} else if (config.player.ChangeMaxStamina === false && config.player.UnlimitedStamina === true) {
|
} else if (config.player.ChangeMaxStamina === false && config.player.UnlimitedStamina === true) {
|
||||||
globals.Stamina.Capacity = 500,
|
globals.Stamina.Capacity = 500,
|
||||||
globals.Stamina.BaseRestorationRate = 500;
|
globals.Stamina.BaseRestorationRate = 500;
|
||||||
globals.Stamina.StaminaExhaustionCausesJiggle = false;
|
globals.Stamina.StaminaExhaustionCausesJiggle = false;
|
||||||
globals.Stamina.StaminaExhaustionStartsBreathSound = false;
|
globals.Stamina.StaminaExhaustionStartsBreathSound = false;
|
||||||
globals.Stamina.StaminaExhaustionRocksCamera = false;
|
globals.Stamina.StaminaExhaustionRocksCamera = false;
|
||||||
@ -77,14 +75,20 @@ class PlayerModifications {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//PreventScavKarma
|
||||||
|
if (config.player.RemoveScavKarma == true) {
|
||||||
|
ProfileController.generateScav = this.generateScav
|
||||||
|
}
|
||||||
|
|
||||||
function maxSkills(url, info, sessionID) {
|
function maxSkills(url, info, sessionID) {
|
||||||
const config = require("../config/config.json")
|
const config = require("../config/config.json")
|
||||||
let pmcData = null
|
let pmcData = null
|
||||||
|
|
||||||
if (sessionID) {
|
if (sessionID) {
|
||||||
pmcData = ProfileController.getPmcProfile(sessionID);
|
pmcData = ProfileController.getPmcProfile(sessionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pmcData !== null) {
|
if (pmcData !== null) {
|
||||||
if (pmcData.Skills.Common.length > 0 && pmcData.Skills.Common !== undefined) {
|
if (pmcData.Skills.Common.length > 0 && pmcData.Skills.Common !== undefined) {
|
||||||
for (let skills in pmcData.Skills.Common) {
|
for (let skills in pmcData.Skills.Common) {
|
||||||
@ -118,7 +122,36 @@ 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = PlayerModifications;
|
module.exports = PlayerModifications;
|
Loading…
x
Reference in New Issue
Block a user