private static void Prefix(MWS_ChargeUp __instance) { float progress = Mathf.Min(__instance.m_elapsed / __instance.m_maxDamageTime, 1f); if (progress >= 1 && !fullChargeEventFired) { HammerEvents.HammerFullyCharged(); fullChargeEventFired = true; } if (progress >= .5f && !halfChargeEventFired) { HammerEvents.HammerHalfCharged(); halfChargeEventFired = true; } }
static void Postfix(MeleeWeaponFirstPerson __instance, MeleeWeaponDamageData data, bool isPush) { if (!__instance.Owner.IsLocallyOwned) { return; } Vector3 velocity = Controllers.mainControllerPose.GetVelocity() * 3f; data.sourcePos = data.hitPos - data.hitNormal * velocity.magnitude; if (isPush) { HammerEvents.HammerSmacked(0f); } else { HammerEvents.HammerSmacked(__instance.m_damageToDeal / __instance.m_damageHeavy); } }