Change VariousDefOf to RsiDefOf

This commit is contained in:
amevarashi 2023-04-23 16:41:27 +05:00
parent f7206347da
commit 032b031123
16 changed files with 101 additions and 94 deletions

View File

@ -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)]

View File

@ -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);
}

View File

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

View File

@ -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

View File

@ -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
/// <returns>Forbid romance option</returns>
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<DefExtension_Incest>()?.allowManualRomanceOnlyFor;
BloodRelationDegree relationDegree = RelationHelpers.GetBloodRelationDegree(one, two);

View File

@ -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);
}
}
}

View File

@ -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<Toil> MakeNewToils()
{
setup_ticks();
var PartnerJob = VariousDefOf.GettinDrugSex;
var PartnerJob = RsiDefOf.Job.GettinDrugSex;
this.FailOnDespawnedNullOrForbidden(iTarget);
this.FailOn(() => !Partner.health.capacities.CanBeAwake);

View File

@ -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();

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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<PawnRelationDef> relations = pawn.GetRelations(partner).Where(def => def.familyByBloodRelation);
foreach (PawnRelationDef relationDef in relations)
{
@ -74,7 +74,7 @@ namespace RJWSexperience.Ideology
{
IEnumerable<PreceptDef> incestuousPrecepts = DefDatabase<PreceptDef>
.AllDefsListForReading
.Where(def => def.issue == VariousDefOf.Incestuos);
.Where(def => def.issue == RsiDefOf.Issue.Incestuos);
IEnumerable<TableDataGetter<PawnRelationDef>> preceptGetters = incestuousPrecepts
.Select(precept => new TableDataGetter<PawnRelationDef>(precept.defName,(PawnRelationDef rel) => GetRomanceChanceFactor(rel, precept)));

View File

@ -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;
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}