From 032b031123e3ee533d09643d38c7505543a144e7 Mon Sep 17 00:00:00 2001 From: amevarashi Date: Sun, 23 Apr 2023 16:41:27 +0500 Subject: [PATCH 1/2] Change VariousDefOf to RsiDefOf --- Source/IdeologyAddon/DebugAction.cs | 4 +- Source/IdeologyAddon/IdeoUtility.cs | 6 +- Source/IdeologyAddon/IdeologyAddon.csproj | 4 +- .../Patches/RJW_Patch_ChancePerHour.cs | 8 +-- .../IdeologyAddon/Patches/RJW_Patch_Ideo.cs | 18 ++--- .../IdeologyAddon/Patches/Rimworld_Patch.cs | 6 +- .../Patches/Sexperience_Patch.cs | 6 +- .../Rituals/JobGiver_DrugOrgy.cs | 6 +- .../Rituals/JobGiver_GangbangConsensual.cs | 6 +- .../Rituals/JobGiver_GangbangVictim.cs | 2 +- Source/IdeologyAddon/Rituals/RitualRoles.cs | 2 +- .../RomanceChanceFactorHelpers.cs | 6 +- Source/IdeologyAddon/RsiDefOf.cs | 65 +++++++++++++++++++ Source/IdeologyAddon/RsiHistoryEventDefOf.cs | 18 ----- Source/IdeologyAddon/RsiPreceptDefOf.cs | 16 ----- Source/IdeologyAddon/VariousDefOf.cs | 22 ------- 16 files changed, 101 insertions(+), 94 deletions(-) create mode 100644 Source/IdeologyAddon/RsiDefOf.cs delete mode 100644 Source/IdeologyAddon/RsiHistoryEventDefOf.cs delete mode 100644 Source/IdeologyAddon/RsiPreceptDefOf.cs delete mode 100644 Source/IdeologyAddon/VariousDefOf.cs diff --git a/Source/IdeologyAddon/DebugAction.cs b/Source/IdeologyAddon/DebugAction.cs index 91f5b20..f80e708 100644 --- a/Source/IdeologyAddon/DebugAction.cs +++ b/Source/IdeologyAddon/DebugAction.cs @@ -15,8 +15,8 @@ namespace RJWSexperience.Ideology Pawn hero = p.Map.PlayerPawnsForStoryteller.First(x => x.IsDesignatedHero()); if (hero == null) return; - RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(hero, p); - RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(p, hero); + RsiDefOf.HistoryEvent.RSI_NonIncestuosMarriage.RecordEventWithPartner(hero, p); + RsiDefOf.HistoryEvent.RSI_NonIncestuosMarriage.RecordEventWithPartner(p, hero); } [DebugAction("RJW Sexperience Ideology", "Manual romance check", false, true, actionType = DebugActionType.Action, allowedGameStates = AllowedGameStates.PlayingOnMap)] diff --git a/Source/IdeologyAddon/IdeoUtility.cs b/Source/IdeologyAddon/IdeoUtility.cs index 206b8eb..05ffd75 100644 --- a/Source/IdeologyAddon/IdeoUtility.cs +++ b/Source/IdeologyAddon/IdeoUtility.cs @@ -12,9 +12,9 @@ namespace RJWSexperience.Ideology if (ideo == null) return false; - if (ideo.HasPrecept(RsiPreceptDefOf.Submissive_Female) && pawn.gender == Gender.Female) + if (ideo.HasPrecept(RsiDefOf.Precept.Submissive_Female) && pawn.gender == Gender.Female) return true; - else if (ideo.HasPrecept(RsiPreceptDefOf.Submissive_Male) && pawn.gender == Gender.Male) + else if (ideo.HasPrecept(RsiDefOf.Precept.Submissive_Male) && pawn.gender == Gender.Male) return true; return false; @@ -89,7 +89,7 @@ namespace RJWSexperience.Ideology Hediff pregnancy = PregnancyHelper.GetPregnancy(pawn); // Currently RJW does not check Biotech pregnancy - if (pregnancy == null && VariousDefOf.PregnantHuman != null) + if (pregnancy == null && RsiDefOf.Hediff.PregnantHuman != null) { pregnancy = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnantHuman); } diff --git a/Source/IdeologyAddon/IdeologyAddon.csproj b/Source/IdeologyAddon/IdeologyAddon.csproj index 63f6689..9f06941 100644 --- a/Source/IdeologyAddon/IdeologyAddon.csproj +++ b/Source/IdeologyAddon/IdeologyAddon.csproj @@ -63,8 +63,6 @@ - - @@ -95,7 +93,7 @@ - + diff --git a/Source/IdeologyAddon/Patches/RJW_Patch_ChancePerHour.cs b/Source/IdeologyAddon/Patches/RJW_Patch_ChancePerHour.cs index 2a22c2c..18d8550 100644 --- a/Source/IdeologyAddon/Patches/RJW_Patch_ChancePerHour.cs +++ b/Source/IdeologyAddon/Patches/RJW_Patch_ChancePerHour.cs @@ -15,7 +15,7 @@ namespace RJWSexperience.Ideology.Patches if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc return; - if (!RsiHistoryEventDefOf.RSI_SexWithAnimal.CreateEvent(pawn).DoerWillingToDo()) + if (!RsiDefOf.HistoryEvent.RSI_SexWithAnimal.CreateEvent(pawn).DoerWillingToDo()) { __result = -2f; return; @@ -32,7 +32,7 @@ namespace RJWSexperience.Ideology.Patches if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc return; - if (!RsiHistoryEventDefOf.RSI_Raped.CreateEvent(pawn).DoerWillingToDo()) + if (!RsiDefOf.HistoryEvent.RSI_Raped.CreateEvent(pawn).DoerWillingToDo()) { __result = -2f; return; @@ -48,7 +48,7 @@ namespace RJWSexperience.Ideology.Patches if (__result < 0f || pawn.Ideo == null) // ideo is null if don't have dlc return; - if (!RsiHistoryEventDefOf.RSI_SexWithCorpse.CreateEvent(pawn).DoerWillingToDo()) + if (!RsiDefOf.HistoryEvent.RSI_SexWithCorpse.CreateEvent(pawn).DoerWillingToDo()) { __result = -2f; return; @@ -65,7 +65,7 @@ namespace RJWSexperience.Ideology.Patches if (__result < 0f || p.Ideo == null) // ideo is null if don't have dlc return; - if (!RsiHistoryEventDefOf.RSI_Masturbated.CreateEvent(p).DoerWillingToDo()) + if (!RsiDefOf.HistoryEvent.RSI_Masturbated.CreateEvent(p).DoerWillingToDo()) { __result = -2f; return; diff --git a/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs b/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs index e52b361..239ce81 100644 --- a/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs +++ b/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs @@ -19,7 +19,7 @@ namespace RJWSexperience.Ideology.Patches Ideo ideo = pawn.Ideo; if (ideo != null && !pawn.IsSubmissive()) { - __result = __result || ideo.HasMeme(VariousDefOf.Rapist); + __result = __result || ideo.HasMeme(RsiDefOf.Meme.Rapist); } } } @@ -32,7 +32,7 @@ namespace RJWSexperience.Ideology.Patches Ideo ideo = pawn.Ideo; if (ideo != null) { - __result = __result || ideo.HasMeme(VariousDefOf.Zoophile); + __result = __result || ideo.HasMeme(RsiDefOf.Meme.Zoophile); } } } @@ -45,7 +45,7 @@ namespace RJWSexperience.Ideology.Patches Ideo ideo = pawn.Ideo; if (ideo != null) { - __result = __result || ideo.HasMeme(VariousDefOf.Necrophile); + __result = __result || ideo.HasMeme(RsiDefOf.Meme.Necrophile); } } } @@ -85,10 +85,10 @@ namespace RJWSexperience.Ideology.Patches private static void AfterSexHuman(Pawn human, Pawn partner) { - RsiHistoryEventDefOf.RSI_NonIncestuosSex.RecordEventWithPartner(human, partner); + RsiDefOf.HistoryEvent.RSI_NonIncestuosSex.RecordEventWithPartner(human, partner); if (partner.IsAnimal()) - RsiHistoryEventDefOf.RSI_SexWithAnimal.RecordEventWithPartner(human, partner); + RsiDefOf.HistoryEvent.RSI_SexWithAnimal.RecordEventWithPartner(human, partner); } } @@ -148,7 +148,7 @@ namespace RJWSexperience.Ideology.Patches public static void Postfix(Pawn pawn, ref bool __result) { Ideo ideo = pawn.Ideo; - if (ideo?.HasMeme(VariousDefOf.Zoophile) == true) + if (ideo?.HasMeme(RsiDefOf.Meme.Zoophile) == true) { SaveStorage.DataStore.GetPawnData(pawn).CanDesignateBreeding = true; __result = true; @@ -213,14 +213,14 @@ namespace RJWSexperience.Ideology.Patches Ideo mainideo = playerfaction.ideos.PrimaryIdeo; if (mainideo != null) { - if (mainideo.HasPrecept(RsiPreceptDefOf.BabyFaction_AlwaysFather)) + if (mainideo.HasPrecept(RsiDefOf.Precept.BabyFaction_AlwaysFather)) { Pawn parent = baby.GetFather() ?? baby.GetMother(); ideo = parent.Ideo; return parent.Faction; } - else if (mainideo.HasPrecept(RsiPreceptDefOf.BabyFaction_AlwaysColony)) + else if (mainideo.HasPrecept(RsiDefOf.Precept.BabyFaction_AlwaysColony)) { ideo = mainideo; return playerfaction; @@ -241,7 +241,7 @@ namespace RJWSexperience.Ideology.Patches if (props.pawn?.Ideo == null || !props.hasPartner()) return; - if (props.partner.Ideo?.HasPrecept(RsiPreceptDefOf.ProselyzingByOrgasm) == true) + if (props.partner.Ideo?.HasPrecept(RsiDefOf.Precept.ProselyzingByOrgasm) == true) { // Pawn is the one having the orgasm // Partner is "giving" the orgasm, hence the pawn will be converted towards the partners ideology diff --git a/Source/IdeologyAddon/Patches/Rimworld_Patch.cs b/Source/IdeologyAddon/Patches/Rimworld_Patch.cs index 9a54dd4..5bd03b3 100644 --- a/Source/IdeologyAddon/Patches/Rimworld_Patch.cs +++ b/Source/IdeologyAddon/Patches/Rimworld_Patch.cs @@ -16,8 +16,8 @@ namespace RJWSexperience.Ideology.Patches { public static void Postfix(Pawn firstPawn, Pawn secondPawn) { - RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(firstPawn, secondPawn); - RsiHistoryEventDefOf.RSI_NonIncestuosMarriage.RecordEventWithPartner(secondPawn, firstPawn); + RsiDefOf.HistoryEvent.RSI_NonIncestuosMarriage.RecordEventWithPartner(firstPawn, secondPawn); + RsiDefOf.HistoryEvent.RSI_NonIncestuosMarriage.RecordEventWithPartner(secondPawn, firstPawn); } } @@ -81,7 +81,7 @@ namespace RJWSexperience.Ideology.Patches /// Forbid romance option public static bool RsiIncestuous(Pawn one, Pawn two) { - PreceptDef incestuousPrecept = one.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == VariousDefOf.Incestuos); + PreceptDef incestuousPrecept = one.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == RsiDefOf.Issue.Incestuos); var allowManualRomanceOnlyFor = incestuousPrecept?.GetModExtension()?.allowManualRomanceOnlyFor; BloodRelationDegree relationDegree = RelationHelpers.GetBloodRelationDegree(one, two); diff --git a/Source/IdeologyAddon/Patches/Sexperience_Patch.cs b/Source/IdeologyAddon/Patches/Sexperience_Patch.cs index 1be61cd..4f7471e 100644 --- a/Source/IdeologyAddon/Patches/Sexperience_Patch.cs +++ b/Source/IdeologyAddon/Patches/Sexperience_Patch.cs @@ -15,11 +15,11 @@ namespace RJWSexperience.Ideology.Patches const int femaleAfterSurgery = 1; if (props.isRape && exVirgin == props.partner) - RsiHistoryEventDefOf.RSI_VirginStolen.RecordEventWithPartner(exVirgin, partner); + RsiDefOf.HistoryEvent.RSI_VirginStolen.RecordEventWithPartner(exVirgin, partner); else if (degree != femaleAfterSurgery) - RsiHistoryEventDefOf.RSI_VirginTaken.RecordEventWithPartner(exVirgin, partner); + RsiDefOf.HistoryEvent.RSI_VirginTaken.RecordEventWithPartner(exVirgin, partner); - RsiHistoryEventDefOf.RSI_TookVirgin.RecordEventWithPartner(partner, exVirgin); + RsiDefOf.HistoryEvent.RSI_TookVirgin.RecordEventWithPartner(partner, exVirgin); } } } diff --git a/Source/IdeologyAddon/Rituals/JobGiver_DrugOrgy.cs b/Source/IdeologyAddon/Rituals/JobGiver_DrugOrgy.cs index a7eacb0..ce0251d 100644 --- a/Source/IdeologyAddon/Rituals/JobGiver_DrugOrgy.cs +++ b/Source/IdeologyAddon/Rituals/JobGiver_DrugOrgy.cs @@ -32,9 +32,9 @@ namespace RJWSexperience.Ideology Pawn target = FindPartner(pawn, duty); - if (target == null || !pawn.CanReserveAndReach(target, PathEndMode.ClosestTouch, Danger.None,1)) return JobMaker.MakeJob(VariousDefOf.DrugMasturbate); + if (target == null || !pawn.CanReserveAndReach(target, PathEndMode.ClosestTouch, Danger.None,1)) return JobMaker.MakeJob(RsiDefOf.Job.DrugMasturbate); - return JobMaker.MakeJob(VariousDefOf.DrugSex, target); + return JobMaker.MakeJob(RsiDefOf.Job.DrugSex, target); } protected Pawn FindPartner(Pawn pawn, PawnDuty duty) @@ -65,7 +65,7 @@ namespace RJWSexperience.Ideology protected override IEnumerable MakeNewToils() { setup_ticks(); - var PartnerJob = VariousDefOf.GettinDrugSex; + var PartnerJob = RsiDefOf.Job.GettinDrugSex; this.FailOnDespawnedNullOrForbidden(iTarget); this.FailOn(() => !Partner.health.capacities.CanBeAwake); diff --git a/Source/IdeologyAddon/Rituals/JobGiver_GangbangConsensual.cs b/Source/IdeologyAddon/Rituals/JobGiver_GangbangConsensual.cs index dc6dc15..48b4353 100644 --- a/Source/IdeologyAddon/Rituals/JobGiver_GangbangConsensual.cs +++ b/Source/IdeologyAddon/Rituals/JobGiver_GangbangConsensual.cs @@ -34,7 +34,7 @@ namespace RJWSexperience.Ideology if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) return null; - return JobMaker.MakeJob(VariousDefOf.Gangbang, target); + return JobMaker.MakeJob(RsiDefOf.Job.Gangbang, target); } } @@ -65,7 +65,7 @@ namespace RJWSexperience.Ideology var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped; if (dri == null) { - 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); } }; @@ -75,7 +75,7 @@ namespace RJWSexperience.Ideology SexToil.defaultCompleteMode = ToilCompleteMode.Never; SexToil.defaultDuration = duration; SexToil.handlingFacing = true; - SexToil.FailOn(() => Partner.CurJob.def != VariousDefOf.GettinGangbang); + SexToil.FailOn(() => Partner.CurJob.def != RsiDefOf.Job.GettinGangbang); SexToil.initAction = delegate { Start(); diff --git a/Source/IdeologyAddon/Rituals/JobGiver_GangbangVictim.cs b/Source/IdeologyAddon/Rituals/JobGiver_GangbangVictim.cs index ce2ec72..bc4bfdf 100644 --- a/Source/IdeologyAddon/Rituals/JobGiver_GangbangVictim.cs +++ b/Source/IdeologyAddon/Rituals/JobGiver_GangbangVictim.cs @@ -35,7 +35,7 @@ namespace RJWSexperience.Ideology if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) return null; - return JobMaker.MakeJob(VariousDefOf.RapeVictim, target); + return JobMaker.MakeJob(RsiDefOf.Job.RapeVictim, target); } } diff --git a/Source/IdeologyAddon/Rituals/RitualRoles.cs b/Source/IdeologyAddon/Rituals/RitualRoles.cs index 691bb28..699f2d1 100644 --- a/Source/IdeologyAddon/Rituals/RitualRoles.cs +++ b/Source/IdeologyAddon/Rituals/RitualRoles.cs @@ -92,7 +92,7 @@ namespace RJWSexperience.Ideology public static bool CanBeBreeder(Pawn animal, Precept_Ritual precept) { - if (precept != null && precept.ideo.HasPrecept(RsiPreceptDefOf.Bestiality_OnlyVenerated) && !precept.ideo.IsVeneratedAnimal(animal)) + if (precept != null && precept.ideo.HasPrecept(RsiDefOf.Precept.Bestiality_OnlyVenerated) && !precept.ideo.IsVeneratedAnimal(animal)) { return false; } diff --git a/Source/IdeologyAddon/RomanceChanceFactorHelpers.cs b/Source/IdeologyAddon/RomanceChanceFactorHelpers.cs index bae549e..6d970f3 100644 --- a/Source/IdeologyAddon/RomanceChanceFactorHelpers.cs +++ b/Source/IdeologyAddon/RomanceChanceFactorHelpers.cs @@ -22,7 +22,7 @@ namespace RJWSexperience.Ideology if (!pawn.relations.FamilyByBlood.Contains(partner)) { - if (pawn.Ideo?.HasPrecept(RsiPreceptDefOf.Incestuos_IncestOnly) == true) + if (pawn.Ideo?.HasPrecept(RsiDefOf.Precept.Incestuos_IncestOnly) == true) { return parentRomanceChanceFactor; } @@ -32,7 +32,7 @@ namespace RJWSexperience.Ideology } } - PreceptDef incestuousPrecept = pawn.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == VariousDefOf.Incestuos); + PreceptDef incestuousPrecept = pawn.Ideo?.PreceptsListForReading.Select(precept => precept.def).FirstOrFallback(def => def.issue == RsiDefOf.Issue.Incestuos); IEnumerable relations = pawn.GetRelations(partner).Where(def => def.familyByBloodRelation); foreach (PawnRelationDef relationDef in relations) { @@ -74,7 +74,7 @@ namespace RJWSexperience.Ideology { IEnumerable incestuousPrecepts = DefDatabase .AllDefsListForReading - .Where(def => def.issue == VariousDefOf.Incestuos); + .Where(def => def.issue == RsiDefOf.Issue.Incestuos); IEnumerable> preceptGetters = incestuousPrecepts .Select(precept => new TableDataGetter(precept.defName,(PawnRelationDef rel) => GetRomanceChanceFactor(rel, precept))); diff --git a/Source/IdeologyAddon/RsiDefOf.cs b/Source/IdeologyAddon/RsiDefOf.cs new file mode 100644 index 0000000..d5b0cfa --- /dev/null +++ b/Source/IdeologyAddon/RsiDefOf.cs @@ -0,0 +1,65 @@ +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; + } + } +} diff --git a/Source/IdeologyAddon/RsiHistoryEventDefOf.cs b/Source/IdeologyAddon/RsiHistoryEventDefOf.cs deleted file mode 100644 index 4cb9bc7..0000000 --- a/Source/IdeologyAddon/RsiHistoryEventDefOf.cs +++ /dev/null @@ -1,18 +0,0 @@ -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; - } -} diff --git a/Source/IdeologyAddon/RsiPreceptDefOf.cs b/Source/IdeologyAddon/RsiPreceptDefOf.cs deleted file mode 100644 index 1638e76..0000000 --- a/Source/IdeologyAddon/RsiPreceptDefOf.cs +++ /dev/null @@ -1,16 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/Source/IdeologyAddon/VariousDefOf.cs b/Source/IdeologyAddon/VariousDefOf.cs deleted file mode 100644 index 19a104d..0000000 --- a/Source/IdeologyAddon/VariousDefOf.cs +++ /dev/null @@ -1,22 +0,0 @@ -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; - } -} From 670584500b87e43fdcd6bcbf179bd9ecb547f315 Mon Sep 17 00:00:00 2001 From: amevarashi Date: Sun, 23 Apr 2023 17:15:07 +0500 Subject: [PATCH 2/2] Fix IDE messages --- Source/IdeologyAddon/DebugAction.cs | 4 +- .../IdeologyAddon/Patches/RJW_Patch_Ideo.cs | 6 +- .../Rituals/JobGiver_DrugOrgy.cs | 156 ++++++++-------- .../Rituals/JobGiver_GangbangConsensual.cs | 113 ++++++------ .../Rituals/JobGiver_GangbangVictim.cs | 83 ++++----- .../IdeologyAddon/Rituals/LordJob_Rituals.cs | 17 +- Source/IdeologyAddon/Rituals/RitualRoles.cs | 171 +++++++++--------- 7 files changed, 262 insertions(+), 288 deletions(-) diff --git a/Source/IdeologyAddon/DebugAction.cs b/Source/IdeologyAddon/DebugAction.cs index f80e708..55838d7 100644 --- a/Source/IdeologyAddon/DebugAction.cs +++ b/Source/IdeologyAddon/DebugAction.cs @@ -7,10 +7,10 @@ using Verse; namespace RJWSexperience.Ideology { - internal class DebugAction + internal static class DebugAction { [DebugAction("RJW Sexperience Ideology", "Test marriage event", false, false, actionType = DebugActionType.ToolMapForPawns, allowedGameStates = AllowedGameStates.PlayingOnMap)] - private static void GenerateMarriageEvent(Pawn p) + public static void GenerateMarriageEvent(Pawn p) { Pawn hero = p.Map.PlayerPawnsForStoryteller.First(x => x.IsDesignatedHero()); if (hero == null) diff --git a/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs b/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs index 239ce81..4a06922 100644 --- a/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs +++ b/Source/IdeologyAddon/Patches/RJW_Patch_Ideo.cs @@ -113,11 +113,13 @@ namespace RJWSexperience.Ideology.Patches public static float PreceptSextype(Pawn pawn, Pawn partner, float score, List historyEventDefs) { - foreach(HistoryEventDef eventDef in historyEventDefs) + for (int i = 0; i < historyEventDefs.Count; i++) { + HistoryEventDef eventDef = historyEventDefs[i]; + 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))); + float mult = 8.0f * Math.Max(0.3f, 1 / Math.Max(0.01f, pawn.GetStatValue(xxx.sex_drive_stat, cacheStaleAfterTicks: 60))); return score * mult; } } diff --git a/Source/IdeologyAddon/Rituals/JobGiver_DrugOrgy.cs b/Source/IdeologyAddon/Rituals/JobGiver_DrugOrgy.cs index ce0251d..82a541e 100644 --- a/Source/IdeologyAddon/Rituals/JobGiver_DrugOrgy.cs +++ b/Source/IdeologyAddon/Rituals/JobGiver_DrugOrgy.cs @@ -1,56 +1,47 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using RimWorld; using rjw; +using System; +using System.Collections.Generic; using Verse; using Verse.AI; -using RimWorld; - namespace RJWSexperience.Ideology { - public class JobGiver_DrugOrgy : ThinkNode_JobGiver - { - protected override Job TryGiveJob(Pawn pawn) - { - if (pawn.Drafted) return null; - DutyDef dutyDef = null; - PawnDuty duty = null; - if (pawn.mindState != null) - { - duty = pawn.mindState.duty; - dutyDef = duty.def; - } - else return null; + public class JobGiver_DrugOrgy : ThinkNode_JobGiver + { + protected override Job TryGiveJob(Pawn pawn) + { + if (pawn.Drafted || pawn.mindState == null) + { + return null; + } - if (dutyDef == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn)) - { - return null; - } - - Pawn target = FindPartner(pawn, duty); + PawnDuty duty = pawn.mindState.duty; - if (target == null || !pawn.CanReserveAndReach(target, PathEndMode.ClosestTouch, Danger.None,1)) return JobMaker.MakeJob(RsiDefOf.Job.DrugMasturbate); + if (duty.def == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn)) + { + return null; + } - return JobMaker.MakeJob(RsiDefOf.Job.DrugSex, target); - } + Pawn target = FindPartner(pawn, duty); - protected Pawn FindPartner(Pawn pawn, PawnDuty duty) - { - if (duty != null) - { - List pawns = pawn.Map.mapPawns.AllPawnsSpawned.FindAll(x => x.mindState?.duty?.def == duty.def); - return pawns.RandomElementByWeightWithDefault(x => SexAppraiser.would_fuck(pawn,x), 0.1f); - } - - + if (target == null || !pawn.CanReserveAndReach(target, PathEndMode.ClosestTouch, Danger.None, 1)) + return JobMaker.MakeJob(RsiDefOf.Job.DrugMasturbate); - return null; - } + return JobMaker.MakeJob(RsiDefOf.Job.DrugSex, target); + } - } + protected Pawn FindPartner(Pawn pawn, PawnDuty duty) + { + if (duty != null) + { + List 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 null; + } + } /// /// copied from rjw @@ -73,47 +64,52 @@ namespace RJWSexperience.Ideology this.FailOn(() => Partner == null); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); - Toil WaitForPartner = new Toil(); - WaitForPartner.defaultCompleteMode = ToilCompleteMode.Delay; - WaitForPartner.initAction = delegate + Toil WaitForPartner = new Toil { - ticksLeftThisToil = 5000; - }; - WaitForPartner.tickAction = delegate - { - pawn.GainComfortFromCellIfPossible(); - if (pawn.Position.DistanceTo(Partner.Position) <= 1f) + defaultCompleteMode = ToilCompleteMode.Delay, + initAction = delegate { - ReadyForNextToil(); + ticksLeftThisToil = 5000; + }, + tickAction = delegate + { + pawn.GainComfortFromCellIfPossible(); + if (pawn.Position.DistanceTo(Partner.Position) <= 1f) + { + ReadyForNextToil(); + } } }; yield return WaitForPartner; - Toil StartPartnerJob = new Toil(); - StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; - StartPartnerJob.socialMode = RandomSocialMode.Off; - StartPartnerJob.initAction = delegate + Toil StartPartnerJob = new Toil { - var dri = Partner.jobs.curDriver as JobDriver_DrugSexReceiver; - if (dri == null) - { - Job gettingQuickie = JobMaker.MakeJob(PartnerJob, pawn, Partner); - Partner.jobs.StartJob(gettingQuickie, JobCondition.InterruptForced); + defaultCompleteMode = ToilCompleteMode.Instant, + socialMode = RandomSocialMode.Off, + initAction = delegate + { + if (!(Partner.jobs.curDriver is JobDriver_DrugSexReceiver)) + { + Job gettingQuickie = JobMaker.MakeJob(PartnerJob, pawn, Partner); + Partner.jobs.StartJob(gettingQuickie, JobCondition.InterruptForced); + } } }; yield return StartPartnerJob; - Toil SexToil = new Toil(); - SexToil.defaultCompleteMode = ToilCompleteMode.Never; - SexToil.socialMode = RandomSocialMode.Off; - SexToil.defaultDuration = duration; - SexToil.handlingFacing = true; + Toil SexToil = new Toil + { + defaultCompleteMode = ToilCompleteMode.Never, + socialMode = RandomSocialMode.Off, + defaultDuration = duration, + handlingFacing = true + }; SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.initAction = delegate { Partner.pather.StopDead(); Partner.jobs.curDriver.asleep = false; - + Start(); Sexprops.usedCondom = CondomUtility.TryUseCondom(pawn) || CondomUtility.TryUseCondom(Partner); }; @@ -147,8 +143,7 @@ namespace RJWSexperience.Ideology /// copied from rjw /// public class JobDriver_DrugSexReceiver : JobDriver_SexBaseRecieverLoved - { - + { protected override IEnumerable MakeNewToils() { setup_ticks(); @@ -168,23 +163,25 @@ namespace RJWSexperience.Ideology yield return Toils_Reserve.Reserve(iTarget, 1, 0); - var get_loved = MakeSexToil(); - get_loved.handlingFacing = false; - yield return get_loved; + var get_loved = MakeSexToil(); + get_loved.handlingFacing = false; + yield return get_loved; } protected Toil MakeSexToil() { - Toil get_loved = new Toil(); - get_loved.defaultCompleteMode = ToilCompleteMode.Never; - get_loved.socialMode = RandomSocialMode.Off; - get_loved.handlingFacing = true; - get_loved.tickAction = delegate + Toil get_loved = new Toil { + defaultCompleteMode = ToilCompleteMode.Never, + socialMode = RandomSocialMode.Off, + handlingFacing = true, + tickAction = delegate + { + } }; get_loved.AddEndCondition(new Func(() => { - if (parteners.Count <= 0) + if (parteners.Count == 0) { return JobCondition.Succeeded; } @@ -204,8 +201,7 @@ namespace RJWSexperience.Ideology /// copied from rjw /// public class JobDriver_DrugMasturabate : JobDriver_Masturbate - { - + { protected override IEnumerable MakeNewToils() { setup_ticks(); @@ -252,6 +248,4 @@ namespace RJWSexperience.Ideology }; } } - - } diff --git a/Source/IdeologyAddon/Rituals/JobGiver_GangbangConsensual.cs b/Source/IdeologyAddon/Rituals/JobGiver_GangbangConsensual.cs index 48b4353..eae27e5 100644 --- a/Source/IdeologyAddon/Rituals/JobGiver_GangbangConsensual.cs +++ b/Source/IdeologyAddon/Rituals/JobGiver_GangbangConsensual.cs @@ -1,43 +1,36 @@ -using System; +using RimWorld; +using rjw; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Verse; using Verse.AI; -using Verse.AI.Group; -using RimWorld; -using rjw; namespace RJWSexperience.Ideology { - public class JobGiver_GangbangConsensual : ThinkNode_JobGiver - { - protected override Job TryGiveJob(Pawn pawn) - { - if (pawn.Drafted) return null; - DutyDef dutyDef = null; - PawnDuty duty = null; - if (pawn.mindState != null) - { - duty = pawn.mindState.duty; - dutyDef = duty.def; - } - else return null; + public class JobGiver_GangbangConsensual : ThinkNode_JobGiver + { + protected override Job TryGiveJob(Pawn pawn) + { + if (pawn.Drafted || pawn.mindState == null) + { + return null; + } - if (dutyDef == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn)) - { - return null; - } + PawnDuty duty = pawn.mindState.duty; - Pawn target = duty.focusSecond.Pawn; + if (duty.def == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn)) + { + return null; + } - if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) return null; + Pawn target = duty.focusSecond.Pawn; - return JobMaker.MakeJob(RsiDefOf.Job.Gangbang, target); - } - } + if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) + return null; + return JobMaker.MakeJob(RsiDefOf.Job.Gangbang, target); + } + } public class JobDriver_Gangbang : JobDriver_SexBaseInitiator { @@ -56,25 +49,27 @@ namespace RJWSexperience.Ideology this.FailOn(() => Partner.Drafted); yield return Toils_Goto.GotoThing(iTarget, PathEndMode.OnCell); - Toil StartPartnerJob = new Toil(); - StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; - StartPartnerJob.socialMode = RandomSocialMode.Off; - StartPartnerJob.initAction = delegate + Toil StartPartnerJob = new Toil { - - var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped; - if (dri == null) - { - Job gettin_loved = JobMaker.MakeJob(RsiDefOf.Job.GettinGangbang, pawn, Bed); - Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced); + defaultCompleteMode = ToilCompleteMode.Instant, + socialMode = RandomSocialMode.Off, + initAction = delegate + { + if (!(Partner.jobs.curDriver is JobDriver_SexBaseRecieverRaped)) + { + Job gettin_loved = JobMaker.MakeJob(RsiDefOf.Job.GettinGangbang, pawn, Bed); + Partner.jobs.StartJob(gettin_loved, JobCondition.InterruptForced); + } } }; yield return StartPartnerJob; - Toil SexToil = new Toil(); - SexToil.defaultCompleteMode = ToilCompleteMode.Never; - SexToil.defaultDuration = duration; - SexToil.handlingFacing = true; + Toil SexToil = new Toil + { + defaultCompleteMode = ToilCompleteMode.Never, + defaultDuration = duration, + handlingFacing = true + }; SexToil.FailOn(() => Partner.CurJob.def != RsiDefOf.Job.GettinGangbang); SexToil.initAction = delegate { @@ -108,28 +103,30 @@ namespace RJWSexperience.Ideology } public class JobDriver_GangbangReceiver : JobDriver_SexBaseRecieverLoved - { + { protected override IEnumerable MakeNewToils() { setup_ticks(); parteners.Add(Partner);// add job starter, so this wont fail, before Initiator starts his job - Toil get_banged = new Toil(); - get_banged.defaultCompleteMode = ToilCompleteMode.Never; - get_banged.handlingFacing = true; - get_banged.initAction = delegate + Toil get_banged = new Toil { - pawn.pather.StopDead(); - pawn.jobs.curDriver.asleep = false; - }; - get_banged.tickAction = delegate - { - if ((parteners.Count > 0) && pawn.IsHashIntervalTick(ticks_between_hearts / parteners.Count) && pawn.IsHashIntervalTick(ticks_between_hearts)) - ThrowMetaIconF(pawn.Position, pawn.Map, FleckDefOf.Heart); + defaultCompleteMode = ToilCompleteMode.Never, + handlingFacing = true, + initAction = delegate + { + pawn.pather.StopDead(); + pawn.jobs.curDriver.asleep = false; + }, + tickAction = delegate + { + if ((parteners.Count > 0) && pawn.IsHashIntervalTick(ticks_between_hearts / parteners.Count) && pawn.IsHashIntervalTick(ticks_between_hearts)) + ThrowMetaIconF(pawn.Position, pawn.Map, FleckDefOf.Heart); + } }; get_banged.AddEndCondition(new Func(() => { - if (parteners.Count <= 0) + if (parteners.Count == 0) { return JobCondition.Succeeded; } @@ -148,12 +145,12 @@ namespace RJWSexperience.Ideology Partner.jobs.jobQueue.EnqueueFirst(tobed); } else if (pawn.HostileTo(Partner)) + { pawn.health.AddHediff(xxx.submitting); + } }); get_banged.socialMode = RandomSocialMode.Off; yield return get_banged; - } } - } diff --git a/Source/IdeologyAddon/Rituals/JobGiver_GangbangVictim.cs b/Source/IdeologyAddon/Rituals/JobGiver_GangbangVictim.cs index bc4bfdf..092b00b 100644 --- a/Source/IdeologyAddon/Rituals/JobGiver_GangbangVictim.cs +++ b/Source/IdeologyAddon/Rituals/JobGiver_GangbangVictim.cs @@ -1,56 +1,46 @@ -using System; +using RimWorld; +using rjw; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Verse; using Verse.AI; -using Verse.AI.Group; -using RimWorld; -using rjw; - namespace RJWSexperience.Ideology { - public class JobGiver_GangbangVictim : ThinkNode_JobGiver - { - protected override Job TryGiveJob(Pawn pawn) - { - if (pawn.Drafted) return null; - DutyDef dutyDef = null; - PawnDuty duty = null; - if (pawn.mindState != null) - { - duty = pawn.mindState.duty; - dutyDef = duty.def; - } - else return null; + public class JobGiver_GangbangVictim : ThinkNode_JobGiver + { + protected override Job TryGiveJob(Pawn pawn) + { + if (pawn.Drafted || pawn.mindState == null) + { + return null; + } - if (dutyDef == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn)) - { - return null; + PawnDuty duty = pawn.mindState.duty; + + if (duty.def == DutyDefOf.TravelOrLeave || !xxx.can_do_loving(pawn)) + { + return null; } Pawn target = duty.focusSecond.Pawn; - if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) return null; - - return JobMaker.MakeJob(RsiDefOf.Job.RapeVictim, target); - } - } + if (!pawn.CanReach(target, PathEndMode.ClosestTouch, Danger.None)) return null; + return JobMaker.MakeJob(RsiDefOf.Job.RapeVictim, target); + } + } /// /// copied from rjw /// public class JobDriver_RapeVictim : JobDriver_Rape { - public override bool TryMakePreToilReservations(bool errorOnFailed) - { + public override bool TryMakePreToilReservations(bool errorOnFailed) + { return true; - } + } - protected override IEnumerable MakeNewToils() + protected override IEnumerable MakeNewToils() { if (RJWSettings.DebugRape) ModLog.Message("" + this.GetType().ToString() + "::MakeNewToils() called"); setup_ticks(); @@ -64,25 +54,28 @@ namespace RJWSexperience.Ideology SexUtility.RapeTargetAlert(pawn, Partner); - Toil StartPartnerJob = new Toil(); - StartPartnerJob.defaultCompleteMode = ToilCompleteMode.Instant; - StartPartnerJob.socialMode = RandomSocialMode.Off; - StartPartnerJob.initAction = delegate + Toil StartPartnerJob = new Toil { - var dri = Partner.jobs.curDriver as JobDriver_SexBaseRecieverRaped; - if (dri == null) + defaultCompleteMode = ToilCompleteMode.Instant, + socialMode = RandomSocialMode.Off, + initAction = delegate { - Job gettin_raped = JobMaker.MakeJob(PartnerJob, pawn); + if (!(Partner.jobs.curDriver is JobDriver_SexBaseRecieverRaped)) + { + 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; - Toil SexToil = new Toil(); - SexToil.defaultCompleteMode = ToilCompleteMode.Never; - SexToil.defaultDuration = duration; - SexToil.handlingFacing = true; + Toil SexToil = new Toil + { + defaultCompleteMode = ToilCompleteMode.Never, + defaultDuration = duration, + handlingFacing = true + }; SexToil.FailOn(() => Partner.CurJob.def != PartnerJob); SexToil.initAction = delegate { diff --git a/Source/IdeologyAddon/Rituals/LordJob_Rituals.cs b/Source/IdeologyAddon/Rituals/LordJob_Rituals.cs index e976d61..b496689 100644 --- a/Source/IdeologyAddon/Rituals/LordJob_Rituals.cs +++ b/Source/IdeologyAddon/Rituals/LordJob_Rituals.cs @@ -1,21 +1,15 @@ -using System; +using RimWorld; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Verse; -using Verse.AI; -using RimWorld; - namespace RJWSexperience.Ideology { - public class LordJob_Ritual_Gangbang : LordJob_Ritual - { + public class LordJob_Ritual_Gangbang : LordJob_Ritual + { public LordJob_Ritual_Gangbang() { } - public LordJob_Ritual_Gangbang(string targetID ,TargetInfo selectedTarget, Precept_Ritual ritual, RitualObligation obligation, List 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 allStages, RitualRoleAssignments assignments, Pawn organizer = null) : base(selectedTarget, ritual, obligation, allStages, assignments, organizer) + { foreach (RitualRole ritualRole in assignments.AllRolesForReading) { if (ritualRole != null && ritualRole.id.Contains(targetID)) @@ -25,6 +19,5 @@ namespace RJWSexperience.Ideology } } } - } } diff --git a/Source/IdeologyAddon/Rituals/RitualRoles.cs b/Source/IdeologyAddon/Rituals/RitualRoles.cs index 699f2d1..e7fb7fc 100644 --- a/Source/IdeologyAddon/Rituals/RitualRoles.cs +++ b/Source/IdeologyAddon/Rituals/RitualRoles.cs @@ -1,106 +1,101 @@ using RimWorld; -using Verse; using rjw; +using Verse; namespace RJWSexperience.Ideology { - public class RitualRole_RapeVictim : RitualRole - { - public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false) - { - reason = null; - return 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; - if (CanBeVictim(p)) return true; - if (!skipReason) - { - reason = Keyed.RSVictimCondition; - } - return false; - } + public class RitualRole_RapeVictim : RitualRole + { + public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false) + { + reason = null; + return false; + } - public static bool CanBeVictim(Pawn pawn) - { - if (pawn.IsPrisonerOfColony || pawn.IsSlaveOfColony) return true; - if (pawn.IsSubmissive()) return true; - if (pawn.IsDesignatedComfort() || (pawn.guilt != null && pawn.guilt.IsGuilty) || (pawn.apparel != null && pawn.apparel.PsychologicallyNude)) return true; - return 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; + if (CanBeVictim(p)) return true; + if (!skipReason) + { + reason = Keyed.RSVictimCondition; + } + return false; + } - public class RitualRole_HumanBreedee : RitualRole - { - public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false) - { - reason = null; - return false; - } + public static bool CanBeVictim(Pawn pawn) + { + if (pawn.IsPrisonerOfColony || pawn.IsSlaveOfColony) return true; + if (pawn.IsSubmissive()) return true; + if (pawn.IsDesignatedComfort() || (pawn.guilt != null && pawn.guilt.IsGuilty) || (pawn.apparel != null && pawn.apparel.PsychologicallyNude)) return true; + return 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; - if (!xxx.is_human(p)) - { - reason = Keyed.RSNotHuman; - return false; - } - if (CanBeBreedee(p)) return true; - if (!skipReason) - { - reason = Keyed.RSShouldCanFuck; - } - return false; - } + public class RitualRole_HumanBreedee : RitualRole + { + public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false) + { + reason = null; + return false; + } - public static bool CanBeBreedee(Pawn pawn) - { - if (xxx.can_be_fucked(pawn)) return true; - return 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; + if (!xxx.is_human(p)) + { + reason = Keyed.RSNotHuman; + return false; + } + if (CanBeBreedee(p)) return true; + if (!skipReason) + { + reason = Keyed.RSShouldCanFuck; + } + return false; + } - public class RitualRole_AnimalBreeder : RitualRole - { - public override bool Animal => true; + public static bool CanBeBreedee(Pawn pawn) => xxx.can_be_fucked(pawn); + } - public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false) - { - reason = null; - return false; - } + public class RitualRole_AnimalBreeder : RitualRole + { + public override bool Animal => true; - 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; - if (!p.IsAnimal()) - { - reason = Keyed.RSNotAnimal; - return false; - } - if (CanBeBreeder(p, assignments?.Ritual)) return true; - if (!skipReason) - { - reason = Keyed.RSBreederCondition; - } - return false; - } + public override bool AppliesToRole(Precept_Role role, out string reason, Precept_Ritual ritual = null, Pawn pawn = null, bool skipReason = false) + { + reason = null; + return false; + } - public static bool CanBeBreeder(Pawn animal, Precept_Ritual precept) - { + 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; + if (!p.IsAnimal()) + { + reason = Keyed.RSNotAnimal; + return false; + } + if (CanBeBreeder(p, assignments?.Ritual)) return true; + if (!skipReason) + { + reason = Keyed.RSBreederCondition; + } + return false; + } + + public static bool CanBeBreeder(Pawn animal, Precept_Ritual precept) + { if (precept != null && precept.ideo.HasPrecept(RsiDefOf.Precept.Bestiality_OnlyVenerated) && !precept.ideo.IsVeneratedAnimal(animal)) { return false; } - if (!xxx.can_rape(animal)) return false; - return true; - } - - } - - + if (!xxx.can_rape(animal)) + { + return false; + } + return true; + } + } }