Merge 1.0.6.6

This commit is contained in:
lutepickle 2022-07-06 06:44:12 -07:00
commit 25aa9df0cf
18 changed files with 74 additions and 56 deletions

Binary file not shown.

View File

@ -31,10 +31,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
@ -96,5 +92,11 @@
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lib.Harmony">
<Version>2.1.1</Version>
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Lib.Harmony" version="2.1.1" targetFramework="net472" />
</packages>
<packages />

View File

@ -969,20 +969,20 @@ namespace RJW_Menstruation
{
if (Configurations.EnableAnimalCycle)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
}
}
else
{
if (pregnancy == null && parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Young), tickInterval, parent.pawn, false);
else HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
if (pregnancy == null && parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Young), GetNextUpdate(), parent.pawn, false);
else HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
}
}
else
{
if (cums == null) cums = new List<Cum>();
curStage = Stage.None;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), tickInterval, parent.pawn, false);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
}
//Log.Message(parent.pawn.Label + " - Initialized menstruation comp");
loaded = true;
@ -1159,6 +1159,11 @@ namespace RJW_Menstruation
foreach (Egg egg in eggs)
{
if (!egg.fertilized || egg.fertstage < 168) continue;
else if (egg.fertilizer is null)
{
deadeggs.Add(egg);
continue;
}
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
{
Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy();
@ -1520,7 +1525,7 @@ namespace RJW_Menstruation
{
StayCurrentStageConst(Stage.Young);
}
else GoNextStage(Stage.Follicular);
else GoNextStage(IsBreedingSeason() ? Stage.Follicular : Stage.Anestrus);
}
protected virtual void ClimactericFollicularAction()
@ -1738,7 +1743,7 @@ namespace RJW_Menstruation
curStage = Stage.Follicular;
curStageHrs = 0;
if (follicularIntervalhours < 0) follicularIntervalhours = PeriodRandomizer(Props.folicularIntervalDays * 24, Props.deviationFactor);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), tickInterval, parent.pawn, false);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Follicular), GetNextUpdate(), parent.pawn, false);
break;
}
action += delegate
@ -1757,31 +1762,41 @@ namespace RJW_Menstruation
}
protected void GoNextStage(Stage nextstage, float factor = 1.0f)
protected int GetNextUpdate()
{
// Ticks past the hour. Will be equal except for game start or load
int currentOffset = Find.TickManager.TicksGame % tickInterval;
int nextOffset = (parent.pawn.HashOffset() % tickInterval + tickInterval) % tickInterval; // Messy, but HashOffset is negative a lot
// The -1/+1 to ensure that equality works out to 1 hour and not 0 ticks
return ((nextOffset - currentOffset + tickInterval - 1) % tickInterval) + 1;
}
protected void GoNextStage(Stage nextstage)
{
curStageHrs = 0;
curStage = nextstage;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), GetNextUpdate(), parent.pawn, false);
}
protected void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f)
protected void GoNextStageSetHour(Stage nextstage, int hour)
{
curStageHrs = hour;
curStage = nextstage;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), GetNextUpdate(), parent.pawn, false);
}
//stage can be interrupted in other reasons
protected void StayCurrentStage(float factor = 1.0f)
protected void StayCurrentStage()
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), (int)(tickInterval * factor), parent.pawn, false);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
}
//stage never changes
protected void StayCurrentStageConst(Stage curstage, float factor = 1.0f)
protected void StayCurrentStageConst(Stage curstage)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false);
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), GetNextUpdate(), parent.pawn, false);
}
protected void GoFollicularOrBleeding()

View File

@ -157,8 +157,8 @@ namespace RJW_Menstruation
}
public static Texture2D GetEggIcon(this HediffComp_Menstruation comp, bool includeOvary)
{
if (comp.parent.pawn.IsPregnant(Configurations.InfoDetail != Configurations.DetailLevel.All))
{
if (comp.parent.pawn.IsPregnant(Configurations.InfoDetail != Configurations.DetailLevel.All) && !(PregnancyHelper.GetPregnancy(comp.parent.pawn) is Hediff_MechanoidPregnancy))
{
if (comp.parent.pawn.GetPregnancyProgress() < 0.2f) return ContentFinder<Texture2D>.Get("Eggs/Egg_Implanted00", true);
else return ContentFinder<Texture2D>.Get("Womb/Empty", true);
}
@ -181,8 +181,8 @@ namespace RJW_Menstruation
int fertstage = comp.IsFertilized;
if (fertstage >= 0)
{
if (fertstage <= comp.CycleFactor) return ContentFinder<Texture2D>.Get("Eggs/Egg_Fertilizing02", true);
if (fertstage <= 18) return ContentFinder<Texture2D>.Get("Eggs/Egg_Fertilized00", true);
if (fertstage <= Configurations.CycleAcceleration) return ContentFinder<Texture2D>.Get("Eggs/Egg_Fertilizing02", true);
else if (fertstage <= 18) return ContentFinder<Texture2D>.Get("Eggs/Egg_Fertilized00", true);
else if (fertstage <= 54) return ContentFinder<Texture2D>.Get("Eggs/Egg_Fertilized01", true);
else return ContentFinder<Texture2D>.Get("Eggs/Egg_Fertilized02", true);
}

View File

@ -423,7 +423,7 @@ namespace RJW_Menstruation
Pawn baby = PawnGenerator.GeneratePawn(request);
if (baby != null)
{
if (xxx.is_human(baby))
if (xxx.is_human(baby) || (baby.relations != null && !RJWSettings.Disable_bestiality_pregnancy_relations))
{
baby.SetMother(mother);
if (mother != father)
@ -434,23 +434,15 @@ namespace RJW_Menstruation
baby.relations.AddDirectRelation(PawnRelationDefOf.Parent, father);
}
}
}
if (xxx.is_human(baby))
{
// Ensure the same inherited traits are chosen each run
// Has to happen right here so GeneratePawn up there still gets unique results
Rand.PushState(traitSeed); // With a seed just to make sure that fraternal twins *don't* get trait-duped
UpdateTraits(baby, parentTraits);
Rand.PopState();
}
else if (baby.relations != null && !RJWSettings.Disable_bestiality_pregnancy_relations)
{
baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, mother);
mother.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby);
if (mother != father)
{
baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, father);
father.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby);
}
}
}
else Log.Error("Baby not generated. Request: " + request.ToString());
return baby;

View File

@ -21,7 +21,7 @@ namespace RJW_Menstruation.Patch
}
[HarmonyPatch(typeof(WorldPawnGC), "AccumulatePawnGCData")]
public static class PawnGCPass_Patch
public static class AccumulatePawnGCData_Patch
{
public static void Prefix()
{

View File

@ -89,7 +89,7 @@ namespace RJW_Menstruation
public const float buttonWidth = 50f;
public const float buttonHeight = 20f;
private static HediffComp_Menstruation GetFirstMenstruation(IEnumerable<Hediff> diffs, float rectWidth)
private static HediffComp_Menstruation GetFirstMenstruation(IEnumerable<Hediff> diffs)
{
foreach (Hediff diff in diffs)
{
@ -103,7 +103,7 @@ namespace RJW_Menstruation
{
if (Configurations.EnableButtonInHT && pawn.ShowStatus())
{
HediffComp_Menstruation comp = GetFirstMenstruation(diffs, rect.width * 0.625f);
HediffComp_Menstruation comp = GetFirstMenstruation(diffs);
if (comp != null)
{
Rect buttonrect = new Rect((rect.xMax) / 2 - 5f, curY + 2f, buttonWidth, buttonHeight);

View File

@ -39,7 +39,7 @@ namespace RJW_Menstruation
}
else if (Genital_Helper.has_ovipositorM(pawn, pawnparts))
{
comp.CumIn(pawn, Rand.Range(0.5f, 3.0f) * pawn.BodySize, 1.0f);
comp.CumIn(pawn, Rand.Range(0.75f, 4.5f) * pawn.BodySize, 1.0f);
}
else comp.CumIn(pawn, pawn.GetCumVolume(pawnparts), 0);

View File

@ -89,10 +89,6 @@
<Compile Include="VariousDefOf.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
@ -159,5 +155,11 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lib.Harmony">
<Version>2.1.1</Version>
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -102,7 +102,7 @@ namespace RJW_Menstruation
{
get
{
return thingDefName?.Length < 1;
return (thingDefName?.Length ?? 0) < 1;
}
}
public ThingDef GetDef
@ -131,7 +131,7 @@ namespace RJW_Menstruation
if (hybridExtension.NullOrEmpty()) return null;
else
{
return hybridExtension.Find(x => x.GetDef.defName?.Equals(race) ?? false);
return hybridExtension.Find(x => x.GetDef?.defName?.Equals(race) ?? false);
}
}
@ -165,7 +165,7 @@ namespace RJW_Menstruation
{
get
{
return thingDefName?.Length < 1;
return (thingDefName?.Length ?? 0) < 1;
}
}
public ThingDef GetDef

View File

@ -22,6 +22,7 @@ namespace RJW_Menstruation
public static readonly HediffDef Hediff_Estrus_Concealed = DefDatabase<HediffDef>.GetNamed("Hediff_Estrus_Concealed");
public static readonly HediffDef Hediff_ASA = DefDatabase<HediffDef>.GetNamed("Hediff_ASA");
public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable");
// Obsolete, kept for compatibility for now
public static readonly PawnRelationDef Relation_birthgiver = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Sire");
public static readonly PawnRelationDef Relation_spawn = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Pup");
public static readonly NeedDef SexNeed = DefDatabase<NeedDef>.GetNamed("Sex");

View File

@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Lib.Harmony" version="2.1.1" targetFramework="net472" />
</packages>
<packages />

View File

@ -31,10 +31,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\1127530465\1.3\Assemblies\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
@ -111,5 +107,11 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VariousDefOf.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lib.Harmony">
<Version>2.2.1</Version>
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>RJW Menstruation</identifier>
<version>1.0.6.5</version>
<version>1.0.6.6</version>
<dependencies>
</dependencies>
<incompatibleWith />

View File

@ -1,3 +1,11 @@
Version 1.0.6.6
- Ovipostors add on average 1.5x as much cum to a womb than before.
- The womb tick timing is now more consistent across a save and load, and also spread out across pawns.
- Babies of bestial relations get a mother/father relationship to their parents instead of the old sire one.
- Fix error when an egg fertilized by a nonexistent/garbage collected pawn (e.g. in an NPC's womb) tries to implant.
- Another hybrid fix for invalid races.
- Fix an implanted egg icon showing for mechanoid pregnancies.
Version 1.0.6.5
- Handle climacteric induced ovulators a bit better.
- Compatibility update for Sexperience 1.0.4.2