coffees-rjw-ideology-addons/Source/CRIAUtility.cs
2021-07-24 18:44:11 -07:00

47 lines
1.4 KiB
C#

using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw;
namespace C0ffee_s_RJW_Ideology_Addons
{
public static class CRIAUtility
{
public static bool TwoPawnsWillingToHaveSex(Pawn fucker, Pawn fucked)
{
if (fucker == fucked) return true; //pawns are always allowed to masturbate
if (DesignatorsData.rjwComfort.Contains(fucker) || DesignatorsData.rjwComfort.Contains(fucked)) return true; //designated comfort pawns allowed to have sex with
if (!IdeoUtility.DoerWillingToDo(HistoryEventDefOf.SharedBed, fucker) || !IdeoUtility.DoerWillingToDo(HistoryEventDefOf.SharedBed, fucked))
{
return false;
}
if (fucker.relations.GetDirectRelation(PawnRelationDefOf.Spouse, fucked) != null)
{
if (!IdeoUtility.DoerWillingToDo(HistoryEventDefOf.SharedBed_Spouse, fucker) || !IdeoUtility.DoerWillingToDo(HistoryEventDefOf.SharedBed_Spouse, fucked))
{
return false;
}
}
else if (!IdeoUtility.DoerWillingToDo(HistoryEventDefOf.SharedBed_NonSpouse, fucker) || !IdeoUtility.DoerWillingToDo(HistoryEventDefOf.SharedBed_NonSpouse, fucked))
{
return false;
}
return true;
}
}
}