diff --git a/Projects/SevenDaysToDie/.gitignore b/Projects/SevenDaysToDie/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/Projects/SevenDaysToDie/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/Projects/SevenDaysToDie/SevenDaysToDie.sln b/Projects/SevenDaysToDie/SevenDaysToDie.sln new file mode 100644 index 0000000..755cacc --- /dev/null +++ b/Projects/SevenDaysToDie/SevenDaysToDie.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SevenDaysToDie", "SevenDaysToDie\SevenDaysToDie.csproj", "{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Projects/SevenDaysToDie/SevenDaysToDie.sln.DotSettings.user b/Projects/SevenDaysToDie/SevenDaysToDie.sln.DotSettings.user new file mode 100644 index 0000000..958592d --- /dev/null +++ b/Projects/SevenDaysToDie/SevenDaysToDie.sln.DotSettings.user @@ -0,0 +1,8 @@ + + True + True + True + True + True + True + True \ No newline at end of file diff --git a/Projects/SevenDaysToDie/SevenDaysToDie/Class1.cs b/Projects/SevenDaysToDie/SevenDaysToDie/Class1.cs new file mode 100644 index 0000000..841e269 --- /dev/null +++ b/Projects/SevenDaysToDie/SevenDaysToDie/Class1.cs @@ -0,0 +1,114 @@ +using BepInEx.Configuration; +using HarmonyLib.Tools; +using MelonLoader; + +namespace SevenDaysToDie { + [assembly: MelonInfo(typeof(Main), "CykaMod", "1", "Cyka")] + public class Main : MelonMod { + private const string pluginGuid = "CykaMod"; + + public static ConfigEntry xpMultiplier; + public static ConfigEntry moneyMultiplier; + public static ConfigEntry energyGenMultiplier; + public static ConfigEntry heartbeatIntervalMultiplier; + public static ConfigEntry shootingSpeedMultiplier; + public static ConfigEntry muzzleVelocityMultiplier; + public static ConfigEntry allProjectilesHoming; + public static ConfigEntry magnetStrenghtMultiplier; + public static ConfigEntry magnetRadiusMultiplier; + public static ConfigEntry beamStrenghtMultiplier; + public static ConfigEntry beamRadiusMultiplier; + public static ConfigEntry fuelTankRefillMultiplier; + public static ConfigEntry fuelTankCapacityMultiplier; + public static ConfigEntry minerGroundArea; + public static ConfigEntry minerMiningSpeed; + public static ConfigEntry wheelTorqueMultiplier; + public static ConfigEntry wheelSpeedMultiplier; + public static ConfigEntry jetThrustMultiplier; + public static ConfigEntry seekingProjectileVisionConeAngleMultiplier; + public static ConfigEntry seekingProjectileVisionRangeMultiplier; + public static ConfigEntry seekingProjectileTurningSpeedMultiplier; + public static ConfigEntry wirelessChargingRadiusMultiplier; + public static ConfigEntry wirelessChargingPowerPerArcMultiplier; + public static ConfigEntry wirelessChargingArcFiringIntervalMultiplier; + + public void OnInitializeMelon() { + xpMultiplier = UnityDistantTerrain.Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange(1f, 512f))); + // moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f, + // new ConfigDescription("Money Multiplier", new AcceptableValueRange(1f, 32f))); + // energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f, + // new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange(1f, 64f))); + // heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f, + // new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange(0.1f, 2f))); + // + // shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f, + // new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange(0.2f, 8f))); + // muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f, + // new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange(0.2f, 32f))); + // seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f, + // new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange(0.2f, 32f))); + // seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f, + // new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange(0.2f, 32f))); + // seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f, + // new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange(0.2f, 32f))); + // + // magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f, + // new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange(1f, 16f))); + // magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f, + // new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange(1f, 16f))); + // beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f, + // new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange(1f, 16f))); + // beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f, + // new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange(1f, 16f))); + // + // wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f, + // new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange(0.2f, 16f))); + // wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f, + // new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange(0.02f, 16f))); + // wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f, + // new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange(0.2f, 16f))); + // + // fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f, + // new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange(1f, 32f))); + // fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f, + // new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange(1f, 32f))); + // wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f, + // new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange(1f, 32f))); + // wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f, + // new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange(1f, 32f))); + // jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f, + // new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange(1f, 32f))); + // + // minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f, + // new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange(1f, 32f))); + // minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f, + // new ConfigDescription("Miner Mining Speed", new AcceptableValueRange(1f, 32f))); + // + // allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false); + + // shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch(); + // energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch(); + // magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); + // magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); + // beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); + // beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); + // fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); + // fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); + // wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); + // wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); + // jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch(); + // minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); + // minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); + // wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); + // wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); + // wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); + + Logger.LogInfo("Cyka mod loaded"); + HarmonyFileLog.Enabled = true; + Harmony harmony = new Harmony(pluginGuid); + harmony.PatchAll(); + var originalMethods = harmony.GetPatchedMethods(); + Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); + } + } +} \ No newline at end of file diff --git a/Projects/SevenDaysToDie/SevenDaysToDie/Properties/AssemblyInfo.cs b/Projects/SevenDaysToDie/SevenDaysToDie/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..dd584d7 --- /dev/null +++ b/Projects/SevenDaysToDie/SevenDaysToDie/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SevenDaysToDie")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SevenDaysToDie")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Projects/SevenDaysToDie/SevenDaysToDie/SevenDaysToDie.csproj b/Projects/SevenDaysToDie/SevenDaysToDie/SevenDaysToDie.csproj new file mode 100644 index 0000000..69408c3 --- /dev/null +++ b/Projects/SevenDaysToDie/SevenDaysToDie/SevenDaysToDie.csproj @@ -0,0 +1,75 @@ + + + + + Debug + AnyCPU + {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5} + Library + Properties + SevenDaysToDie + SevenDaysToDie + v4.0 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + libs\0Harmony.dll + + + libs\Assembly-CSharp.dll + + + libs\BepInEx.dll + + + libs\ConfigurationManager.dll + + + libs\MelonLoader.dll + + + + + + + libs\UnityEngine.dll + + + libs\UnityEngine.CoreModule.dll + + + + + + + + + + + diff --git a/Projects/SevenDaysToDie/SevenDaysToDie/XPPatch.cs b/Projects/SevenDaysToDie/SevenDaysToDie/XPPatch.cs new file mode 100644 index 0000000..4f0bd09 --- /dev/null +++ b/Projects/SevenDaysToDie/SevenDaysToDie/XPPatch.cs @@ -0,0 +1,12 @@ +using HarmonyLib; + +namespace SevenDaysToDie { + [HarmonyPatch] + public class Patches { + [HarmonyPrefix] + [HarmonyPatch(typeof(Progression), "AddLevelExp")] + static void XPMulti(ref int _exp) { + _exp = (int)(_exp * Main.xpMultiplier.Value); + } + } +} \ No newline at end of file