26 lines
819 B
C#
26 lines
819 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|