Option to disable Bastard relation

This commit is contained in:
amevarashi 2022-04-19 23:13:22 +05:00
parent 41faeabe5b
commit 678ffc995a
6 changed files with 36 additions and 32 deletions

View File

@ -83,6 +83,8 @@
<RSOption_MinSexableFromLifestage_Desc>Only used for generating records. Get minimum sexable age from the first reproductive life stage. Works better for races with a long lifespan</RSOption_MinSexableFromLifestage_Desc>
<RSOption_MaxSingleLustChange_Label>Maximum lust change per sex</RSOption_MaxSingleLustChange_Label>
<RSOption_MaxSingleLustChange_Desc>Set how much lust can change from a single sex act</RSOption_MaxSingleLustChange_Desc>
<RSOption_EnableBastardRelation_Label>Enable Bastard relation</RSOption_EnableBastardRelation_Label>
<RSOption_EnableBastardRelation_Desc>Child is marked as a bastard if they have only one parent or their parents are (or was) married</RSOption_EnableBastardRelation_Desc>
<Vaginal>Vaginal</Vaginal>
<Anal>Anal</Anal>

View File

@ -13,6 +13,7 @@ namespace RJWSexperience
public const float SexPerYearDefault = 30f;
public const bool SlavesBeenRapedExpDefault = true;
public const bool EnableStatRandomizerDefault = true;
public const bool EnableBastardRelationDefault = true;
public const float LustLimitDefault = MaxInitialLustDefault / 3f;
public const float MaxSingleLustChangeDefault = 0.5f;
public const bool MinSexableFromLifestageDefault = true;
@ -26,6 +27,7 @@ namespace RJWSexperience
private float sexPerYear = SexPerYearDefault;
private bool slavesBeenRapedExp = SlavesBeenRapedExpDefault;
private bool enableRecordRandomizer = EnableStatRandomizerDefault;
private bool enableBastardRelation = EnableBastardRelationDefault;
private float lustLimit = LustLimitDefault;
private bool minSexableFromLifestage = MinSexableFromLifestageDefault;
private float minSexablePercent = MinSexablePercentDefault;
@ -39,6 +41,7 @@ namespace RJWSexperience
public float SexPerYear { get => sexPerYear; }
public bool SlavesBeenRapedExp { get => slavesBeenRapedExp; }
public bool EnableRecordRandomizer { get => enableRecordRandomizer; }
public bool EnableBastardRelation { get => enableBastardRelation; }
public float LustLimit { get => lustLimit; }
public bool MinSexableFromLifestage { get => minSexableFromLifestage; }
public float MinSexablePercent { get => minSexablePercent; }
@ -59,6 +62,7 @@ namespace RJWSexperience
sexPerYear = SexPerYearDefault;
slavesBeenRapedExp = SlavesBeenRapedExpDefault;
enableRecordRandomizer = EnableStatRandomizerDefault;
enableBastardRelation = EnableBastardRelationDefault;
lustLimit = LustLimitDefault;
maxSingleLustChange = MaxSingleLustChangeDefault;
minSexableFromLifestage = MinSexableFromLifestageDefault;
@ -75,6 +79,7 @@ namespace RJWSexperience
Scribe_Values.Look(ref sexPerYear, "SexPerYear", SexPerYearDefault, true);
Scribe_Values.Look(ref slavesBeenRapedExp, "SlavesBeenRapedExp", SlavesBeenRapedExpDefault, true);
Scribe_Values.Look(ref enableRecordRandomizer, "EnableRecordRandomizer", EnableStatRandomizerDefault, true);
Scribe_Values.Look(ref enableBastardRelation, "EnableBastardRelation", EnableBastardRelationDefault, true);
Scribe_Values.Look(ref lustLimit, "LustLimit", LustLimitDefault, true);
Scribe_Values.Look(ref maxSingleLustChange, "maxSingleLustChange", MaxSingleLustChangeDefault, true);
Scribe_Values.Look(ref minSexableFromLifestage, "MinSexableFromLifestage", MinSexableFromLifestageDefault, true);
@ -121,6 +126,8 @@ namespace RJWSexperience
listmain.EndSection(section);
}
listmain.CheckboxLabeled(Keyed.Option_EnableBastardRelation_Label, ref enableBastardRelation, Keyed.Option_EnableBastardRelation_Desc);
if (listmain.ButtonText("reset to default"))
{
ResetToDefault();

View File

@ -87,6 +87,8 @@ namespace RJWSexperience
public static readonly string Option_MinSexableFromLifestage_Desc = "RSOption_MinSexableFromLifestage_Desc".Translate();
public static readonly string Option_MaxSingleLustChange_Label = "RSOption_MaxSingleLustChange_Label".Translate();
public static readonly string Option_MaxSingleLustChange_Desc = "RSOption_MaxSingleLustChange_Desc".Translate();
public static readonly string Option_EnableBastardRelation_Label = "RSOption_EnableBastardRelation_Label".Translate();
public static readonly string Option_EnableBastardRelation_Desc = "RSOption_EnableBastardRelation_Desc".Translate();
public static string Translate(this PartnerOrderMode mode)
{

View File

@ -0,0 +1,24 @@
using RimWorld;
using Verse;
namespace RJWSexperience
{
public class PawnRelationWorker_Bastard : PawnRelationWorker_Child
{
public override bool InRelation(Pawn me, Pawn other)
{
if (!SexperienceMod.Settings.EnableBastardRelation)
return false;
Pawn mother = other.GetMother();
Pawn father = other.GetFather();
if (me != other && (mother == me || father == me))
{
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));
}
return false;
}
}
}

View File

@ -1,31 +0,0 @@
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))
{
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));
}
return false;
}
}
}

View File

@ -82,7 +82,7 @@
<Compile Include="SexHistory\HistoryUtility.cs" />
<Compile Include="SexHistory\SexPartnerHistory.cs" />
<Compile Include="SexHistory\SexPartnerHistoryRecord.cs" />
<Compile Include="PawnRelationWorkers.cs" />
<Compile Include="PawnRelationWorker_Bastard.cs" />
<Compile Include="Keyed.cs" />
<Compile Include="Patches\Rimworld_Patch.cs" />
<Compile Include="Patches\RJW_Patch.cs" />