Skip to content

Commit

Permalink
Add stomach modifier and bot metabolism setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 15, 2024
1 parent b5397fc commit ae09a7b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Fika.Core/Coop/Players/CoopBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ protected override void Start()
{
dynamicAi = gameObject.AddComponent<FikaDynamicAI>();
}

if (FikaPlugin.DisableBotMetabolism.Value)
{
HealthController.DisableMetabolism();
}
}

public override void BtrInteraction()
Expand Down
5 changes: 5 additions & 0 deletions Fika.Core/Coop/Players/CoopPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 8 additions & 2 deletions Fika.Core/FikaPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ public class FikaPlugin : BaseUnityPlugin
// Gameplay
public static ConfigEntry<float> HeadDamageMultiplier { get; set; }
public static ConfigEntry<float> ArmpitDamageMultiplier { get; set; }
public static ConfigEntry<float> StomachDamageMultiplier { get; set; }
public static ConfigEntry<bool> DisableBotMetabolism { get; set; }
#endregion

#region client config
Expand Down Expand Up @@ -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<float>(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<float>(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<float>(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<float>(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<float>(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()
Expand Down

0 comments on commit ae09a7b

Please sign in to comment.