(1.2.0) Bow Draw Speed + Rain Damage
This commit is contained in:
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.bowDrawSpeedBonusPerLevel.Value*quality);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user