mirror of
https://gitgud.io/amevarashi/rjw-sexperience-ideology.git
synced 2026-06-18 19:25:59 +00:00
88 lines
No EOL
2.4 KiB
C#
88 lines
No EOL
2.4 KiB
C#
using RimWorld;
|
|
using rjw;
|
|
using rjw.Modules.Attraction;
|
|
using rjw.Modules.Attraction.StandardPreferences;
|
|
using UnityEngine;
|
|
using Verse;
|
|
|
|
namespace RJWSexperience.Ideology
|
|
{
|
|
public class BestialityIdeology : AttractionPreference
|
|
{
|
|
[StandardPreference]
|
|
public static void ApplyTo(ref AttractionRequest request)
|
|
{
|
|
Pawn pawn = request.Pawn;
|
|
|
|
if (!xxx.is_human(pawn) || !xxx.is_animal(request.Target))
|
|
{
|
|
return;
|
|
}
|
|
|
|
foreach (var precept in RsiDefOf.AllBestialityPrecepts)
|
|
{
|
|
if (pawn.Ideo?.HasPrecept(precept) == true)
|
|
{
|
|
request.SetPreference(new BestialityIdeology());
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
private BestialityIdeology() : base(
|
|
AttractionMode.Social,
|
|
nameof(BestialityIdeology),
|
|
FactorOperation.Multiply)
|
|
{
|
|
Priority = 200;
|
|
}
|
|
|
|
protected override float GetOperand(ref AttractionRequest request, float factor)
|
|
{
|
|
Pawn pawn = request.Pawn;
|
|
Pawn partner = request.Target;
|
|
|
|
if (pawn.Ideo.HasPrecept(RsiDefOf.Precept.Bestiality_OnlyVenerated))
|
|
{
|
|
if (pawn.Ideo.IsVeneratedAnimal(partner))
|
|
{
|
|
return 2f;
|
|
}
|
|
else
|
|
{
|
|
return 0.05f;
|
|
}
|
|
|
|
}
|
|
else if (pawn.Ideo.HasPrecept(RsiDefOf.Precept.Bestiality_BondOnly))
|
|
{
|
|
if (request.Relations.Contains(PawnRelationDefOf.Bond))
|
|
{
|
|
return 2f;
|
|
}
|
|
else
|
|
{
|
|
return 0.1f;
|
|
}
|
|
}
|
|
else if (pawn.Ideo.HasPrecept(RsiDefOf.Precept.Bestiality_Honorable))
|
|
{
|
|
return 2f;
|
|
}
|
|
else if (pawn.Ideo.HasPrecept(RsiDefOf.Precept.Bestiality_Disapproved))
|
|
{
|
|
return 0.5f;
|
|
}
|
|
else if (pawn.Ideo.HasPrecept(RsiDefOf.Precept.Bestiality_Horrible))
|
|
{
|
|
return 0.1f;
|
|
}
|
|
else if (pawn.Ideo.HasPrecept(RsiDefOf.Precept.Bestiality_Abhorrent))
|
|
{
|
|
return 0.05f;
|
|
}
|
|
|
|
return 1f;
|
|
}
|
|
}
|
|
} |