From 5007b943e18c7f3ce18c66cb281f60d1266ea5f5 Mon Sep 17 00:00:00 2001 From: Ereshkigal Date: Thu, 12 Aug 2021 19:00:46 +0200 Subject: [PATCH] Energy & Hydratation drain rate and speed + improvement to cheap traders --- ZEreshkigal-AllinOneMod/config/config.json | 6 ++++-- ZEreshkigal-AllinOneMod/config/errors.json | 6 +++++- ZEreshkigal-AllinOneMod/src/player.js | 21 +++++++++++++++++++++ ZEreshkigal-AllinOneMod/src/traders.js | 19 +++++++++++++++++-- ZEreshkigal-AllinOneMod/src/warnings.js | 13 ++++++++++++- 5 files changed, 59 insertions(+), 6 deletions(-) diff --git a/ZEreshkigal-AllinOneMod/config/config.json b/ZEreshkigal-AllinOneMod/config/config.json index 998e5e5..05bdb8d 100644 --- a/ZEreshkigal-AllinOneMod/config/config.json +++ b/ZEreshkigal-AllinOneMod/config/config.json @@ -67,8 +67,10 @@ "EnableSkillBotReload": false, "EnableSkillBotSound": false, "RemoveScavKarma": false, - "EnergyDrainRate": false, - "HydratationDrainRate": false + "EnergyDrainRate": 50.0, + "EnergyDrainTime": 60, + "HydratationDrainRate": 50.0, + "HydratationDrainTime": 60 }, "traders": { "AllQuestsAvailable": false, diff --git a/ZEreshkigal-AllinOneMod/config/errors.json b/ZEreshkigal-AllinOneMod/config/errors.json index 9ea4ed6..fc261e1 100644 --- a/ZEreshkigal-AllinOneMod/config/errors.json +++ b/ZEreshkigal-AllinOneMod/config/errors.json @@ -46,7 +46,11 @@ "AllSkillsMaster": "AllSkillsMaster option is incorrect, it must be a boolean in order to work (true or false). Check back readme.pdf to ensure you use the correct value.", "EnableSkillBotReload": "EnableSkillBotReload option is incorrect, it must be a boolean in order to work (true or false). Check back readme.pdf to ensure you use the correct value.", "EnableSkillBotSound": "EnableSkillBotSound option is incorrect, it must be a boolean in order to work (true or false). Check back readme.pdf to ensure you use the correct value.", - "DisableFallDamage": "DisableFallDamage option is incorrect, it must be a boolean in order to work (true or false). Check back readme.pdf to ensure you use the correct value." + "DisableFallDamage": "DisableFallDamage option is incorrect, it must be a boolean in order to work (true or false). Check back readme.pdf to ensure you use the correct value.", + "EnergyDrainRate": "EnergyDrainRate option is incorrect, it must be a boolean in order to work (false or number). Check back readme.pdf to ensure you use the correct value.", + "EnergyDrainTime": "EnergyDrainTime option is incorrect, it must be a boolean in order to work (false or number). Check back readme.pdf to ensure you use the correct value.", + "HydratationDrainRate": "HydratationDrainRate option is incorrect, it must be a boolean in order to work (false or number). Check back readme.pdf to ensure you use the correct value.", + "HydratationDrainTime": "HydratationDrainTime option is incorrect, it must be a boolean in order to work (false or number). Check back readme.pdf to ensure you use the correct value." }, "traders": { "AllQuestsAvailable": "AllQuestsAvailable option is incorrect, it must be a boolean in order to work (true or false). Check back readme.pdf to ensure you use the correct value.", diff --git a/ZEreshkigal-AllinOneMod/src/player.js b/ZEreshkigal-AllinOneMod/src/player.js index 37a1a93..d34c25e 100644 --- a/ZEreshkigal-AllinOneMod/src/player.js +++ b/ZEreshkigal-AllinOneMod/src/player.js @@ -11,6 +11,27 @@ class PlayerModifications { const database = DatabaseServer.tables; const globals = database.globals.config; + + //Hydratation rate + if(typeof config.player.HydratationDrainRate === "number"){ + globals.Health.Effects.Existence.HydrationDamage = config.player.HydratationDrainRate + } + + //Hydratation rate + if(typeof config.player.HydratationDrainTime === "number"){ + globals.Health.Effects.Existence.HydrationLoopTime = config.player.HydratationDrainTime + } + + //Energy rate + if(typeof config.player.EnergyDrainRate === "number"){ + globals.Health.Effects.Existence.EnergyDamage = config.player.EnergyDrainRate + } + + //Energy rate + if(typeof config.player.EnergyDrainTime === "number"){ + globals.Health.Effects.Existence.EnergyLoopTime = config.player.EnergyDrainTime + } + //Remove scav timer if (config.player.RemoveScavTimer === true) { globals.SavagePlayCooldown = 1; diff --git a/ZEreshkigal-AllinOneMod/src/traders.js b/ZEreshkigal-AllinOneMod/src/traders.js index dca4fc7..8566604 100644 --- a/ZEreshkigal-AllinOneMod/src/traders.js +++ b/ZEreshkigal-AllinOneMod/src/traders.js @@ -84,13 +84,28 @@ class TradersModifications { for(const trader in traders){ for(const assort in traders[trader].assort.barter_scheme){ let itemScheme = traders[trader].assort.barter_scheme[assort]; - if(itemScheme[0][0]._tpl === "5449016a4bdc2d6f028b456f"){ //Roubles + switch(itemScheme[0][0]._tpl){ + case "5449016a4bdc2d6f028b456f": //Roubles + itemScheme[0][0].count = itemScheme[0][0].count * 0.01; + break; + case "5696686a4bdc2da3298b456a": //Dollars + itemScheme[0][0].count = itemScheme[0][0].count * 0.1; + break; + case "5696686a4bdc2da3298b456a": //Euros + itemScheme[0][0].count = itemScheme[0][0].count * 0.05; + break; + default: + Logger.error(`${itemScheme[0][0]} does not exist. A mod might cause it.`) + break; + } + + /*if(itemScheme[0][0]._tpl === "5449016a4bdc2d6f028b456f"){ //Roubles itemScheme[0][0].count = itemScheme[0][0].count * 0.01; }else if(itemScheme[0][0]._tpl === "5696686a4bdc2da3298b456a"){ //Dollars itemScheme[0][0].count = itemScheme[0][0].count * 0.1; }else if(itemScheme[0][0]._tpl === "5696686a4bdc2da3298b456a"){ //euros itemScheme[0][0].count = itemScheme[0][0].count * 0.05; - } + }*/ } } } diff --git a/ZEreshkigal-AllinOneMod/src/warnings.js b/ZEreshkigal-AllinOneMod/src/warnings.js index a9f5b36..c0d634f 100644 --- a/ZEreshkigal-AllinOneMod/src/warnings.js +++ b/ZEreshkigal-AllinOneMod/src/warnings.js @@ -16,7 +16,18 @@ class Warnings { Logger.log(`Please, take care of reading the readme.pdf of the mod before using it. It contains all configurations explanations.`, "white", "red"); Logger.log(`[AIO Mod INFORMATION]`, "white", "red"); } - + if (typeof config.player.HydratationDrainRate !== "number" && config.player.HydratationDrainRate != "false") { + OtherModitication.CustomWarning("AIO Mod", errors.player.HydratationDrainRate) + } + if (typeof config.player.HydratationDrainTime !== "number" && config.player.HydratationDrainTime != "false") { + OtherModitication.CustomWarning("AIO Mod", errors.player.HydratationDrainTime) + } + if (typeof config.player.EnergyDrainRate !== "number" && config.player.EnergyDrainRate != "false") { + OtherModitication.CustomWarning("AIO Mod", errors.player.EnergyDrainRate) + } + if (typeof config.player.EnergyDrainTime !== "number" && config.player.EnergyDrainTime != "false") { + OtherModitication.CustomWarning("AIO Mod", errors.player.EnergyDrainTime) + } if (typeof config.items.ChangeIndividualItemProperty.activated !== "boolean") { OtherModitication.CustomWarning("AIO Mod", errors.items.ChangeIndividualItemProperty.activated) }