mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Merge branch 'bugfixes' into 'main'
Bugfixes See merge request lutepickle/rjw_menstruation!1
This commit is contained in:
commit
0e9a5fabda
7 changed files with 71 additions and 38 deletions
|
@ -251,11 +251,27 @@ namespace RJW_Menstruation
|
||||||
return mixedcolor;
|
return mixedcolor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Stage CurrentVisibleStage
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (curStage == Stage.Pregnant)
|
||||||
|
{
|
||||||
|
if (Configurations.InfoDetail == Configurations.DetailLevel.All || (PregnancyHelper.GetPregnancy(parent.pawn)?.Visible ?? false))
|
||||||
|
return Stage.Pregnant;
|
||||||
|
else
|
||||||
|
return Stage.Luteal;
|
||||||
|
}
|
||||||
|
return curStage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string GetCurStageLabel
|
public string GetCurStageLabel
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
switch (curStage)
|
switch (CurrentVisibleStage)
|
||||||
{
|
{
|
||||||
case Stage.Follicular:
|
case Stage.Follicular:
|
||||||
return Translations.Stage_Follicular;
|
return Translations.Stage_Follicular;
|
||||||
|
@ -268,8 +284,7 @@ namespace RJW_Menstruation
|
||||||
case Stage.Fertilized:
|
case Stage.Fertilized:
|
||||||
return Translations.Stage_Fertilized;
|
return Translations.Stage_Fertilized;
|
||||||
case Stage.Pregnant:
|
case Stage.Pregnant:
|
||||||
if (Configurations.InfoDetail == Configurations.DetailLevel.All || (PregnancyHelper.GetPregnancy(parent.pawn)?.Visible ?? false)) return Translations.Stage_Pregnant;
|
return Translations.Stage_Pregnant;
|
||||||
else return Translations.Stage_Luteal;
|
|
||||||
case Stage.Recover:
|
case Stage.Recover:
|
||||||
return Translations.Stage_Recover;
|
return Translations.Stage_Recover;
|
||||||
case Stage.None:
|
case Stage.None:
|
||||||
|
@ -483,7 +498,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (!StageTexture.TryGetValue(curStage, out Texture2D tex)) tex = TextureCache.TzeentchTexture;
|
if (!StageTexture.TryGetValue(CurrentVisibleStage, out Texture2D tex)) tex = TextureCache.TzeentchTexture;
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,7 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
public static Texture2D GetEggIcon(this HediffComp_Menstruation comp)
|
public static Texture2D GetEggIcon(this HediffComp_Menstruation comp)
|
||||||
{
|
{
|
||||||
if (comp.parent.pawn.IsPregnant())
|
if (comp.parent.pawn.IsPregnant(Configurations.InfoDetail != Configurations.DetailLevel.All))
|
||||||
{
|
{
|
||||||
if (comp.parent.pawn.GetPregnancyProgress() < 0.2f) return ContentFinder<Texture2D>.Get("Eggs/Egg_Implanted00", true);
|
if (comp.parent.pawn.GetPregnancyProgress() < 0.2f) return ContentFinder<Texture2D>.Get("Eggs/Egg_Implanted00", true);
|
||||||
else return ContentFinder<Texture2D>.Get("Womb/Empty", true);
|
else return ContentFinder<Texture2D>.Get("Womb/Empty", true);
|
||||||
|
|
|
@ -17,43 +17,27 @@ namespace RJW_Menstruation
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Gizmo> gizmoList = __result.ToList();
|
|
||||||
|
|
||||||
|
|
||||||
if (__instance.ShouldShowWombGizmo())
|
if (__instance.ShouldShowWombGizmo())
|
||||||
{
|
{
|
||||||
AddWombGizmos(__instance, ref gizmoList);
|
__result = AddWombGizmos(__instance, __result);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (Configurations.EnableWombIcon && __instance.gender == Gender.Female)
|
|
||||||
//{
|
|
||||||
// if (!__instance.IsAnimal())
|
|
||||||
// {
|
|
||||||
// AddWombGizmos(__instance, ref gizmoList);
|
|
||||||
// }
|
|
||||||
// else if (Configurations.EnableAnimalCycle)
|
|
||||||
// {
|
|
||||||
// AddWombGizmos(__instance, ref gizmoList);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__result = gizmoList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<Gizmo> AddWombGizmos(Pawn __instance, IEnumerable<Gizmo> gizmos)
|
||||||
private static void AddWombGizmos(Pawn __instance, ref List<Gizmo> gizmoList)
|
|
||||||
{
|
{
|
||||||
|
foreach (Gizmo gizmo in gizmos)
|
||||||
|
yield return gizmo;
|
||||||
|
|
||||||
HediffComp_Menstruation comp = __instance.GetMenstruationComp();
|
HediffComp_Menstruation comp = __instance.GetMenstruationComp();
|
||||||
if (comp != null) AddMenstruationGizmos(__instance, comp, ref gizmoList);
|
if (comp == null) yield break;
|
||||||
|
|
||||||
|
foreach (Gizmo gizmo in GetMenstruationGizmos(__instance, comp))
|
||||||
|
yield return gizmo;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AddMenstruationGizmos(Pawn pawn, HediffComp_Menstruation comp, ref List<Gizmo> gizmolist)
|
public static List<Gizmo> GetMenstruationGizmos(Pawn pawn, HediffComp_Menstruation comp)
|
||||||
{
|
{
|
||||||
gizmolist.Add(CreateGizmo_WombStatus(pawn, comp));
|
return new List<Gizmo>() { CreateGizmo_WombStatus(pawn, comp) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using rjw;
|
using rjw;
|
||||||
|
using rjw.Modules.Interactions.Enums;
|
||||||
|
using rjw.Modules.Interactions.Objects;
|
||||||
using Verse;
|
using Verse;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
@ -19,6 +21,8 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) return true;
|
if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) return true;
|
||||||
|
|
||||||
|
if (!InteractionCanCausePregnancy(props)) return false;
|
||||||
|
|
||||||
var pawnparts = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn));
|
var pawnparts = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn));
|
||||||
|
|
||||||
HediffComp_Menstruation comp = partner.GetMenstruationComp();
|
HediffComp_Menstruation comp = partner.GetMenstruationComp();
|
||||||
|
@ -39,6 +43,36 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if pregnancy can happen based on the interaction def
|
||||||
|
/// This is needed for futanari sex, but should work for everyone
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="props"></param>
|
||||||
|
/// <returns>Interaction can result in pregnancy</returns>
|
||||||
|
private static bool InteractionCanCausePregnancy(SexProps props)
|
||||||
|
{
|
||||||
|
InteractionWithExtension interaction = rjw.Modules.Interactions.Helpers.InteractionHelper.GetWithExtension(props.dictionaryKey);
|
||||||
|
|
||||||
|
if (!interaction.HasInteractionTag(InteractionTag.Fertilization))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
bool usesPawnsPenis;
|
||||||
|
bool usesPartnersVagina;
|
||||||
|
|
||||||
|
if (!props.isReceiver)
|
||||||
|
{
|
||||||
|
usesPawnsPenis = interaction.DominantHasTag(GenitalTag.CanPenetrate);
|
||||||
|
usesPartnersVagina = interaction.SubmissiveHasFamily(GenitalFamily.Vagina);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usesPawnsPenis = interaction.SubmissiveHasTag(GenitalTag.CanPenetrate);
|
||||||
|
usesPartnersVagina = interaction.DominantHasFamily(GenitalFamily.Vagina);
|
||||||
|
}
|
||||||
|
|
||||||
|
return usesPawnsPenis && usesPartnersVagina;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")]
|
[HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")]
|
||||||
|
|
|
@ -13,15 +13,15 @@ using HarmonyLib;
|
||||||
|
|
||||||
namespace RJW_Menstruation.Sexperience
|
namespace RJW_Menstruation.Sexperience
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(Pawn_GetGizmos), "AddMenstruationGizmos")]
|
[HarmonyPatch(typeof(Pawn_GetGizmos), nameof(Pawn_GetGizmos.GetMenstruationGizmos))]
|
||||||
public static class GetGizmos_Patch
|
public static class GetGizmos_Patch
|
||||||
{
|
{
|
||||||
public static void Postfix(Pawn pawn, HediffComp_Menstruation comp, ref List<Gizmo> gizmolist)
|
public static void Postfix(Pawn pawn, HediffComp_Menstruation comp, ref List<Gizmo> __result)
|
||||||
{
|
{
|
||||||
gizmolist.Add(CreateGizmo_GatherCum(pawn, comp));
|
__result.Add(CreateGizmo_GatherCum(comp));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Gizmo CreateGizmo_GatherCum(Pawn pawn, HediffComp_Menstruation comp)
|
private static Gizmo CreateGizmo_GatherCum(HediffComp_Menstruation comp)
|
||||||
{
|
{
|
||||||
Texture2D icon = TextureCache.GatherCum_Bucket;
|
Texture2D icon = TextureCache.GatherCum_Bucket;
|
||||||
string label = Keyed.RS_GatherCum;
|
string label = Keyed.RS_GatherCum;
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace RJW_Menstruation.Sexperience
|
||||||
public static bool HasJobOnThing(Pawn pawn, Thing t, bool forced, ref bool __result)
|
public static bool HasJobOnThing(Pawn pawn, Thing t, bool forced, ref bool __result)
|
||||||
{
|
{
|
||||||
HediffComp_Menstruation comp = pawn.GetMenstruationComp();
|
HediffComp_Menstruation comp = pawn.GetMenstruationComp();
|
||||||
if (comp != null && comp.DoCleanWomb && comp.TotalCumPercent > 0.001f)
|
if (comp != null && comp.DoCleanWomb && comp.TotalCumPercent > 0.001f && pawn.Map.listerBuildings.ColonistsHaveBuilding(VariousDefOf.CumBucket))
|
||||||
{
|
{
|
||||||
__result = true;
|
__result = true;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -12,6 +12,6 @@ namespace RJW_Menstruation.Sexperience
|
||||||
|
|
||||||
public static readonly JobDef VaginaWashingwithBucket = DefDatabase<JobDef>.GetNamed("VaginaWashingwithBucket");
|
public static readonly JobDef VaginaWashingwithBucket = DefDatabase<JobDef>.GetNamed("VaginaWashingwithBucket");
|
||||||
public static readonly ThingDef GatheredCumMixture = DefDatabase<ThingDef>.GetNamed("GatheredCumMixture");
|
public static readonly ThingDef GatheredCumMixture = DefDatabase<ThingDef>.GetNamed("GatheredCumMixture");
|
||||||
|
public static readonly ThingDef CumBucket = DefDatabase<ThingDef>.GetNamed("CumBucket");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue