diff --git a/CHANGELOG.md b/CHANGELOG.md index 83a1846..fc7cf57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,3 +67,7 @@ ## PvE Leaderboard ### v1.0.0 * Initial release + +## Siege Golem Tweaker +### v1.0.0 +* Initial release diff --git a/README.md b/README.md index 58bd701..6fcd86d 100644 --- a/README.md +++ b/README.md @@ -230,3 +230,26 @@ The Lvl Kills leaderboards can also be browsed using a command (By default: `!pv * Change the amount of time the highest gear score is remembered/tracked + +## Siege Golem Tweaker +A server-side only mod that allows you to tweak the stats (Power, Resists, (Move)Speed, Max HP) of Siege Golems. + +
+Configuration Options + +* Siege Power Multiplier +* Physical Power Multiplier +* Spell Power Multiplier +* Movement Speed Multiplier +* Attack Speed Multiplier +* Max Health Multiplier +* Passive Health Regen +* Physical Resistance +* Spell Resistance +* Fire Resistance +* Holy Resistance +* Sun Resistance +* Silver Resistance +* Garlic Resistance + +
diff --git a/Shared/Utils.cs b/Shared/Utils.cs index e57c50c..c89d039 100644 --- a/Shared/Utils.cs +++ b/Shared/Utils.cs @@ -24,6 +24,9 @@ public static class Utils public static readonly PrefabGUID BloodPotion = new(828432508); + public static readonly PrefabGUID SiegeGolemT01 = new(-148535031); + public static readonly PrefabGUID SiegeGolemT02 = new(914043867); + #endregion #region Variables diff --git a/SiegeGolemTweaker/Configs/SiegeGolemTweakerConfig.cs b/SiegeGolemTweaker/Configs/SiegeGolemTweakerConfig.cs new file mode 100644 index 0000000..a0bae62 --- /dev/null +++ b/SiegeGolemTweaker/Configs/SiegeGolemTweakerConfig.cs @@ -0,0 +1,51 @@ +using BepInEx.Configuration; + +namespace VMods.SiegeGolemTweaker +{ + public static class SiegeGolemTweakerConfig + { + #region Properties + + public static ConfigEntry SiegeGolemTweakerEnabled { get; private set; } + public static ConfigEntry SiegeGolemTweakerSiegePowerMultiplier { get; private set; } + public static ConfigEntry SiegeGolemTweakerPhysicalPowerMultiplier { get; private set; } + public static ConfigEntry SiegeGolemTweakerSpellPowerMultiplier { get; private set; } + public static ConfigEntry SiegeGolemTweakerMovementSpeedMultiplier { get; private set; } + public static ConfigEntry SiegeGolemTweakerAttackSpeedMultiplier { get; private set; } + public static ConfigEntry SiegeGolemTweakerMaxHealthMultiplier { get; private set; } + public static ConfigEntry SiegeGolemTweakerPassiveHealthRegen { get; private set; } + public static ConfigEntry SiegeGolemTweakerPhysicalResistance { get; private set; } + public static ConfigEntry SiegeGolemTweakerSpellResistance { get; private set; } + public static ConfigEntry SiegeGolemTweakerFireResistance { get; private set; } + public static ConfigEntry SiegeGolemTweakerHolyResistance { get; private set; } + public static ConfigEntry SiegeGolemTweakerSunResistance { get; private set; } + public static ConfigEntry SiegeGolemTweakerSilverResistance { get; private set; } + public static ConfigEntry SiegeGolemTweakerGarlicResistance { get; private set; } + + #endregion + + #region Public Methods + + public static void Initialize(ConfigFile config) + { + SiegeGolemTweakerEnabled = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerEnabled), false, "Enabled/disable the Siege Golem Tweaker system."); + + SiegeGolemTweakerSiegePowerMultiplier = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerSiegePowerMultiplier), 100f, "The percentage of Siege Power a Siege Golem has."); + SiegeGolemTweakerPhysicalPowerMultiplier = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerPhysicalPowerMultiplier), 100f, "The percentage of Physical Power a Siege Golem has."); + SiegeGolemTweakerSpellPowerMultiplier = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerSpellPowerMultiplier), 100f, "The percentage of Spell Power a Siege Golem has."); + SiegeGolemTweakerMovementSpeedMultiplier = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerMovementSpeedMultiplier), 100f, "The percentage of Movement Speed a Siege Golem has."); + SiegeGolemTweakerAttackSpeedMultiplier = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerAttackSpeedMultiplier), 100f, "The percentage of Attack Speed a Siege Golem has."); + SiegeGolemTweakerMaxHealthMultiplier = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerMaxHealthMultiplier), 100f, "The percentage of Max Health a Siege Golem has."); + SiegeGolemTweakerPassiveHealthRegen = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerPassiveHealthRegen), float.NaN, "The (absolute) amount of Passive Health Regen a Siege Golem has. - Use NaN to disable"); + SiegeGolemTweakerPhysicalResistance = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerPhysicalResistance), 0.5f, "The (absolute) amount of Physical Resistance a Siege Golem has. - Use NaN to disable"); + SiegeGolemTweakerSpellResistance = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerPhysicalResistance), 0.5f, "The (absolute) amount of Spell Resistance a Siege Golem has. - Use NaN to disable"); + SiegeGolemTweakerFireResistance = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerFireResistance), float.NaN, "The (absolute) amount of Fire Resistance a Siege Golem has. - Use NaN to disable"); + SiegeGolemTweakerHolyResistance = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerHolyResistance), float.NaN, "The (absolute) amount of Holy Resistance a Siege Golem has. - Use NaN to disable"); + SiegeGolemTweakerSunResistance = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerSunResistance), float.NaN, "The (absolute) amount of Sun Resistance a Siege Golem has. - Use NaN to disable"); + SiegeGolemTweakerSilverResistance = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerSilverResistance), float.NaN, "The (absolute) amount of Silver Resistance a Siege Golem has. - Use NaN to disable"); + SiegeGolemTweakerGarlicResistance = config.Bind(nameof(SiegeGolemTweakerConfig), nameof(SiegeGolemTweakerGarlicResistance), float.NaN, "The (absolute) amount of Garlic Resistance a Siege Golem has. - Use NaN to disable"); + } + + #endregion + } +} diff --git a/SiegeGolemTweaker/Plugin.cs b/SiegeGolemTweaker/Plugin.cs new file mode 100644 index 0000000..1979dbf --- /dev/null +++ b/SiegeGolemTweaker/Plugin.cs @@ -0,0 +1,56 @@ +using BepInEx; +using BepInEx.IL2CPP; +using HarmonyLib; +using System.Reflection; +using VMods.Shared; +using Wetstone.API; + +namespace VMods.SiegeGolemTweaker +{ + [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] + [BepInDependency("xyz.molenzwiebel.wetstone")] + [Reloadable] + public class Plugin : BasePlugin + { + #region Variables + + private Harmony _hooks; + + #endregion + + #region Public Methods + + public sealed override void Load() + { + if(VWorld.IsClient) + { + Log.LogMessage($"{PluginInfo.PLUGIN_NAME} only needs to be installed server side."); + return; + } + Utils.Initialize(Log, PluginInfo.PLUGIN_NAME); + + SiegeGolemTweakerConfig.Initialize(Config); + + SiegeGolemTweakerSystem.Initialize(); + + _hooks = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); + + Log.LogInfo($"Plugin {PluginInfo.PLUGIN_NAME} (v{PluginInfo.PLUGIN_VERSION}) is loaded!"); + } + + public sealed override bool Unload() + { + if(VWorld.IsClient) + { + return true; + } + _hooks?.UnpatchSelf(); + SiegeGolemTweakerSystem.Deinitialize(); + Config.Clear(); + Utils.Deinitialize(); + return true; + } + + #endregion + } +} diff --git a/SiegeGolemTweaker/SiegeGolemTweaker.csproj b/SiegeGolemTweaker/SiegeGolemTweaker.csproj new file mode 100644 index 0000000..a499976 --- /dev/null +++ b/SiegeGolemTweaker/SiegeGolemTweaker.csproj @@ -0,0 +1,471 @@ + + + netstandard2.1 + VMods.SiegeGolemTweaker + VMods.SiegeGolemTweaker + A mod that allows tweaking of the Siege Golems + 1.0.0 + true + latest + False + + + + M:\Games\Steam\steamapps\common\VRising\BepInEx\unhollowed + M:\Games\Steam\steamapps\common\VRising\BepInEx\WetstonePlugins + M:\Games\Steam\steamapps\common\VRising\VRising_Server\BepInEx\WetstonePlugins + + + + + + + + + + + + + + + + + + + + + + $(UnhollowedDllPath)\com.stunlock.console.dll + + + $(UnhollowedDllPath)\com.stunlock.metrics.dll + + + $(UnhollowedDllPath)\com.stunlock.network.lidgren.dll + + + $(UnhollowedDllPath)\com.stunlock.network.steam.dll + + + $(UnhollowedDllPath)\Il2CppMono.Security.dll + + + $(UnhollowedDllPath)\Il2CppSystem.dll + + + $(UnhollowedDllPath)\Il2CppSystem.Configuration.dll + + + $(UnhollowedDllPath)\Il2CppSystem.Core.dll + + + $(UnhollowedDllPath)\Il2CppSystem.Data.dll + + + $(UnhollowedDllPath)\Il2CppSystem.Numerics.dll + + + $(UnhollowedDllPath)\Il2CppSystem.Runtime.Serialization.dll + + + $(UnhollowedDllPath)\Il2CppSystem.Xml.dll + + + $(UnhollowedDllPath)\Il2CppSystem.Xml.Linq.dll + + + $(UnhollowedDllPath)\Lidgren.Network.dll + + + $(UnhollowedDllPath)\MagicaCloth.dll + + + $(UnhollowedDllPath)\Malee.ReorderableList.dll + + + $(UnhollowedDllPath)\Newtonsoft.Json.dll + + + $(UnhollowedDllPath)\ProjectM.Behaviours.dll + + + $(UnhollowedDllPath)\ProjectM.Camera.dll + + + $(UnhollowedDllPath)\ProjectM.CastleBuilding.Systems.dll + + + $(UnhollowedDllPath)\ProjectM.Conversion.dll + + + $(UnhollowedDllPath)\ProjectM.Gameplay.Scripting.dll + + + $(UnhollowedDllPath)\ProjectM.Gameplay.Systems.dll + + + $(UnhollowedDllPath)\ProjectM.GeneratedNetCode.dll + + + $(UnhollowedDllPath)\ProjectM.Misc.Systems.dll + + + $(UnhollowedDllPath)\ProjectM.Pathfinding.dll + + + $(UnhollowedDllPath)\ProjectM.Presentation.Systems.dll + + + $(UnhollowedDllPath)\ProjectM.Roofs.dll + + + $(UnhollowedDllPath)\ProjectM.ScriptableSystems.dll + + + $(UnhollowedDllPath)\ProjectM.Shared.dll + + + $(UnhollowedDllPath)\Il2Cppmscorlib.dll + + + $(UnhollowedDllPath)\ProjectM.dll + + + $(UnhollowedDllPath)\com.stunlock.network.dll + + + $(UnhollowedDllPath)\ProjectM.Shared.Systems.dll + + + $(UnhollowedDllPath)\ProjectM.Terrain.dll + + + $(UnhollowedDllPath)\RootMotion.dll + + + $(UnhollowedDllPath)\Sequencer.dll + + + $(UnhollowedDllPath)\Stunlock.Fmod.dll + + + $(UnhollowedDllPath)\Unity.Burst.dll + + + $(UnhollowedDllPath)\Unity.Burst.Unsafe.dll + + + $(UnhollowedDllPath)\Unity.Collections.dll + + + $(UnhollowedDllPath)\Unity.Collections.LowLevel.ILSupport.dll + + + $(UnhollowedDllPath)\Unity.Deformations.dll + + + $(UnhollowedDllPath)\Unity.Entities.dll + + + $(UnhollowedDllPath)\ProjectM.HUD.dll + + + $(UnhollowedDllPath)\Unity.Entities.Hybrid.dll + + + $(UnhollowedDllPath)\Unity.Jobs.dll + + + $(UnhollowedDllPath)\Unity.Mathematics.dll + + + $(UnhollowedDllPath)\Unity.Mathematics.Extensions.dll + + + $(UnhollowedDllPath)\Unity.Mathematics.Extensions.Hybrid.dll + + + $(UnhollowedDllPath)\Unity.Physics.dll + + + $(UnhollowedDllPath)\Unity.Physics.Hybrid.dll + + + $(UnhollowedDllPath)\Unity.Properties.dll + + + $(UnhollowedDllPath)\Unity.Rendering.Hybrid.dll + + + $(UnhollowedDllPath)\Unity.RenderPipelines.Core.Runtime.dll + + + $(UnhollowedDllPath)\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + + + $(UnhollowedDllPath)\Unity.RenderPipelines.HighDefinition.Runtime.dll + + + $(UnhollowedDllPath)\Unity.Scenes.dll + + + $(UnhollowedDllPath)\Unity.Serialization.dll + + + $(UnhollowedDllPath)\Unity.Services.Analytics.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Configuration.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Device.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Environments.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Environments.Internal.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Internal.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Registration.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Scheduler.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Telemetry.dll + + + $(UnhollowedDllPath)\Unity.Services.Core.Threading.dll + + + $(UnhollowedDllPath)\Unity.TextMeshPro.dll + + + $(UnhollowedDllPath)\Unity.Transforms.dll + + + $(UnhollowedDllPath)\Unity.Transforms.Hybrid.dll + + + $(UnhollowedDllPath)\Unity.VisualEffectGraph.Runtime.dll + + + $(UnhollowedDllPath)\UnityEngine.dll + + + $(UnhollowedDllPath)\UnityEngine.AccessibilityModule.dll + + + $(UnhollowedDllPath)\UnityEngine.AIModule.dll + + + $(UnhollowedDllPath)\UnityEngine.AndroidJNIModule.dll + + + $(UnhollowedDllPath)\UnityEngine.AnimationModule.dll + + + $(UnhollowedDllPath)\UnityEngine.ARModule.dll + + + $(UnhollowedDllPath)\UnityEngine.AssetBundleModule.dll + + + $(UnhollowedDllPath)\UnityEngine.AudioModule.dll + + + $(UnhollowedDllPath)\UnityEngine.ClothModule.dll + + + $(UnhollowedDllPath)\UnityEngine.ClusterInputModule.dll + + + $(UnhollowedDllPath)\UnityEngine.ClusterRendererModule.dll + + + $(UnhollowedDllPath)\UnityEngine.CoreModule.dll + + + $(UnhollowedDllPath)\ProjectM.CodeGeneration.dll + + + $(UnhollowedDllPath)\Stunlock.Core.dll + + + $(UnhollowedDllPath)\UnityEngine.CrashReportingModule.dll + + + $(UnhollowedDllPath)\UnityEngine.DirectorModule.dll + + + $(UnhollowedDllPath)\UnityEngine.DSPGraphModule.dll + + + $(UnhollowedDllPath)\UnityEngine.GameCenterModule.dll + + + $(UnhollowedDllPath)\UnityEngine.GIModule.dll + + + $(UnhollowedDllPath)\UnityEngine.GridModule.dll + + + $(UnhollowedDllPath)\UnityEngine.HotReloadModule.dll + + + $(UnhollowedDllPath)\UnityEngine.ImageConversionModule.dll + + + $(UnhollowedDllPath)\UnityEngine.IMGUIModule.dll + + + $(UnhollowedDllPath)\UnityEngine.InputLegacyModule.dll + + + $(UnhollowedDllPath)\UnityEngine.InputModule.dll + + + $(UnhollowedDllPath)\UnityEngine.JSONSerializeModule.dll + + + $(UnhollowedDllPath)\UnityEngine.LocalizationModule.dll + + + $(UnhollowedDllPath)\UnityEngine.ParticleSystemModule.dll + + + $(UnhollowedDllPath)\UnityEngine.PerformanceReportingModule.dll + + + $(UnhollowedDllPath)\UnityEngine.Physics2DModule.dll + + + $(UnhollowedDllPath)\UnityEngine.PhysicsModule.dll + + + $(UnhollowedDllPath)\UnityEngine.ProfilerModule.dll + + + $(UnhollowedDllPath)\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + $(UnhollowedDllPath)\UnityEngine.ScreenCaptureModule.dll + + + $(UnhollowedDllPath)\UnityEngine.SharedInternalsModule.dll + + + $(UnhollowedDllPath)\UnityEngine.SpriteMaskModule.dll + + + $(UnhollowedDllPath)\UnityEngine.SpriteShapeModule.dll + + + $(UnhollowedDllPath)\UnityEngine.StreamingModule.dll + + + $(UnhollowedDllPath)\UnityEngine.SubstanceModule.dll + + + $(UnhollowedDllPath)\UnityEngine.SubsystemsModule.dll + + + $(UnhollowedDllPath)\UnityEngine.TerrainModule.dll + + + $(UnhollowedDllPath)\UnityEngine.TerrainPhysicsModule.dll + + + $(UnhollowedDllPath)\UnityEngine.TextCoreModule.dll + + + $(UnhollowedDllPath)\UnityEngine.TextRenderingModule.dll + + + $(UnhollowedDllPath)\UnityEngine.TilemapModule.dll + + + $(UnhollowedDllPath)\UnityEngine.TLSModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UI.dll + + + $(UnhollowedDllPath)\UnityEngine.UIElementsModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UIElementsNativeModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UIModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UmbraModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UNETModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityAnalyticsModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityConnectModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityCurlModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityTestProtocolModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityWebRequestAudioModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityWebRequestModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityWebRequestTextureModule.dll + + + $(UnhollowedDllPath)\UnityEngine.UnityWebRequestWWWModule.dll + + + $(UnhollowedDllPath)\UnityEngine.VehiclesModule.dll + + + $(UnhollowedDllPath)\UnityEngine.VFXModule.dll + + + $(UnhollowedDllPath)\UnityEngine.VideoModule.dll + + + $(UnhollowedDllPath)\UnityEngine.VirtualTexturingModule.dll + + + $(UnhollowedDllPath)\UnityEngine.VRModule.dll + + + $(UnhollowedDllPath)\UnityEngine.WindModule.dll + + + $(UnhollowedDllPath)\UnityEngine.XRModule.dll + + + $(UnhollowedDllPath)\VivoxUnity.dll + + + + + + + diff --git a/SiegeGolemTweaker/Systems/SiegeGolemTweakerSystem.cs b/SiegeGolemTweaker/Systems/SiegeGolemTweakerSystem.cs new file mode 100644 index 0000000..cd5e865 --- /dev/null +++ b/SiegeGolemTweaker/Systems/SiegeGolemTweakerSystem.cs @@ -0,0 +1,75 @@ +using ProjectM; +using Unity.Entities; +using VMods.Shared; +using Wetstone.API; + +namespace VMods.SiegeGolemTweaker +{ + public static class SiegeGolemTweakerSystem + { + #region Public Methods + + public static void Initialize() + { + BuffSystemHook.ProcessBuffEvent += OnProcessBuff; + } + + public static void Deinitialize() + { + BuffSystemHook.ProcessBuffEvent -= OnProcessBuff; + } + + #endregion + + #region Private Methods + + private static void OnProcessBuff(Entity entity, PrefabGUID buffGUID) + { + if(!VWorld.IsServer || + !SiegeGolemTweakerConfig.SiegeGolemTweakerEnabled.Value || + (buffGUID != Utils.SiegeGolemT01 && buffGUID != Utils.SiegeGolemT02)) + { + return; + } + + var entityManager = VWorld.Server.EntityManager; + + var buffer = entityManager.AddBuffer(entity); + TryAddReductionBuff(buffer, UnitStatType.SiegePower, ModificationType.Multiply, SiegeGolemTweakerConfig.SiegeGolemTweakerSiegePowerMultiplier.Value); + TryAddReductionBuff(buffer, UnitStatType.PhysicalPower, ModificationType.Multiply, SiegeGolemTweakerConfig.SiegeGolemTweakerPhysicalPowerMultiplier.Value); + TryAddReductionBuff(buffer, UnitStatType.SpellPower, ModificationType.Multiply, SiegeGolemTweakerConfig.SiegeGolemTweakerSpellPowerMultiplier.Value); + TryAddReductionBuff(buffer, UnitStatType.MovementSpeed, ModificationType.Multiply, SiegeGolemTweakerConfig.SiegeGolemTweakerMovementSpeedMultiplier.Value); + TryAddReductionBuff(buffer, UnitStatType.AttackSpeed, ModificationType.Multiply, SiegeGolemTweakerConfig.SiegeGolemTweakerAttackSpeedMultiplier.Value); + TryAddReductionBuff(buffer, UnitStatType.MaxHealth, ModificationType.Multiply, SiegeGolemTweakerConfig.SiegeGolemTweakerMaxHealthMultiplier.Value); + TryAddReductionBuff(buffer, UnitStatType.PassiveHealthRegen, ModificationType.Set, SiegeGolemTweakerConfig.SiegeGolemTweakerPassiveHealthRegen.Value); + TryAddReductionBuff(buffer, UnitStatType.PhysicalResistance, ModificationType.Set, SiegeGolemTweakerConfig.SiegeGolemTweakerPhysicalResistance.Value); + TryAddReductionBuff(buffer, UnitStatType.SpellResistance, ModificationType.Set, SiegeGolemTweakerConfig.SiegeGolemTweakerSpellResistance.Value); + TryAddReductionBuff(buffer, UnitStatType.FireResistance, ModificationType.Set, SiegeGolemTweakerConfig.SiegeGolemTweakerFireResistance.Value); + TryAddReductionBuff(buffer, UnitStatType.HolyResistance, ModificationType.Set, SiegeGolemTweakerConfig.SiegeGolemTweakerHolyResistance.Value); + TryAddReductionBuff(buffer, UnitStatType.SunResistance, ModificationType.Set, SiegeGolemTweakerConfig.SiegeGolemTweakerSunResistance.Value); + TryAddReductionBuff(buffer, UnitStatType.SilverResistance, ModificationType.Set, SiegeGolemTweakerConfig.SiegeGolemTweakerSilverResistance.Value); + TryAddReductionBuff(buffer, UnitStatType.GarlicResistance, ModificationType.Set, SiegeGolemTweakerConfig.SiegeGolemTweakerGarlicResistance.Value); + } + + private static void TryAddReductionBuff(DynamicBuffer buffer, UnitStatType unitStatType, ModificationType modificationType, float value) + { + if(!float.IsNaN(value)) + { + buffer.Add(new ModifyUnitStatBuff_DOTS() + { + StatType = unitStatType, + Value = modificationType switch + { + ModificationType.Multiply => value / 100f, + ModificationType.Set => value, + _ => value, + }, + ModificationType = modificationType, + Id = ModificationId.NewId(0), + }); + } + } + + #endregion + } +} diff --git a/Thunderstore/SiegeGolemTweaker/README.md b/Thunderstore/SiegeGolemTweaker/README.md new file mode 100644 index 0000000..026ff56 --- /dev/null +++ b/Thunderstore/SiegeGolemTweaker/README.md @@ -0,0 +1,43 @@ +# Siege Golem Tweaker +A server-side only mod that allows you to tweak the stats (Power, Resists, (Move)Speed, Max HP) of Siege Golems. + +
+Configuration Options + +* Siege Power Multiplier +* Physical Power Multiplier +* Spell Power Multiplier +* Movement Speed Multiplier +* Attack Speed Multiplier +* Max Health Multiplier +* Passive Health Regen +* Physical Resistance +* Spell Resistance +* Fire Resistance +* Holy Resistance +* Sun Resistance +* Silver Resistance +* Garlic Resistance + +
+ +## How to manually install +* Install [BepInEx](https://v-rising.thunderstore.io/package/BepInEx/BepInExPack_V_Rising/) +* Install [Wetstone](https://v-rising.thunderstore.io/package/molenzwiebel/Wetstone/) +* (Locally hosted games only) Install [ServerLaunchFix](https://v-rising.thunderstore.io/package/Mythic/ServerLaunchFix/) +* Extract the Vmods._mod-name_.dll +* Move the desired mod(s) to the `[VRising (server) folder]/BepInEx/WetstonePlugins/` +* Launch the server (or game) to auto-generate the config files +* Edit the configs as you desire (found in `[VRising (server) folder]/BepInEx/config/`) +* Reload the mods using the Wetstone commands (by default F6 for client-side mods, and/or `!reload` for server-side mods) + * If this doesn't work, or isn't enabled, restart the server/game + +## Commands +Most of the VMods come with a set of commands that can be used. To see the available commands, by default a player or admin can use `!help`. +Normal players won't see the Admin-only commands listed. +The prefix (`!`) can be changed on a per-mod basis. +To prevent spam/abuse there's also a command cooldown for non-admins, this value can also be tweaked on a per-mod basis. +Commands can also be disabled completely on a per-mod basis. + +## More Details +* [ChangeLog](https://github.com/WhiteFang5/VMods/blob/master/CHANGELOG.md#siege-golem-tweaker) diff --git a/Thunderstore/SiegeGolemTweaker/manifest.json b/Thunderstore/SiegeGolemTweaker/manifest.json new file mode 100644 index 0000000..21b9872 --- /dev/null +++ b/Thunderstore/SiegeGolemTweaker/manifest.json @@ -0,0 +1,10 @@ +{ + "name": "VMods_Siege_Golem_Tweaker", + "description": "A mod that allows you to tweak the stats (Power, Resists, (Move)Speed, Max HP) of Siege Golems.", + "version_number": "1.0.0", + "dependencies": [ + "BepInEx-BepInExPack_V_Rising-1.0.0", + "molenzwiebel-Wetstone-1.1.0" + ], + "website_url": "https://github.com/WhiteFang5/VMods#resource-stash-withdrawal" +} diff --git a/VMods.sln b/VMods.sln index 6c01a52..e182498 100644 --- a/VMods.sln +++ b/VMods.sln @@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericChatCommands", "Gene EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PvELeaderboard", "PvELeaderboard\PvELeaderboard.csproj", "{5ABC09AF-92EA-4EBA-88F9-29FD8730472C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SiegeGolemTweaker", "SiegeGolemTweaker\SiegeGolemTweaker.csproj", "{BE147D1E-43A8-4CAB-96D6-106492431080}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -69,6 +71,10 @@ Global {5ABC09AF-92EA-4EBA-88F9-29FD8730472C}.Debug|Any CPU.Build.0 = Debug|Any CPU {5ABC09AF-92EA-4EBA-88F9-29FD8730472C}.Release|Any CPU.ActiveCfg = Release|Any CPU {5ABC09AF-92EA-4EBA-88F9-29FD8730472C}.Release|Any CPU.Build.0 = Release|Any CPU + {BE147D1E-43A8-4CAB-96D6-106492431080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE147D1E-43A8-4CAB-96D6-106492431080}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE147D1E-43A8-4CAB-96D6-106492431080}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE147D1E-43A8-4CAB-96D6-106492431080}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE