Compare commits

..

No commits in common. "670584500b87e43fdcd6bcbf179bd9ecb547f315" and "f7206347da813223dbc8fafc9495de92a96ba66c" have entirely different histories.

17 changed files with 377 additions and 358 deletions

View file

@ -7,16 +7,16 @@ using Verse;
namespace RJWSexperience.Ideology namespace RJWSexperience.Ideology
{ {
internal static class DebugAction internal class DebugAction
{ {
[DebugAction("RJW Sexperience Ideology", "Test marriage event", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)] [DebugAction("RJW Sexperience Ideology", "Test marriage event", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)]
public static void GenerateMarriageEvent(Pawn p) private static void GenerateMarriageEvent(Pawn p)
{ {
Pawn hero = p.Map.PlayerPawnsForStoryteller.First(x => x.IsDesignatedHero()); Pawn hero = p.Map.PlayerPawnsForStoryteller.First(x => x.IsDesignatedHero());
if (hero == null) if (hero == null)
return; return;
RsiDefOf.HistoryEvent.RSI_NonIncestuosMarriage.RecordEventWithPartner(hero, p); RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(hero, p);
RsiDefOf.HistoryEvent.RSI_NonIncestuosMarriage.RecordEventWithPartner(p, hero); RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(p, hero);
} }
[DebugAction("RJW Sexperience Ideology", "Manual romance check", false, true, actionType = DebugActionType.Action, allowedGameStates = AllowedGameStates.PlayingOnMap)] [DebugAction("RJW Sexperience Ideology", "Manual romance check", false, true, actionType = DebugActionType.Action, allowedGameStates = AllowedGameStates.PlayingOnMap)]

View file

@ -12,9 +12,9 @@ namespace RJWSexperience.Ideology
if (ideo == null) if (ideo == null)
return false; return false;
if (ideo.HasPrecept(RsiDefOf.Precept.Submissive_Female) && pawn.gender == Gender.Female) if (ideo.HasPrecept(RsiPreceptDefOf.Submissive_Female) && pawn.gender == Gender.Female)
return true; return true;
else if (ideo.HasPrecept(RsiDefOf.Precept.Submissive_Male) && pawn.gender == Gender.Male) else if (ideo.HasPrecept(RsiPreceptDefOf.Submissive_Male) && pawn.gender == Gender.Male)
return true; return true;
return false; return false;
@ -89,7 +89,7 @@ namespace RJWSexperience.Ideology
Hediff pregnancy = PregnancyHelper.GetPregnancy(pawn); Hediff pregnancy = PregnancyHelper.GetPregnancy(pawn);
// Currently RJW does not check Biotech pregnancy // Currently RJW does not check Biotech pregnancy
if (pregnancy == null && RsiDefOf.Hediff.PregnantHuman != null) if (pregnancy == null && VariousDefOf.PregnantHuman != null)
{ {
pregnancy = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnantHuman); pregnancy = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnantHuman);
} }

View file

@ -63,6 +63,8 @@
<Compile Include="Filters\RelationFilter.cs" /> <Compile Include="Filters\RelationFilter.cs" />
<Compile Include="RelationHelpers.cs" /> <Compile Include="RelationHelpers.cs" />
<Compile Include="RomanceChanceFactorHelpers.cs" /> <Compile Include="RomanceChanceFactorHelpers.cs" />
<Compile Include="RsiHistoryEventDefOf.cs" />
<Compile Include="RsiPreceptDefOf.cs" />
<Compile Include="Filters\TwoPawnFilter.cs" /> <Compile Include="Filters\TwoPawnFilter.cs" />
<Compile Include="Filters\SinglePawnFilter.cs" /> <Compile Include="Filters\SinglePawnFilter.cs" />
<Compile Include="Precepts\Comp_SelfTookMemoryThought_Gendered.cs" /> <Compile Include="Precepts\Comp_SelfTookMemoryThought_Gendered.cs" />
@ -93,7 +95,7 @@
<Compile Include="Thoughts\ThoughtDefExtension_StageFromValue.cs" /> <Compile Include="Thoughts\ThoughtDefExtension_StageFromValue.cs" />
<Compile Include="Thoughts\Thought_IncreaseRecord.cs" /> <Compile Include="Thoughts\Thought_IncreaseRecord.cs" />
<Compile Include="Thoughts\Thought_Opinionbased.cs" /> <Compile Include="Thoughts\Thought_Opinionbased.cs" />
<Compile Include="RsiDefOf.cs" /> <Compile Include="VariousDefOf.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref"> <PackageReference Include="Krafs.Rimworld.Ref">

View file

@ -15,7 +15,7 @@ namespace RJWSexperience.Ideology.Patches
if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc
return; return;
if (!RsiDefOf.HistoryEvent.RSI_SexWithAnimal.CreateEvent(pawn).DoerWillingToDo()) if (!RsiHistoryEventDefOf.RSI_SexWithAnimal.CreateEvent(pawn).DoerWillingToDo())
{ {
__result = -2f; __result = -2f;
return; return;
@ -32,7 +32,7 @@ namespace RJWSexperience.Ideology.Patches
if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc
return; return;
if (!RsiDefOf.HistoryEvent.RSI_Raped.CreateEvent(pawn).DoerWillingToDo()) if (!RsiHistoryEventDefOf.RSI_Raped.CreateEvent(pawn).DoerWillingToDo())
{ {
__result = -2f; __result = -2f;
return; return;
@ -48,7 +48,7 @@ namespace RJWSexperience.Ideology.Patches
if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc
return; return;
if (!RsiDefOf.HistoryEvent.RSI_SexWithCorpse.CreateEvent(pawn).DoerWillingToDo()) if (!RsiHistoryEventDefOf.RSI_SexWithCorpse.CreateEvent(pawn).DoerWillingToDo())
{ {
__result = -2f; __result = -2f;
return; return;
@ -65,7 +65,7 @@ namespace RJWSexperience.Ideology.Patches
if (__result < 0f || p.Ideo == null) // ideo is null if don't have dlc if (__result < 0f || p.Ideo == null) // ideo is null if don't have dlc
return; return;
if (!RsiDefOf.HistoryEvent.RSI_Masturbated.CreateEvent(p).DoerWillingToDo()) if (!RsiHistoryEventDefOf.RSI_Masturbated.CreateEvent(p).DoerWillingToDo())
{ {
__result = -2f; __result = -2f;
return; return;

View file

@ -19,7 +19,7 @@ namespace RJWSexperience.Ideology.Patches
Ideo ideo = pawn.Ideo; Ideo ideo = pawn.Ideo;
if (ideo != null && !pawn.IsSubmissive()) if (ideo != null && !pawn.IsSubmissive())
{ {
__result = __result || ideo.HasMeme(RsiDefOf.Meme.Rapist); __result = __result || ideo.HasMeme(VariousDefOf.Rapist);
} }
} }
} }
@ -32,7 +32,7 @@ namespace RJWSexperience.Ideology.Patches
Ideo ideo = pawn.Ideo; Ideo ideo = pawn.Ideo;
if (ideo != null) if (ideo != null)
{ {
__result = __result || ideo.HasMeme(RsiDefOf.Meme.Zoophile); __result = __result || ideo.HasMeme(VariousDefOf.Zoophile);
} }
} }
} }
@ -45,7 +45,7 @@ namespace RJWSexperience.Ideology.Patches
Ideo ideo = pawn.Ideo; Ideo ideo = pawn.Ideo;
if (ideo != null) if (ideo != null)
{ {
__result = __result || ideo.HasMeme(RsiDefOf.Meme.Necrophile); __result = __result || ideo.HasMeme(VariousDefOf.Necrophile);
} }
} }
} }
@ -85,10 +85,10 @@ namespace RJWSexperience.Ideology.Patches
private static void AfterSexHuman(Pawn human, Pawn partner) private static void AfterSexHuman(Pawn human, Pawn partner)
{ {
RsiDefOf.HistoryEvent.RSI_NonIncestuosSex.RecordEventWithPartner(human, partner); RsiHistoryEventDefOf.RSI_NonIncestuosSex.RecordEventWithPartner(human, partner);
if (partner.IsAnimal()) if (partner.IsAnimal())
RsiDefOf.HistoryEvent.RSI_SexWithAnimal.RecordEventWithPartner(human, partner); RsiHistoryEventDefOf.RSI_SexWithAnimal.RecordEventWithPartner(human, partner);
} }
} }
@ -113,13 +113,11 @@ namespace RJWSexperience.Ideology.Patches
public static float PreceptSextype(Pawn pawn, Pawn partner, float score, List<HistoryEventDef> historyEventDefs) public static float PreceptSextype(Pawn pawn, Pawn partner, float score, List<HistoryEventDef> historyEventDefs)
{ {
for (int i = 0; i < historyEventDefs.Count; i++) foreach(HistoryEventDef eventDef in historyEventDefs)
{ {
HistoryEventDef eventDef = historyEventDefs[i];
if (eventDef.CreateEventWithPartner(pawn, partner).DoerWillingToDo()) if (eventDef.CreateEventWithPartner(pawn, partner).DoerWillingToDo())
{ {
float mult = 8.0f * Math.Max(0.3f, 1 / Math.Max(0.01f, pawn.GetStatValue(xxx.sex_drive_stat, cacheStaleAfterTicks: 60))); float mult = 8.0f * Math.Max(0.3f, 1 / Math.Max(0.01f, pawn.GetStatValue(xxx.sex_drive_stat)));
return score * mult; return score * mult;
} }
} }
@ -150,7 +148,7 @@ namespace RJWSexperience.Ideology.Patches
public static void Postfix(Pawn pawn, ref bool __result) public static void Postfix(Pawn pawn, ref bool __result)
{ {
Ideo ideo = pawn.Ideo; Ideo ideo = pawn.Ideo;
if (ideo?.HasMeme(RsiDefOf.Meme.Zoophile) == true) if (ideo?.HasMeme(VariousDefOf.Zoophile) == true)
{ {
SaveStorage.DataStore.GetPawnData(pawn).CanDesignateBreeding = true; SaveStorage.DataStore.GetPawnData(pawn).CanDesignateBreeding = true;
__result = true; __result = true;
@ -215,14 +213,14 @@ namespace RJWSexperience.Ideology.Patches
Ideo mainideo = playerfaction.ideos.PrimaryIdeo; Ideo mainideo = playerfaction.ideos.PrimaryIdeo;
if (mainideo != null) if (mainideo != null)
{ {
if (mainideo.HasPrecept(RsiDefOf.Precept.BabyFaction_AlwaysFather)) if (mainideo.HasPrecept(RsiPreceptDefOf.BabyFaction_AlwaysFather))
{ {
Pawn parent = baby.GetFather() ?? baby.GetMother(); Pawn parent = baby.GetFather() ?? baby.GetMother();
ideo = parent.Ideo; ideo = parent.Ideo;
return parent.Faction; return parent.Faction;
} }
else if (mainideo.HasPrecept(RsiDefOf.Precept.BabyFaction_AlwaysColony)) else if (mainideo.HasPrecept(RsiPreceptDefOf.BabyFaction_AlwaysColony))
{ {
ideo = mainideo; ideo = mainideo;
return playerfaction; return playerfaction;
@ -243,7 +241,7 @@ namespace RJWSexperience.Ideology.Patches
if (props.pawn?.Ideo == null || !props.hasPartner()) if (props.pawn?.Ideo == null || !props.hasPartner())
return; return;
if (props.partner.Ideo?.HasPrecept(RsiDefOf.Precept.ProselyzingByOrgasm) == true) if (props.partner.Ideo?.HasPrecept(RsiPreceptDefOf.ProselyzingByOrgasm) == true)
{ {
// Pawn is the one having the orgasm // Pawn is the one having the orgasm
// Partner is "giving" the orgasm, hence the pawn will be converted towards the partners ideology // Partner is "giving" the orgasm, hence the pawn will be converted towards the partners ideology

View file

@ -16,8 +16,8 @@ namespace RJWSexperience.Ideology.Patches
{ {
public static void Postfix(Pawn firstPawn, Pawn secondPawn) public static void Postfix(Pawn firstPawn, Pawn secondPawn)
{ {
RsiDefOf.HistoryEvent.RSI_NonIncestuosMarriage.RecordEventWithPartner(firstPawn, secondPawn); RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(firstPawn, secondPawn);
RsiDefOf.HistoryEvent.RSI_NonIncestuosMarriage.RecordEventWithPartner(secondPawn, firstPawn); RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(secondPawn, firstPawn);
} }
} }
@ -81,7 +81,7 @@ namespace RJWSexperience.Ideology.Patches
/// <returns>Forbid romance option</returns> /// <returns>Forbid romance option</returns>
public static bool RsiIncestuous(Pawn one, Pawn two) public static bool RsiIncestuous(Pawn one, Pawn two)
{ {
PreceptDef incestuousPrecept = one.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == RsiDefOf.Issue.Incestuos); PreceptDef incestuousPrecept = one.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == VariousDefOf.Incestuos);
var allowManualRomanceOnlyFor = incestuousPrecept?.GetModExtension<DefExtension_Incest>()?.allowManualRomanceOnlyFor; var allowManualRomanceOnlyFor = incestuousPrecept?.GetModExtension<DefExtension_Incest>()?.allowManualRomanceOnlyFor;
BloodRelationDegree relationDegree = RelationHelpers.GetBloodRelationDegree(one, two); BloodRelationDegree relationDegree = RelationHelpers.GetBloodRelationDegree(one, two);

View file

@ -15,11 +15,11 @@ namespace RJWSexperience.Ideology.Patches
const int femaleAfterSurgery = 1; const int femaleAfterSurgery = 1;
if (props.isRape && exVirgin == props.partner) if (props.isRape && exVirgin == props.partner)
RsiDefOf.HistoryEvent.RSI_VirginStolen.RecordEventWithPartner(exVirgin, partner); RsiHistoryEventDefOf.RSI_VirginStolen.RecordEventWithPartner(exVirgin, partner);
else if (degree != femaleAfterSurgery) else if (degree != femaleAfterSurgery)
RsiDefOf.HistoryEvent.RSI_VirginTaken.RecordEventWithPartner(exVirgin, partner); RsiHistoryEventDefOf.RSI_VirginTaken.RecordEventWithPartner(exVirgin, partner);
RsiDefOf.HistoryEvent.RSI_TookVirgin.RecordEventWithPartner(partner, exVirgin); RsiHistoryEventDefOf.RSI_TookVirgin.RecordEventWithPartner(partner, exVirgin);
} }
} }
} }

View file

@ -1,9 +1,13 @@
using RimWorld; using System;
using rjw;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using rjw;
using Verse; using Verse;
using Verse.AI; using Verse.AI;
using RimWorld;
namespace RJWSexperience.Ideology namespace RJWSexperience.Ideology
{ {
@ -11,24 +15,26 @@ namespace RJWSexperience.Ideology
{ {
protected override Job TryGiveJob(Pawn pawn) protected override Job TryGiveJob(Pawn pawn)
{ {
if (pawn.Drafted || pawn.mindState == null) if (pawn.Drafted) return null;
DutyDef dutyDef = null;
PawnDuty duty = null;
if (pawn.mindState != null)
{ {
return null; duty = pawn.mindState.duty;
dutyDef = duty.def;
} }
else return null;
PawnDuty duty = pawn.mindState.duty; if (dutyDef == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn))
if (duty.def == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn))
{ {
return null; return null;
} }
Pawn target = FindPartner(pawn, duty); Pawn target = FindPartner(pawn, duty);
if (target == null || !pawn.CanReserveAndReach(target, PathEndMode.ClosestTouch, Danger.None, 1)) if (target == null || !pawn.CanReserveAndReach(target, PathEndMode.ClosestTouch, Danger.None,1)) return JobMaker.MakeJob(VariousDefOf.DrugMasturbate);
return JobMaker.MakeJob(RsiDefOf.Job.DrugMasturbate);
return JobMaker.MakeJob(RsiDefOf.Job.DrugSex, target); return JobMaker.MakeJob(VariousDefOf.DrugSex, target);
} }
protected Pawn FindPartner(Pawn pawn, PawnDuty duty) protected Pawn FindPartner(Pawn pawn, PawnDuty duty)
@ -36,11 +42,14 @@ namespace RJWSexperience.Ideology
if (duty != null) if (duty != null)
{ {
List<Pawn> pawns = pawn.Map.mapPawns.AllPawnsSpawned.FindAll(x => x.mindState?.duty?.def == duty.def); List<Pawn> pawns = pawn.Map.mapPawns.AllPawnsSpawned.FindAll(x => x.mindState?.duty?.def == duty.def);
return pawns.RandomElementByWeightWithDefault(x => SexAppraiser.would_fuck(pawn, x), 0.1f); return pawns.RandomElementByWeightWithDefault(x => SexAppraiser.would_fuck(pawn,x), 0.1f);
} }
return null; return null;
} }
} }
/// <summary> /// <summary>
@ -56,7 +65,7 @@ namespace RJWSexperience.Ideology
protected override IEnumerable<Toil> MakeNewToils() protected override IEnumerable<Toil> MakeNewToils()
{ {
setup_ticks(); setup_ticks();
var PartnerJob = RsiDefOf.Job.GettinDrugSex; var PartnerJob = VariousDefOf.GettinDrugSex;
this.FailOnDespawnedNullOrForbidden(iTarget); this.FailOnDespawnedNullOrForbidden(iTarget);
this.FailOn(() => !Partner.health.capacities.CanBeAwake); this.FailOn(() => !Partner.health.capacities.CanBeAwake);
@ -64,46 +73,41 @@ namespace RJWSexperience.Ideology
this.FailOn(() => Partner == null); this.FailOn(() => Partner == null);
yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell);
Toil WaitForPartner = new Toil Toil WaitForPartner = new Toil();
{ WaitForPartner.defaultCompleteMode = ToilCompleteMode.Delay;
defaultCompleteMode = ToilCompleteMode.Delay, WaitForPartner.initAction = delegate
initAction = delegate
{ {
ticksLeftThisToil = 5000; ticksLeftThisToil = 5000;
}, };
tickAction = delegate WaitForPartner.tickAction = delegate
{ {
pawn.GainComfortFromCellIfPossible(); pawn.GainComfortFromCellIfPossible();
if (pawn.Position.DistanceTo(Partner.Position) <= 1f) if (pawn.Position.DistanceTo(Partner.Position) <= 1f)
{ {
ReadyForNextToil(); ReadyForNextToil();
} }
}
}; };
yield return WaitForPartner; yield return WaitForPartner;
Toil StartPartnerJob = new Toil Toil StartPartnerJob = new Toil();
StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant;
StartPartnerJob.socialMode = RandomSocialMode.Off;
StartPartnerJob.initAction = delegate
{ {
defaultCompleteMode = ToilCompleteMode.Instant, var dri = Partner.jobs.curDriver as JobDriver_DrugSexReceiver;
socialMode = RandomSocialMode.Off, if (dri == null)
initAction = delegate
{
if (!(Partner.jobs.curDriver is JobDriver_DrugSexReceiver))
{ {
Job gettingQuickie = JobMaker.MakeJob(PartnerJob, pawn, Partner); Job gettingQuickie = JobMaker.MakeJob(PartnerJob, pawn, Partner);
Partner.jobs.StartJob(gettingQuickie, JobCondition.InterruptForced); Partner.jobs.StartJob(gettingQuickie, JobCondition.InterruptForced);
} }
}
}; };
yield return StartPartnerJob; yield return StartPartnerJob;
Toil SexToil = new Toil Toil SexToil = new Toil();
{ SexToil.defaultCompleteMode = ToilCompleteMode.Never;
defaultCompleteMode = ToilCompleteMode.Never, SexToil.socialMode = RandomSocialMode.Off;
socialMode = RandomSocialMode.Off, SexToil.defaultDuration = duration;
defaultDuration = duration, SexToil.handlingFacing = true;
handlingFacing = true
};
SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.FailOn(() => Partner.CurJob.def != PartnerJob);
SexToil.initAction = delegate SexToil.initAction = delegate
{ {
@ -144,6 +148,7 @@ namespace RJWSexperience.Ideology
/// </summary> /// </summary>
public class JobDriver_DrugSexReceiver : JobDriver_SexBaseRecieverLoved public class JobDriver_DrugSexReceiver : JobDriver_SexBaseRecieverLoved
{ {
protected override IEnumerable<Toil> MakeNewToils() protected override IEnumerable<Toil> MakeNewToils()
{ {
setup_ticks(); setup_ticks();
@ -170,18 +175,16 @@ namespace RJWSexperience.Ideology
protected Toil MakeSexToil() protected Toil MakeSexToil()
{ {
Toil get_loved = new Toil Toil get_loved = new Toil();
get_loved.defaultCompleteMode = ToilCompleteMode.Never;
get_loved.socialMode = RandomSocialMode.Off;
get_loved.handlingFacing = true;
get_loved.tickAction = delegate
{ {
defaultCompleteMode = ToilCompleteMode.Never,
socialMode = RandomSocialMode.Off,
handlingFacing = true,
tickAction = delegate
{
}
}; };
get_loved.AddEndCondition(new Func<JobCondition>(() => get_loved.AddEndCondition(new Func<JobCondition>(() =>
{ {
if (parteners.Count == 0) if (parteners.Count <= 0)
{ {
return JobCondition.Succeeded; return JobCondition.Succeeded;
} }
@ -202,6 +205,7 @@ namespace RJWSexperience.Ideology
/// </summary> /// </summary>
public class JobDriver_DrugMasturabate : JobDriver_Masturbate public class JobDriver_DrugMasturabate : JobDriver_Masturbate
{ {
protected override IEnumerable<Toil> MakeNewToils() protected override IEnumerable<Toil> MakeNewToils()
{ {
setup_ticks(); setup_ticks();
@ -248,4 +252,6 @@ namespace RJWSexperience.Ideology
}; };
} }
} }
} }

View file

@ -1,9 +1,13 @@
using RimWorld; using System;
using rjw;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse; using Verse;
using Verse.AI; using Verse.AI;
using Verse.AI.Group;
using RimWorld;
using rjw;
namespace RJWSexperience.Ideology namespace RJWSexperience.Ideology
{ {
@ -11,27 +15,30 @@ namespace RJWSexperience.Ideology
{ {
protected override Job TryGiveJob(Pawn pawn) protected override Job TryGiveJob(Pawn pawn)
{ {
if (pawn.Drafted || pawn.mindState == null) if (pawn.Drafted) return null;
DutyDef dutyDef = null;
PawnDuty duty = null;
if (pawn.mindState != null)
{ {
return null; duty = pawn.mindState.duty;
dutyDef = duty.def;
} }
else return null;
PawnDuty duty = pawn.mindState.duty; if (dutyDef == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn))
if (duty.def == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn))
{ {
return null; return null;
} }
Pawn target = duty.focusSecond.Pawn; Pawn target = duty.focusSecond.Pawn;
if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) return null;
return null;
return JobMaker.MakeJob(RsiDefOf.Job.Gangbang, target); return JobMaker.MakeJob(VariousDefOf.Gangbang, target);
} }
} }
public class JobDriver_Gangbang : JobDriver_SexBaseInitiator public class JobDriver_Gangbang : JobDriver_SexBaseInitiator
{ {
public override bool TryMakePreToilReservations(bool errorOnFailed) public override bool TryMakePreToilReservations(bool errorOnFailed)
@ -49,28 +56,26 @@ namespace RJWSexperience.Ideology
this.FailOn(() => Partner.Drafted); this.FailOn(() => Partner.Drafted);
yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell);
Toil StartPartnerJob = new Toil Toil StartPartnerJob = new Toil();
StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant;
StartPartnerJob.socialMode = RandomSocialMode.Off;
StartPartnerJob.initAction = delegate
{ {
defaultCompleteMode = ToilCompleteMode.Instant,
socialMode = RandomSocialMode.Off, var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped;
initAction = delegate if (dri == null)
{ {
if (!(Partner.jobs.curDriver is JobDriver_SexBaseRecieverRaped)) Job gettin_loved = JobMaker.MakeJob(VariousDefOf.GettinGangbang, pawn, Bed);
{
Job gettin_loved = JobMaker.MakeJob(RsiDefOf.Job.GettinGangbang, pawn, Bed);
Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced); Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced);
} }
}
}; };
yield return StartPartnerJob; yield return StartPartnerJob;
Toil SexToil = new Toil Toil SexToil = new Toil();
{ SexToil.defaultCompleteMode = ToilCompleteMode.Never;
defaultCompleteMode = ToilCompleteMode.Never, SexToil.defaultDuration = duration;
defaultDuration = duration, SexToil.handlingFacing = true;
handlingFacing = true SexToil.FailOn(() => Partner.CurJob.def != VariousDefOf.GettinGangbang);
};
SexToil.FailOn(() => Partner.CurJob.def != RsiDefOf.Job.GettinGangbang);
SexToil.initAction = delegate SexToil.initAction = delegate
{ {
Start(); Start();
@ -109,24 +114,22 @@ namespace RJWSexperience.Ideology
setup_ticks(); setup_ticks();
parteners.Add(Partner);// add job starter, so this wont fail, before Initiator starts his job parteners.Add(Partner);// add job starter, so this wont fail, before Initiator starts his job
Toil get_banged = new Toil Toil get_banged = new Toil();
{ get_banged.defaultCompleteMode = ToilCompleteMode.Never;
defaultCompleteMode = ToilCompleteMode.Never, get_banged.handlingFacing = true;
handlingFacing = true, get_banged.initAction = delegate
initAction = delegate
{ {
pawn.pather.StopDead(); pawn.pather.StopDead();
pawn.jobs.curDriver.asleep = false; pawn.jobs.curDriver.asleep = false;
}, };
tickAction = delegate get_banged.tickAction = delegate
{ {
if ((parteners.Count > 0) && pawn.IsHashIntervalTick(ticks_between_hearts / parteners.Count) && pawn.IsHashIntervalTick(ticks_between_hearts)) if ((parteners.Count > 0) && pawn.IsHashIntervalTick(ticks_between_hearts / parteners.Count) && pawn.IsHashIntervalTick(ticks_between_hearts))
ThrowMetaIconF(pawn.Position, pawn.Map, FleckDefOf.Heart); ThrowMetaIconF(pawn.Position, pawn.Map, FleckDefOf.Heart);
}
}; };
get_banged.AddEndCondition(new Func<JobCondition>(() => get_banged.AddEndCondition(new Func<JobCondition>(() =>
{ {
if (parteners.Count == 0) if (parteners.Count <= 0)
{ {
return JobCondition.Succeeded; return JobCondition.Succeeded;
} }
@ -145,12 +148,12 @@ namespace RJWSexperience.Ideology
Partner.jobs.jobQueue.EnqueueFirst(tobed); Partner.jobs.jobQueue.EnqueueFirst(tobed);
} }
else if (pawn.HostileTo(Partner)) else if (pawn.HostileTo(Partner))
{
pawn.health.AddHediff(xxx.submitting); pawn.health.AddHediff(xxx.submitting);
}
}); });
get_banged.socialMode = RandomSocialMode.Off; get_banged.socialMode = RandomSocialMode.Off;
yield return get_banged; yield return get_banged;
} }
} }
} }

View file

@ -1,8 +1,14 @@
using RimWorld; using System;
using rjw;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse; using Verse;
using Verse.AI; using Verse.AI;
using Verse.AI.Group;
using RimWorld;
using rjw;
namespace RJWSexperience.Ideology namespace RJWSexperience.Ideology
{ {
@ -10,14 +16,17 @@ namespace RJWSexperience.Ideology
{ {
protected override Job TryGiveJob(Pawn pawn) protected override Job TryGiveJob(Pawn pawn)
{ {
if (pawn.Drafted || pawn.mindState == null) if (pawn.Drafted) return null;
DutyDef dutyDef = null;
PawnDuty duty = null;
if (pawn.mindState != null)
{ {
return null; duty = pawn.mindState.duty;
dutyDef = duty.def;
} }
else return null;
PawnDuty duty = pawn.mindState.duty; if (dutyDef == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn))
if (duty.def == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn))
{ {
return null; return null;
} }
@ -26,10 +35,11 @@ namespace RJWSexperience.Ideology
if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) return null; if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) return null;
return JobMaker.MakeJob(RsiDefOf.Job.RapeVictim, target); return JobMaker.MakeJob(VariousDefOf.RapeVictim, target);
} }
} }
/// <summary> /// <summary>
/// copied from rjw /// copied from rjw
/// </summary> /// </summary>
@ -54,28 +64,25 @@ namespace RJWSexperience.Ideology
SexUtility.RapeTargetAlert(pawn, Partner); SexUtility.RapeTargetAlert(pawn, Partner);
Toil StartPartnerJob = new Toil Toil StartPartnerJob = new Toil();
StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant;
StartPartnerJob.socialMode = RandomSocialMode.Off;
StartPartnerJob.initAction = delegate
{ {
defaultCompleteMode = ToilCompleteMode.Instant, var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped;
socialMode = RandomSocialMode.Off, if (dri == null)
initAction = delegate
{
if (!(Partner.jobs.curDriver is JobDriver_SexBaseRecieverRaped))
{ {
Job gettin_raped = JobMaker.MakeJob(PartnerJob, pawn); Job gettin_raped = JobMaker.MakeJob(PartnerJob, pawn);
Partner.jobs.StartJob(gettin_raped, JobCondition.InterruptForced, null, false, true, null); Partner.jobs.StartJob(gettin_raped, JobCondition.InterruptForced, null, false, true, null);
} }
}
}; };
yield return StartPartnerJob; yield return StartPartnerJob;
Toil SexToil = new Toil Toil SexToil = new Toil();
{ SexToil.defaultCompleteMode = ToilCompleteMode.Never;
defaultCompleteMode = ToilCompleteMode.Never, SexToil.defaultDuration = duration;
defaultDuration = duration, SexToil.handlingFacing = true;
handlingFacing = true
};
SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.FailOn(() => Partner.CurJob.def != PartnerJob);
SexToil.initAction = delegate SexToil.initAction = delegate
{ {

View file

@ -1,6 +1,12 @@
using RimWorld; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse; using Verse;
using Verse.AI;
using RimWorld;
namespace RJWSexperience.Ideology namespace RJWSexperience.Ideology
{ {
@ -8,7 +14,7 @@ namespace RJWSexperience.Ideology
{ {
public LordJob_Ritual_Gangbang() { } public LordJob_Ritual_Gangbang() { }
public LordJob_Ritual_Gangbang(string targetID, TargetInfo selectedTarget, Precept_Ritual ritual, RitualObligation obligation, List<RitualStage> allStages, RitualRoleAssignments assignments, Pawn organizer = null) : base(selectedTarget, ritual, obligation, allStages, assignments, organizer) public LordJob_Ritual_Gangbang(string targetID ,TargetInfo selectedTarget, Precept_Ritual ritual, RitualObligation obligation, List<RitualStage> allStages, RitualRoleAssignments assignments, Pawn organizer = null) : base(selectedTarget, ritual, obligation, allStages, assignments, organizer)
{ {
foreach (RitualRole ritualRole in assignments.AllRolesForReading) foreach (RitualRole ritualRole in assignments.AllRolesForReading)
{ {
@ -19,5 +25,6 @@ namespace RJWSexperience.Ideology
} }
} }
} }
} }
} }

View file

@ -1,6 +1,6 @@
using RimWorld; using RimWorld;
using rjw;
using Verse; using Verse;
using rjw;
namespace RJWSexperience.Ideology namespace RJWSexperience.Ideology
{ {
@ -42,6 +42,7 @@ namespace RJWSexperience.Ideology
public override bool AppliesToPawn(Pawn p, out string reason, TargetInfo selectedTarget, LordJob_Ritual ritual = null, RitualRoleAssignments assignments = null, Precept_Ritual precept = null, bool skipReason = false) public override bool AppliesToPawn(Pawn p, out string reason, TargetInfo selectedTarget, LordJob_Ritual ritual = null, RitualRoleAssignments assignments = null, Precept_Ritual precept = null, bool skipReason = false)
{ {
reason = null; reason = null;
if (!xxx.is_human(p)) if (!xxx.is_human(p))
{ {
@ -56,7 +57,11 @@ namespace RJWSexperience.Ideology
return false; return false;
} }
public static bool CanBeBreedee(Pawn pawn) => xxx.can_be_fucked(pawn); public static bool CanBeBreedee(Pawn pawn)
{
if (xxx.can_be_fucked(pawn)) return true;
return false;
}
} }
public class RitualRole_AnimalBreeder : RitualRole public class RitualRole_AnimalBreeder : RitualRole
@ -87,15 +92,15 @@ namespace RJWSexperience.Ideology
public static bool CanBeBreeder(Pawn animal, Precept_Ritual precept) public static bool CanBeBreeder(Pawn animal, Precept_Ritual precept)
{ {
if (precept != null && precept.ideo.HasPrecept(RsiDefOf.Precept.Bestiality_OnlyVenerated) && !precept.ideo.IsVeneratedAnimal(animal)) if (precept != null && precept.ideo.HasPrecept(RsiPreceptDefOf.Bestiality_OnlyVenerated) && !precept.ideo.IsVeneratedAnimal(animal))
{
return false;
}
if (!xxx.can_rape(animal))
{ {
return false; return false;
} }
if (!xxx.can_rape(animal)) return false;
return true; return true;
} }
} }
} }

View file

@ -22,7 +22,7 @@ namespace RJWSexperience.Ideology
if (!pawn.relations.FamilyByBlood.Contains(partner)) if (!pawn.relations.FamilyByBlood.Contains(partner))
{ {
if (pawn.Ideo?.HasPrecept(RsiDefOf.Precept.Incestuos_IncestOnly) == true) if (pawn.Ideo?.HasPrecept(RsiPreceptDefOf.Incestuos_IncestOnly) == true)
{ {
return parentRomanceChanceFactor; return parentRomanceChanceFactor;
} }
@ -32,7 +32,7 @@ namespace RJWSexperience.Ideology
} }
} }
PreceptDef incestuousPrecept = pawn.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == RsiDefOf.Issue.Incestuos); PreceptDef incestuousPrecept = pawn.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == VariousDefOf.Incestuos);
IEnumerable<PawnRelationDef> relations = pawn.GetRelations(partner).Where(def => def.familyByBloodRelation); IEnumerable<PawnRelationDef> relations = pawn.GetRelations(partner).Where(def => def.familyByBloodRelation);
foreach (PawnRelationDef relationDef in relations) foreach (PawnRelationDef relationDef in relations)
{ {
@ -74,7 +74,7 @@ namespace RJWSexperience.Ideology
{ {
IEnumerable<PreceptDef> incestuousPrecepts = DefDatabase<PreceptDef> IEnumerable<PreceptDef> incestuousPrecepts = DefDatabase<PreceptDef>
.AllDefsListForReading .AllDefsListForReading
.Where(def => def.issue == RsiDefOf.Issue.Incestuos); .Where(def => def.issue == VariousDefOf.Incestuos);
IEnumerable<TableDataGetter<PawnRelationDef>> preceptGetters = incestuousPrecepts IEnumerable<TableDataGetter<PawnRelationDef>> preceptGetters = incestuousPrecepts
.Select(precept => new TableDataGetter<PawnRelationDef>(precept.defName,(PawnRelationDef rel) => GetRomanceChanceFactor(rel, precept))); .Select(precept => new TableDataGetter<PawnRelationDef>(precept.defName,(PawnRelationDef rel) => GetRomanceChanceFactor(rel, precept)));

View file

@ -1,65 +0,0 @@
using RimWorld;
using Verse;
namespace RJWSexperience.Ideology
{
public static class RsiDefOf
{
[DefOf]
public static class Job
{
public static readonly JobDef RapeVictim;
public static readonly JobDef Gangbang;
public static readonly JobDef GettinGangbang;
public static readonly JobDef DrugSex;
public static readonly JobDef GettinDrugSex;
public static readonly JobDef DrugMasturbate;
}
[DefOf]
public static class Meme
{
public static readonly MemeDef Zoophile;
public static readonly MemeDef Rapist;
public static readonly MemeDef Necrophile;
}
[DefOf]
public static class Issue
{
public static readonly IssueDef Incestuos;
}
[DefOf]
public static class Precept
{
public static readonly PreceptDef Incestuos_IncestOnly;
public static readonly PreceptDef Bestiality_OnlyVenerated;
public static readonly PreceptDef BabyFaction_AlwaysFather;
public static readonly PreceptDef BabyFaction_AlwaysColony;
public static readonly PreceptDef Submissive_Male;
public static readonly PreceptDef Submissive_Female;
public static readonly PreceptDef ProselyzingByOrgasm;
}
[DefOf]
public static class HistoryEvent
{
public static readonly HistoryEventDef RSI_SexWithAnimal;
public static readonly HistoryEventDef RSI_Raped;
public static readonly HistoryEventDef RSI_NonIncestuosMarriage;
public static readonly HistoryEventDef RSI_NonIncestuosSex;
public static readonly HistoryEventDef RSI_SexWithCorpse;
public static readonly HistoryEventDef RSI_VirginTaken;
public static readonly HistoryEventDef RSI_VirginStolen;
public static readonly HistoryEventDef RSI_TookVirgin;
public static readonly HistoryEventDef RSI_Masturbated;
}
[DefOf]
public static class Hediff
{
[MayRequireBiotech] public static readonly HediffDef PregnantHuman;
}
}
}

View file

@ -0,0 +1,18 @@
using RimWorld;
namespace RJWSexperience.Ideology
{
[DefOf]
public static class RsiHistoryEventDefOf
{
public static readonly HistoryEventDef RSI_SexWithAnimal;
public static readonly HistoryEventDef RSI_Raped;
public static readonly HistoryEventDef RSI_NonIncestuosMarriage;
public static readonly HistoryEventDef RSI_NonIncestuosSex;
public static readonly HistoryEventDef RSI_SexWithCorpse;
public static readonly HistoryEventDef RSI_VirginTaken;
public static readonly HistoryEventDef RSI_VirginStolen;
public static readonly HistoryEventDef RSI_TookVirgin;
public static readonly HistoryEventDef RSI_Masturbated;
}
}

View file

@ -0,0 +1,16 @@
using RimWorld;
namespace RJWSexperience.Ideology
{
[DefOf]
public static class RsiPreceptDefOf
{
public static readonly PreceptDef Incestuos_IncestOnly;
public static readonly PreceptDef Bestiality_OnlyVenerated;
public static readonly PreceptDef BabyFaction_AlwaysFather;
public static readonly PreceptDef BabyFaction_AlwaysColony;
public static readonly PreceptDef Submissive_Male;
public static readonly PreceptDef Submissive_Female;
public static readonly PreceptDef ProselyzingByOrgasm;
}
}

View file

@ -0,0 +1,22 @@
using RimWorld;
using Verse;
namespace RJWSexperience.Ideology
{
[DefOf]
public static class VariousDefOf
{
public static readonly JobDef RapeVictim;
public static readonly JobDef Gangbang;
public static readonly JobDef GettinGangbang;
public static readonly JobDef DrugSex;
public static readonly JobDef GettinDrugSex;
public static readonly JobDef DrugMasturbate;
public static readonly MemeDef Zoophile;
public static readonly MemeDef Rapist;
public static readonly MemeDef Necrophile;
public static readonly IssueDef Incestuos;
[MayRequireBiotech] public static readonly HediffDef PregnantHuman;
}
}