Add faceshield bullet clearing and faceshield view change option.

This commit is contained in:
dvize
2023-06-29 13:04:19 -07:00
parent 3e3ad1320a
commit d00c6cf3a8
4 changed files with 346 additions and 56 deletions

View File

@@ -1,13 +1,13 @@
using System;
using Aki.Reflection.Patching;
using System.Reflection;
using Aki.Reflection.Patching;
using BepInEx;
using BepInEx.Configuration;
using EFT;
namespace armorMod
{
[BepInPlugin("com.armorMod.ASS", "armorMod.ASS", "1.3.0")]
[BepInPlugin("com.dvize.ASS", "dvize.ASS", "1.3.0")]
public class AssPlugin : BaseUnityPlugin
{
@@ -15,6 +15,10 @@ namespace armorMod
{
get; set;
}
internal static ConfigEntry<Boolean> WeaponServiceMode
{
get; set;
}
/*private ConfigEntry<Boolean> LoseInsuranceOnRepair
{
get; set;
@@ -35,15 +39,67 @@ namespace armorMod
{
get; set;
}
internal static ConfigEntry<float> weaponTimeDelayRepairInSec
{
get; set;
}
internal static ConfigEntry<float> weaponRepairRateOverTime
{
get; set;
}
internal static ConfigEntry<float> weaponMaxDurabilityDegradationRateOverTime
{
get; set;
}
internal static ConfigEntry<float> weaponMaxDurabilityCap
{
get; set;
}
internal static ConfigEntry<Boolean> fixFaceShieldBullets
{
get; set;
}
internal static ConfigEntry<Boolean> faceShieldNoMask
{
get; set;
}
internal void Awake()
{
ArmorServiceMode = Config.Bind("Armor Repair Settings", "Enable/Disable Mod", true, "Enables the Armor Repairing Options Below");
ArmorServiceMode = Config.Bind("Main Settings", "Enable/Disable Armor Repair", true, new ConfigDescription("Enables the Armor Repairing Options Below",
null, new ConfigurationManagerAttributes { IsAdvanced = false, Order = 2 }));
WeaponServiceMode = Config.Bind("Main Settings", "Enable/Disable Weapon Repair", true, new ConfigDescription("Enables the Weapon Repairing Options Below",
null, new ConfigurationManagerAttributes { IsAdvanced = false, Order = 1 }));
/*LoseInsuranceOnRepair = Config.Bind("Armor Repair Settings", "Lose Insurance On Repair", true, "If Enabled, you will lose insurance on whenever the armor is repaired in-raid");*/
TimeDelayRepairInSec = Config.Bind("Armor Repair Settings", "Time Delay Repair in Sec", 60f, "How Long Before you were last hit that it repairs armor");
ArmorRepairRateOverTime = Config.Bind("Armor Repair Settings", "Armor Repair Rate", 0.5f, "How much durability per second is repaired");
MaxDurabilityDegradationRateOverTime = Config.Bind("Armor Repair Settings", "Max Durability Drain Rate", 0.025f, "How much max durability per second of repairs is drained");
MaxDurabilityCap = Config.Bind("Armor Repair Settings", "Max Durability Cap", 100f, "Maximum durability percentage to which armor will be able to repair to. For example, setting to 80 would repair your armor to maximum of 80% of it's max durability");
TimeDelayRepairInSec = Config.Bind("Armor Repair Settings", "Time Delay Repair in Sec", 60f, new ConfigDescription("How Long Before you were last hit that it repairs armor",
new AcceptableValueRange<float>(0f, 1200f), new ConfigurationManagerAttributes { IsAdvanced = false, Order = 5 }));
ArmorRepairRateOverTime = Config.Bind("Armor Repair Settings", "Armor Repair Rate", 0.5f, new ConfigDescription("How much durability per second is repaired",
new AcceptableValueRange<float>(0f, 10f), new ConfigurationManagerAttributes { IsAdvanced = false, Order = 4 }));
MaxDurabilityDegradationRateOverTime = Config.Bind("Armor Repair Settings", "Max Durability Drain Rate", 0.025f, new ConfigDescription("How much max durability per second of repairs is drained",
new AcceptableValueRange<float>(0f, 1f), new ConfigurationManagerAttributes { IsAdvanced = false, Order = 3 }));
MaxDurabilityCap = Config.Bind("Armor Repair Settings", "Max Durability Cap", 100f, new ConfigDescription("Maximum durability percentage to which armor will be able to repair to. For example, setting to 80 would repair your armor to maximum of 80% of it's max durability",
new AcceptableValueRange<float>(0f, 100f), new ConfigurationManagerAttributes { IsAdvanced = false, Order = 2 }));
weaponTimeDelayRepairInSec = Config.Bind("Weapon Repair Settings", "Time Delay Repair in Sec", 60f, new ConfigDescription("How Long Before you were last hit that it repairs weapon. Doesn't Make sense but i'm too lazy to change.",
new AcceptableValueRange<float>(0f, 1200f), new ConfigurationManagerAttributes { IsAdvanced = false, Order = 5 }));
weaponRepairRateOverTime = Config.Bind("Weapon Repair Settings", "Weapon Repair Rate", 0.5f, new ConfigDescription("How much durability per second is repaired",
new AcceptableValueRange<float>(0f, 10f), new ConfigurationManagerAttributes { IsAdvanced = false, Order = 4 }));
weaponMaxDurabilityDegradationRateOverTime = Config.Bind("Weapon Repair Settings", "Max Durability Drain Rate", 0f, new ConfigDescription("How much max durability per second of repairs is drained (set really low if using)",
new AcceptableValueRange<float>(0f, 1f), new ConfigurationManagerAttributes { IsAdvanced = false, Order = 3 }));
weaponMaxDurabilityCap = Config.Bind("Weapon Repair Settings", "Max Durability Cap", 100f, new ConfigDescription("Maximum durability percentage to which weapon will be able to repair to. For example, setting to 80 would repair your armor to maximum of 80% of it's max durability",
new AcceptableValueRange<float>(0f, 100f), new ConfigurationManagerAttributes { IsAdvanced = false, Order = 2 }));
fixFaceShieldBullets = Config.Bind("Face Shield", "Fix Bullet Cracks", true, new ConfigDescription("Enables Repairing Bullet Cracks in FaceShield",
null, new ConfigurationManagerAttributes { IsAdvanced = false, Order = 2 }));
faceShieldNoMask = Config.Bind("Face Shield", "Change Limited View to Full View", true, new ConfigDescription("Changes the Helmet Vision Mask if its blocking",
null, new ConfigurationManagerAttributes { IsAdvanced = false, Order = 1 }));
new NewGamePatch().Enable();
}