2022-03-04 17:20:44 +00:00
|
|
|
|
using Verse;
|
|
|
|
|
using rjw;
|
|
|
|
|
|
|
|
|
|
namespace RJWSexperience.ExtensionMethods
|
|
|
|
|
{
|
|
|
|
|
public static class SexPropsExtensions
|
|
|
|
|
{
|
|
|
|
|
public static Pawn GetInteractionInitiator(this SexProps props)
|
|
|
|
|
{
|
|
|
|
|
if (props.isReceiver)
|
|
|
|
|
{
|
|
|
|
|
return props.partner;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return props.pawn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-06 08:45:26 +00:00
|
|
|
|
public static bool IsBestiality(this SexProps props)
|
|
|
|
|
{
|
2023-04-21 15:19:37 +00:00
|
|
|
|
if (props.hasPartner())
|
2022-03-06 08:45:26 +00:00
|
|
|
|
{
|
|
|
|
|
return props.pawn.IsAnimal() ^ props.partner.IsAnimal();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2023-04-21 15:19:37 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get a not-so-unique ID. Same interaction between the same partners will return same ID
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static int GetTempId(this SexProps props)
|
|
|
|
|
{
|
|
|
|
|
return props.pawn.GetHashCode() ^
|
|
|
|
|
(props.partner?.GetHashCode() ?? 0) ^
|
|
|
|
|
props.dictionaryKey.GetHashCode() ^
|
|
|
|
|
(props.isReceiver ? 0 : 1);
|
|
|
|
|
}
|
2022-03-04 17:20:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|