RJW-Sexperience/RJWSexperience/RJWSexperience/PawnRelationWorkers.cs

32 lines
863 B
C#
Raw Normal View History

2021-08-06 17:19:42 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw;
namespace RJWSexperience
{
public class PawnRelationWorker_Bastard : PawnRelationWorker_Child
{
public override bool InRelation(Pawn me, Pawn other)
{
Pawn mother = other.GetMother();
Pawn father = other.GetFather();
if (me != other && (mother == me || father == me))
{
2021-08-13 15:23:12 +00:00
if (mother == null || father == null) return true;
else if (mother.relations != null) return !(mother.relations.DirectRelationExists(PawnRelationDefOf.Spouse, father) || mother.relations.DirectRelationExists(PawnRelationDefOf.ExSpouse, father));
2021-08-06 17:19:42 +00:00
}
2021-08-13 15:23:12 +00:00
2021-08-06 17:19:42 +00:00
return false;
}
2021-08-13 15:23:12 +00:00
}
2021-08-06 17:19:42 +00:00
2021-08-13 15:23:12 +00:00
2021-08-06 17:19:42 +00:00
}