Compare commits
5 Commits
1.1.0
...
4aaeed7abc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4aaeed7abc | ||
|
|
a50d7df8d5 | ||
|
|
e8b579db54 | ||
|
|
766c3f7608 | ||
|
|
3db032a530 |
@@ -9,18 +9,22 @@ public class MxValheimMod : BaseUnityPlugin
|
|||||||
{
|
{
|
||||||
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
||||||
private const string ModName = "MxValheim";
|
private const string ModName = "MxValheim";
|
||||||
private const string ModVersion = "1.1.0";
|
private const string ModVersion = "1.2.1";
|
||||||
|
|
||||||
public static ConfigEntry<int> OreMultiplier;
|
public static ConfigEntry<bool> Config_Locked;
|
||||||
public static ConfigEntry<float> rangeMultiplier;
|
public static ConfigEntry<int> Config_OreMultiplier;
|
||||||
|
public static ConfigEntry<float> Config_rangeMultiplier;
|
||||||
// Set your multiplier here
|
public static ConfigEntry<float> Config_bowDrawSpeedBonusPerLevel;
|
||||||
public static int Multiplier = 3;
|
public static ConfigEntry<bool> Config_rainDamage;
|
||||||
|
public static ConfigEntry<float> Config_boatSpeed;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
OreMultiplier = Config.Bind("General","OreMultiplier",3,"How many items should drop for every 1 ore/scrap found.");
|
Config_OreMultiplier = Config.Bind("General","OreMultiplier",3,"How many items should drop for every 1 ore/scrap found.");
|
||||||
rangeMultiplier = Config.Bind("General", "CraftingRangeMultiplier",2.0f,"Multiplier for the workbench build/crafting range. Default is 2x.");
|
Config_rangeMultiplier = Config.Bind("General", "CraftingRangeMultiplier",2.0f,"Multiplier for the workbench build/crafting range. Default is 2x.");
|
||||||
|
Config_bowDrawSpeedBonusPerLevel = Config.Bind("General", "BowDrawSpeedBonusPercentPerLevel", 1.0f, "Shorten the bow draw speed by this percent for every bow upgrade level.");
|
||||||
|
Config_rainDamage = Config.Bind("General", "RainDamage", true, "Set to true to stop rain damage, false to return to vanilla behavior.");
|
||||||
|
Config_boatSpeed = Config.Bind("General", "BoatSpeedMultiplier", 2.0f, "Your boat/raft will move without wind at a speed multiplied by this value.");
|
||||||
|
|
||||||
Harmony harmony = new Harmony(ModGUID);
|
Harmony harmony = new Harmony(ModGUID);
|
||||||
harmony.PatchAll();
|
harmony.PatchAll();
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
<RootNamespace>MxValheim</RootNamespace>
|
<RootNamespace>MxValheim</RootNamespace>
|
||||||
<AssemblyName>MxValheim</AssemblyName>
|
<AssemblyName>MxValheim</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
|
<LangVersion>12.0</LangVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -34,8 +35,11 @@
|
|||||||
<Reference Include="0Harmony">
|
<Reference Include="0Harmony">
|
||||||
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\BepInEx\core\0Harmony.dll</HintPath>
|
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\BepInEx\core\0Harmony.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="assembly_valheim">
|
<Reference Include="Assembly-CSharp-publicized">
|
||||||
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\Valheim_Data\Managed\assembly_valheim.dll</HintPath>
|
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\Valheim_Data\Managed\Assembly-CSharp-publicized.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="assembly_valheim-publicized">
|
||||||
|
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\Valheim_Data\Managed\assembly_valheim-publicized.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="BepInEx">
|
<Reference Include="BepInEx">
|
||||||
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\BepInEx\core\BepInEx.dll</HintPath>
|
<HintPath>E:\SteamLibrary\steamapps\common\Valheim\BepInEx\core\BepInEx.dll</HintPath>
|
||||||
@@ -61,9 +65,14 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="MxValheim.cs" />
|
<Compile Include="MxValheim.cs" />
|
||||||
|
<Compile Include="Patch\Bow.cs" />
|
||||||
<Compile Include="Patch\CraftingStation.cs" />
|
<Compile Include="Patch\CraftingStation.cs" />
|
||||||
<Compile Include="Patch\Ores.cs" />
|
<Compile Include="Patch\Ores.cs" />
|
||||||
|
<Compile Include="Patch\WearNTear.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="ILRepack.targets" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
25
MxValheim/Patch/Bow.cs
Normal file
25
MxValheim/Patch/Bow.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using BepInEx;
|
||||||
|
using HarmonyLib;
|
||||||
|
using UnityEngine;
|
||||||
|
using BepInEx.Logging;
|
||||||
|
using HarmonyLib.Tools;
|
||||||
|
|
||||||
|
namespace MxValheim.Patch
|
||||||
|
{
|
||||||
|
public class Bow_Patch
|
||||||
|
{
|
||||||
|
// We patch Start because that's when the Attack object initializes its timers
|
||||||
|
[HarmonyPatch(typeof(Player), "UpdateAttackBowDraw")]
|
||||||
|
public static class Patch_AttackStart
|
||||||
|
{
|
||||||
|
static void Prefix(ItemDrop.ItemData weapon, ref float ___m_attackDrawTime, bool ___m_attackHold)
|
||||||
|
{
|
||||||
|
if (___m_attackDrawTime >= 0f && ___m_attackHold)
|
||||||
|
{
|
||||||
|
int quality = weapon.m_quality;
|
||||||
|
___m_attackDrawTime += UnityEngine.Time.fixedDeltaTime * (MxValheimMod.Config_bowDrawSpeedBonusPerLevel.Value*quality);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ namespace MxValheim.Patch
|
|||||||
if (rangeField.FieldExists())
|
if (rangeField.FieldExists())
|
||||||
{
|
{
|
||||||
float currentRange = rangeField.GetValue<float>();
|
float currentRange = rangeField.GetValue<float>();
|
||||||
rangeField.SetValue(currentRange * MxValheimMod.rangeMultiplier.Value);
|
rangeField.SetValue(currentRange * MxValheimMod.Config_rangeMultiplier.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace MxValheim.Patch
|
|||||||
{
|
{
|
||||||
if (__result == null || __result.Count == 0) return;
|
if (__result == null || __result.Count == 0) return;
|
||||||
|
|
||||||
int countToAdd = MxValheimMod.OreMultiplier.Value - 1;
|
int countToAdd = MxValheimMod.Config_OreMultiplier.Value - 1;
|
||||||
if (countToAdd <= 0) return;
|
if (countToAdd <= 0) return;
|
||||||
|
|
||||||
List<GameObject> extraDrops = new List<GameObject>();
|
List<GameObject> extraDrops = new List<GameObject>();
|
||||||
|
|||||||
19
MxValheim/Patch/WearNTear.cs
Normal file
19
MxValheim/Patch/WearNTear.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using BepInEx;
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace MxValheim.Patch
|
||||||
|
{
|
||||||
|
public class WearNTear_Patch
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(WearNTear), "HaveRoof")]
|
||||||
|
class WearNTear_HaveRoof_Patch
|
||||||
|
{
|
||||||
|
static void Postfix(WearNTear __instance, ref bool __result)
|
||||||
|
{
|
||||||
|
if (!MxValheimMod.Config_rainDamage.Value) return;
|
||||||
|
|
||||||
|
__result = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,8 +4,11 @@
|
|||||||
Official Mx Valheim Mod.
|
Official Mx Valheim Mod.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
- **NEW** Now using ServerSync when on a server for configurations syncing.
|
||||||
- Ore drop multiplier. (Value available in the generated config.)
|
- Ore drop multiplier. (Value available in the generated config.)
|
||||||
- Workbench crafting range multiplier. (Value available in the generated config.)
|
- Workbench crafting range multiplier. (Value available in the generated config.)
|
||||||
|
- Reduce Bow draw time for each upgrade level. (Value available in the generated config.)
|
||||||
|
- Disable rain damage. (Enable/Disable in the generated config.)
|
||||||
|
|
||||||
## How-To Install
|
## How-To Install
|
||||||
1. Download the latest dll.
|
1. Download the latest dll.
|
||||||
|
|||||||
Reference in New Issue
Block a user