From ae09a7b2238b7047026e09c73277a517e3f6d6e2 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Wed, 15 May 2024 15:11:17 +0200 Subject: [PATCH] Add stomach modifier and bot metabolism setting --- Fika.Core/Coop/Players/CoopBot.cs | 5 +++++ Fika.Core/Coop/Players/CoopPlayer.cs | 5 +++++ Fika.Core/FikaPlugin.cs | 10 ++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Fika.Core/Coop/Players/CoopBot.cs b/Fika.Core/Coop/Players/CoopBot.cs index de3de920..052439e8 100644 --- a/Fika.Core/Coop/Players/CoopBot.cs +++ b/Fika.Core/Coop/Players/CoopBot.cs @@ -180,6 +180,11 @@ protected override void Start() { dynamicAi = gameObject.AddComponent(); } + + if (FikaPlugin.DisableBotMetabolism.Value) + { + HealthController.DisableMetabolism(); + } } public override void BtrInteraction() diff --git a/Fika.Core/Coop/Players/CoopPlayer.cs b/Fika.Core/Coop/Players/CoopPlayer.cs index 55600ece..ad186f65 100644 --- a/Fika.Core/Coop/Players/CoopPlayer.cs +++ b/Fika.Core/Coop/Players/CoopPlayer.cs @@ -218,6 +218,11 @@ public override void ApplyDamageInfo(DamageInfo damageInfo, EBodyPart bodyPartTy { damageInfo.Damage *= FikaPlugin.ArmpitDamageMultiplier.Value; } + + if (bodyPartType is EBodyPart.Stomach) + { + damageInfo.Damage *= FikaPlugin.StomachDamageMultiplier.Value; + } } base.ApplyDamageInfo(damageInfo, bodyPartType, colliderType, absorbed); diff --git a/Fika.Core/FikaPlugin.cs b/Fika.Core/FikaPlugin.cs index 0719446b..c4ed87ff 100644 --- a/Fika.Core/FikaPlugin.cs +++ b/Fika.Core/FikaPlugin.cs @@ -163,6 +163,8 @@ public class FikaPlugin : BaseUnityPlugin // Gameplay public static ConfigEntry HeadDamageMultiplier { get; set; } public static ConfigEntry ArmpitDamageMultiplier { get; set; } + public static ConfigEntry StomachDamageMultiplier { get; set; } + public static ConfigEntry DisableBotMetabolism { get; set; } #endregion #region client config @@ -367,9 +369,13 @@ private void SetupConfig() // Gameplay - HeadDamageMultiplier = Config.Bind("Gameplay", "Head Damage Multiplier", 1f, new ConfigDescription("X multiplier to damage taken on the head collider. 0.2 = 20%", new AcceptableValueRange(0.2f, 1f), new ConfigurationManagerAttributes() { Order = 2 })); + HeadDamageMultiplier = Config.Bind("Gameplay", "Head Damage Multiplier", 1f, new ConfigDescription("X multiplier to damage taken on the head collider. 0.2 = 20%", new AcceptableValueRange(0.2f, 1f), new ConfigurationManagerAttributes() { Order = 4 })); - ArmpitDamageMultiplier = Config.Bind("Gameplay", "Armpit Damage Multiplier", 1f, new ConfigDescription("X multiplier to damage taken on the armpits collider. 0.2 = 20%", new AcceptableValueRange(0.2f, 1f), new ConfigurationManagerAttributes() { Order = 1 })); + ArmpitDamageMultiplier = Config.Bind("Gameplay", "Armpit Damage Multiplier", 1f, new ConfigDescription("X multiplier to damage taken on the armpits collider. 0.2 = 20%", new AcceptableValueRange(0.2f, 1f), new ConfigurationManagerAttributes() { Order = 3 })); + + StomachDamageMultiplier = Config.Bind("Gameplay", "Stomach Damage Multiplier", 1f, new ConfigDescription("X multiplier to damage taken on the stomach collider. 0.2 = 20%", new AcceptableValueRange(0.2f, 1f), new ConfigurationManagerAttributes() { Order = 2 })); + + DisableBotMetabolism = Config.Bind("Gameplay", "Disable Bot Metabolism", false, new ConfigDescription("Disables metabolism on bots, preventing them from dying from loss of energy/hydration during long raids.", tags: new ConfigurationManagerAttributes() { Order = 1 })); } private string[] GetLocalAddresses()