rimworld-animations/Source/Patches/rjwPatches/HarmonyPatch_SexTick.cs
Platinum f3cd391c6f HAR Patch
Sound override options
2020-04-22 11:12:06 -07:00

42 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using RimWorld;
using Verse;
using rjw;
using Verse.Sound;
namespace Rimworld_Animations {
[HarmonyPatch(typeof(xxx), "sexTick")]
public static class HarmonyPatch_SexTick {
public static bool Prefix(ref Pawn pawn, ref Pawn partner, ref bool enablerotation, ref bool pawnnude, ref bool partnernude) {
if (enablerotation) {
pawn.rotationTracker.Face(((Thing)partner).DrawPos);
partner.rotationTracker.Face(((Thing)pawn).DrawPos);
}
if (RJWSettings.sounds_enabled && (!pawn.TryGetComp<CompBodyAnimator>().isAnimating || !AnimationSettings.soundOverride)) {
SoundDef.Named("Sex").PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
}
pawn.Drawer.Notify_MeleeAttackOn((Thing)(object)partner);
if (enablerotation) {
pawn.rotationTracker.FaceCell(partner.Position);
}
if (pawnnude && !xxx.has_quirk(pawn, "Endytophile")) {
xxx.DrawNude(pawn);
}
if (partnernude && !xxx.has_quirk(pawn, "Endytophile")) {
xxx.DrawNude(partner);
}
return false;
}
}
}