mirror of
https://gitgud.io/amevarashi/rjw-sexperience-ideology.git
synced 2026-06-18 19:25:59 +00:00
46 lines
No EOL
1.1 KiB
C#
46 lines
No EOL
1.1 KiB
C#
using RJWSexperience.Ideology;
|
|
using Verse;
|
|
|
|
namespace rjw.Modules.Attraction.StandardPreferences
|
|
{
|
|
/// <summary>
|
|
/// Handles the observer's non-romantic relations, which are used to suppress
|
|
/// incestuous encounters.
|
|
/// </summary>
|
|
public sealed class IncestAversionOverride : AttractionPreference
|
|
{
|
|
[StandardPreference]
|
|
public static void ApplyTo(ref AttractionRequest request)
|
|
{
|
|
Pawn pawn = request.Pawn;
|
|
|
|
if (!xxx.is_human(pawn) || !xxx.is_human(request.Target))
|
|
{
|
|
return;
|
|
}
|
|
|
|
foreach (var precept in RsiDefOf.AllIncestPrecepts)
|
|
{
|
|
if (pawn.Ideo?.HasPrecept(precept) == true)
|
|
{
|
|
request.SetPreference(new IncestAversionOverride());
|
|
return;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
private IncestAversionOverride() : base(
|
|
AttractionMode.Social,
|
|
nameof(R_IncestAversion),
|
|
FactorOperation.Multiply)
|
|
{
|
|
Priority = 250;
|
|
}
|
|
|
|
protected override float GetOperand(ref AttractionRequest request, float factor)
|
|
{
|
|
return 1f;
|
|
}
|
|
}
|
|
} |