cum mixtures

This commit is contained in:
moreoreganostodump 2021-02-17 23:20:49 +09:00
parent cd0809102a
commit 8d54a63532
17 changed files with 319 additions and 41 deletions

View file

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

Binary file not shown.

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<ThingDef ParentName="BaseFilth">
<defName>FilthMixture</defName>
<label>mixture</label>
<thingClass>RJW_Menstruation.Filth_Colored</thingClass>
<statBases>
<Beauty>-30</Beauty>
<Cleanliness>-10</Cleanliness>
</statBases>
<graphicData>
<graphicClass>Graphic_Random</graphicClass>
<texPath>Things/Filth/PoolSoft</texPath>
<color>(255, 255, 255, 180)</color>
</graphicData>
<filth>
<rainWashes>true</rainWashes>
<cleaningWorkToReduceThickness>40</cleaningWorkToReduceThickness>
<canFilthAttach>true</canFilthAttach>
</filth>
</ThingDef>
</Defs>

View file

@ -22,11 +22,12 @@
<durationDays>7.0</durationDays> <durationDays>7.0</durationDays>
<stackLimit>5</stackLimit> <stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier> <stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stackLimitForSameOtherPawn>1</stackLimitForSameOtherPawn>
<stages> <stages>
<li> <li>
<label>{0} came inside</label> <label>{0} came inside</label>
<description>I'm worried i might get pregnant.</description> <description>I'm worried i might get pregnant.</description>
<baseMoodEffect>-5</baseMoodEffect> <baseMoodEffect>-3</baseMoodEffect>
<baseOpinionOffset>-2</baseOpinionOffset> <baseOpinionOffset>-2</baseOpinionOffset>
</li> </li>
</stages> </stages>
@ -38,11 +39,12 @@
<durationDays>7.0</durationDays> <durationDays>7.0</durationDays>
<stackLimit>5</stackLimit> <stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier> <stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stackLimitForSameOtherPawn>1</stackLimitForSameOtherPawn>
<stages> <stages>
<li> <li>
<label>{0} came inside</label> <label>{0} came inside</label>
<description>I'm worried i might get pregnant.&#10;The chance is low, but...</description> <description>I'm worried i might get pregnant.&#10;The chance is low, but...</description>
<baseMoodEffect>-2</baseMoodEffect> <baseMoodEffect>-1</baseMoodEffect>
</li> </li>
</stages> </stages>
</ThoughtDef> </ThoughtDef>
@ -53,11 +55,12 @@
<durationDays>3.0</durationDays> <durationDays>3.0</durationDays>
<stackLimit>5</stackLimit> <stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier> <stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stackLimitForSameOtherPawn>1</stackLimitForSameOtherPawn>
<stages> <stages>
<li> <li>
<label>{0} came inside</label> <label>{0} came inside</label>
<description>I might get pregnant.</description> <description>I might get pregnant.</description>
<baseMoodEffect>15</baseMoodEffect> <baseMoodEffect>10</baseMoodEffect>
<baseOpinionOffset>5</baseOpinionOffset> <baseOpinionOffset>5</baseOpinionOffset>
</li> </li>
</stages> </stages>
@ -69,11 +72,12 @@
<durationDays>3.0</durationDays> <durationDays>3.0</durationDays>
<stackLimit>5</stackLimit> <stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier> <stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stackLimitForSameOtherPawn>1</stackLimitForSameOtherPawn>
<stages> <stages>
<li> <li>
<label>{0} came inside</label> <label>{0} came inside</label>
<description>I loved it.</description> <description>I loved it.</description>
<baseMoodEffect>5</baseMoodEffect> <baseMoodEffect>3</baseMoodEffect>
<baseOpinionOffset>1</baseOpinionOffset> <baseOpinionOffset>1</baseOpinionOffset>
</li> </li>
</stages> </stages>
@ -100,6 +104,7 @@
<durationDays>3.0</durationDays> <durationDays>3.0</durationDays>
<stackLimit>5</stackLimit> <stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier> <stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stackLimitForSameOtherPawn>1</stackLimitForSameOtherPawn>
<stages> <stages>
<li> <li>
<label>{0} came inside</label> <label>{0} came inside</label>
@ -116,6 +121,7 @@
<durationDays>7.0</durationDays> <durationDays>7.0</durationDays>
<stackLimit>5</stackLimit> <stackLimit>5</stackLimit>
<stackedEffectMultiplier>0.1</stackedEffectMultiplier> <stackedEffectMultiplier>0.1</stackedEffectMultiplier>
<stackLimitForSameOtherPawn>1</stackLimitForSameOtherPawn>
<stages> <stages>
<li> <li>
<label>{0} came inside</label> <label>{0} came inside</label>

View file

@ -12,6 +12,7 @@
<OvaryRegenerationPill.description>난소를 재생시켜 배출할수있는 난자의 양을 증가시킵니다.&#10;난자 소모량이 클수록 효과가 줄어듭니다.&#10;갱년기 증상을 완화시키지 않습니다.</OvaryRegenerationPill.description> <OvaryRegenerationPill.description>난소를 재생시켜 배출할수있는 난자의 양을 증가시킵니다.&#10;난자 소모량이 클수록 효과가 줄어듭니다.&#10;갱년기 증상을 완화시키지 않습니다.</OvaryRegenerationPill.description>
<SuperovulationInducingAgent.label>과배란 유도제</SuperovulationInducingAgent.label> <SuperovulationInducingAgent.label>과배란 유도제</SuperovulationInducingAgent.label>
<SuperovulationInducingAgent.description>과배란을 유도하는 약물입니다.&#10;조기폐경을 초래할수도 있습니다.</SuperovulationInducingAgent.description> <SuperovulationInducingAgent.description>과배란을 유도하는 약물입니다.&#10;조기폐경을 초래할수도 있습니다.</SuperovulationInducingAgent.description>
<FilthMixture.label>혼합물</FilthMixture.label>
</LanguageData> </LanguageData>

View file

@ -1,5 +1,8 @@
Version 1.0.1.4
- fixed bugs that in period hediff not disappear in time
- fixed enable menopause setting was not saved
- now cum filth is generated as a single mixture filth
Version 1.0.1.3 Version 1.0.1.3
*Note* you should update mod list
- requires RJW 4.6.1 or later - requires RJW 4.6.1 or later
- max absorbable statbase added to vanilla fabrics. - max absorbable statbase added to vanilla fabrics.
- added thoughts for cum inside - added thoughts for cum inside
@ -15,7 +18,7 @@ Version 1.0.1.3
- fixed bugs with enzygotic twins - fixed bugs with enzygotic twins
- enzigotic twins will get same appearance - enzigotic twins will get same appearance
- added HAR compatibllity - added HAR compatibllity
- - removed unused textures
Version 1.0.1.2 Version 1.0.1.2
- requires RJW 4.6.1 or later - requires RJW 4.6.1 or later
- reduced sex satisfaction debuffs - reduced sex satisfaction debuffs

View file

@ -96,6 +96,7 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref DrawVaginaStatus, "DrawVaginaStatus", DrawVaginaStatus, true); Scribe_Values.Look(ref DrawVaginaStatus, "DrawVaginaStatus", DrawVaginaStatus, true);
Scribe_Values.Look(ref Debug, "Debug", Debug, true); Scribe_Values.Look(ref Debug, "Debug", Debug, true);
Scribe_Values.Look(ref InfoDetail, "InfoDetail", InfoDetail, true); Scribe_Values.Look(ref InfoDetail, "InfoDetail", InfoDetail, true);
Scribe_Values.Look(ref EnableMenopause, "EnableMenopause", EnableMenopause, true);
Scribe_Values.Look(ref UseMultiplePregnancy, "UseMultiplePregnancy", UseMultiplePregnancy, true); Scribe_Values.Look(ref UseMultiplePregnancy, "UseMultiplePregnancy", UseMultiplePregnancy, true);
Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", EnableHeteroOvularTwins, true); Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", EnableHeteroOvularTwins, true);
Scribe_Values.Look(ref EnableEnzygoticTwins, "EnableEnzygoticTwins", EnableEnzygoticTwins, true); Scribe_Values.Look(ref EnableEnzygoticTwins, "EnableEnzygoticTwins", EnableEnzygoticTwins, true);

View file

@ -92,6 +92,7 @@ namespace RJW_Menstruation
fertvolume = 1.0f; fertvolume = 1.0f;
decayresist = 0; decayresist = 0;
} }
public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null) public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null)

View file

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using UnityEngine;
namespace RJW_Menstruation
{
public class FilthMaker_Colored
{
public static bool TryMakeFilth(IntVec3 c, Map map, ThingDef filthDef, IEnumerable<string> sources, Color color , bool shouldPropagate, FilthSourceFlags additionalFlags = FilthSourceFlags.None)
{
Filth_Colored filth = (Filth_Colored)(from t in c.GetThingList(map)
where t.def == filthDef
select t).FirstOrDefault<Thing>();
if (!c.Walkable(map) || (filth != null && !filth.CanBeThickened))
{
if (shouldPropagate)
{
List<IntVec3> list = GenAdj.AdjacentCells8WayRandomized();
for (int i = 0; i < 8; i++)
{
IntVec3 c2 = c + list[i];
if (c2.InBounds(map) && TryMakeFilth(c2, map, filthDef, sources, color,false, FilthSourceFlags.None))
{
return true;
}
}
}
if (filth != null)
{
filth.AddSources(sources);
}
return false;
}
if (filth != null)
{
filth.ThickenFilth();
filth.AddSources(sources);
}
else
{
if (!FilthMaker.CanMakeFilth(c, map, filthDef, additionalFlags))
{
return false;
}
Filth_Colored filth2 = (Filth_Colored)ThingMaker.MakeThing(filthDef, null);
filth2.DrawColor = color;
filth2.AddSources(sources);
GenSpawn.Spawn(filth2, c, map, WipeMode.Vanish);
}
//FilthMonitor.Notify_FilthSpawned();
return true;
}
}
}

View file

@ -91,6 +91,7 @@ namespace RJW_Menstruation
private float crampPain= -1; private float crampPain= -1;
private Need sexNeed = null; private Need sexNeed = null;
private string customwombtex = null; private string customwombtex = null;
private string customvagtex = null;
public float TotalCum public float TotalCum
{ {
@ -251,6 +252,19 @@ namespace RJW_Menstruation
} }
} }
public string vagTex
{
get
{
if (customvagtex == null) return Props.vagTex;
else return customvagtex;
}
set
{
customvagtex = value;
}
}
public string GetFertilizingInfo public string GetFertilizingInfo
{ {
get get
@ -434,6 +448,7 @@ namespace RJW_Menstruation
public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null) public void CumIn(Pawn pawn, float injectedvolume, float fertility = 1.0f, ThingDef filthdef = null)
{ {
float volume = injectedvolume * CumInFactor; float volume = injectedvolume * CumInFactor;
float cumd = TotalCumPercent;
float tmp = TotalCum + volume; float tmp = TotalCum + volume;
if (tmp > CumCapacity) if (tmp > CumCapacity)
{ {
@ -469,7 +484,9 @@ namespace RJW_Menstruation
} }
if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef)); if (!merged) cums.Add(new Cum(pawn, volume, fertility, filthdef));
} }
cumd = TotalCumPercent - cumd;
AfterCumIn(pawn); AfterCumIn(pawn);
AfterFluidIn(cumd);
} }
/// <summary> /// <summary>
@ -483,6 +500,7 @@ namespace RJW_Menstruation
public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null) public void CumIn(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthdef = null)
{ {
float tmp = TotalCum + volume; float tmp = TotalCum + volume;
float cumd = TotalCumPercent;
if (tmp > CumCapacity) if (tmp > CumCapacity)
{ {
float cumoutrate = 1 - (CumCapacity / tmp); float cumoutrate = 1 - (CumCapacity / tmp);
@ -519,7 +537,9 @@ namespace RJW_Menstruation
} }
if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef)); if (!merged) cums.Add(new Cum(pawn, volume, notcumlabel,decayresist, filthdef));
} }
cumd = TotalCumPercent - cumd;
AfterNotCumIn(); AfterNotCumIn();
AfterFluidIn(cumd);
} }
public void AfterCumIn(Pawn cummer) public void AfterCumIn(Pawn cummer)
@ -573,6 +593,66 @@ namespace RJW_Menstruation
} }
/// <summary>
/// Action for both Cum and NotCum
/// </summary>
/// <param name="fd">Fluid deviation</param>
public void AfterFluidIn(float fd)
{
//ModLog.Message("LLActivated: " + Configurations.LLActivated);
//if (Configurations.LLActivated)
//{
// LLCumflationIn(fd);
//}
}
/// <summary>
/// Cumflation for Licentia Labs
/// </summary>
/// <param name="fd"></param>
public void LLCumflationIn(float fd)
{
if (TotalCumPercent > 1.0f)
{
ModLog.Message("cumflation in");
BodyPartRecord genital = Genital_Helper.get_genitalsBPR(parent.pawn);
HediffWithComps hediff = parent.pawn.health?.hediffSet?.GetHediffs<HediffWithComps>()?.FirstOrDefault(x => x.def == VariousDefOf.Cumflation && x.Part.Equals(genital));
if (hediff == null) // 1.0 fd = 0.002 severity
{
ModLog.Message("hediff null");
hediff = (HediffWithComps)HediffMaker.MakeHediff(VariousDefOf.Cumflation, parent.pawn);
hediff.Severity = (TotalCumPercent - 1.0f) * 0.002f;
parent.pawn.health.AddHediff(hediff, genital);
ModLog.Message("added hediff");
}
else
{
ModLog.Message("increase severity: " + hediff.Part.Label);
hediff.Severity += fd * 0.002f;
}
}
}
public void LLCumflationOut(float fd)
{
HediffWithComps hediff = parent.pawn.health?.hediffSet?.GetHediffs<HediffWithComps>()?.FirstOrDefault(x => x.def == VariousDefOf.Cumflation && x.Part.def.Equals(xxx.genitalsDef));
if (hediff != null)
{
if (TotalCumPercent < 1.0f) parent.pawn.health.RemoveHediff(hediff);
else
{
ModLog.Message("decrease severity: " + hediff?.Part?.Label + TotalCumPercent * 0.002f);
hediff.Severity -= fd * 0.002f;
if (hediff.Severity < TotalCumPercent * 0.002f) hediff.Severity = TotalCumPercent * 0.002f;
}
}
}
public void BeforeCumOut(out Absorber absorber) public void BeforeCumOut(out Absorber absorber)
{ {
absorber = (Absorber)parent.pawn.apparel?.WornApparel?.Find(x => x.def.apparel.tags.Contains("Absorber")); absorber = (Absorber)parent.pawn.apparel?.WornApparel?.Find(x => x.def.apparel.tags.Contains("Absorber"));
@ -583,12 +663,29 @@ namespace RJW_Menstruation
} }
} }
/// <summary>
/// For natural leaking
/// </summary>
public void AfterCumOut() public void AfterCumOut()
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.LeakingFluids); parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.LeakingFluids);
} }
/// <summary>
/// For all type of leaking
/// </summary>
/// <param name="fd"></param>
public void AfterFluidOut(float fd)
{
//if (Configurations.LLActivated)
//{
// LLCumflationOut(fd);
//}
}
/// <summary> /// <summary>
/// Excrete cums in womb naturally /// Excrete cums in womb naturally
/// </summary> /// </summary>
@ -596,8 +693,9 @@ namespace RJW_Menstruation
{ {
float leakfactor = 1.0f; float leakfactor = 1.0f;
float totalleak = 0f; float totalleak = 0f;
Absorber absorber; float cumd = TotalCumPercent;
BeforeCumOut(out absorber); List<string> filthlabels = new List<string>();
BeforeCumOut(out Absorber absorber);
if (cums.NullOrEmpty()) return; if (cums.NullOrEmpty()) return;
else if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f; else if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f;
List<Cum> removecums = new List<Cum>(); List<Cum> removecums = new List<Cum>();
@ -607,16 +705,23 @@ namespace RJW_Menstruation
cum.volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor)); cum.volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor));
cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
vd -= cum.volume; vd -= cum.volume;
totalleak += MakeCumFilth(cum, vd, absorber); totalleak += AbsorbCum(cum, vd, absorber);
string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn.LabelShort, 1.ToString());
filthlabels.Add(tmp.Replace(" x1",""));
if (cum.fertvolume < 0.01f) cum.fertvolume = 0; if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum); if (cum.volume < 0.01f) removecums.Add(cum);
} }
foreach(Cum cum in removecums) if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
foreach (Cum cum in removecums)
{ {
cums.Remove(cum); cums.Remove(cum);
} }
removecums.Clear(); removecums.Clear();
cumd = TotalCumPercent - cumd;
if (totalleak >= 1.0f) AfterCumOut(); if (totalleak >= 1.0f) AfterCumOut();
AfterFluidOut(cumd);
} }
/// <summary> /// <summary>
@ -628,8 +733,11 @@ namespace RJW_Menstruation
public float CumOut(Cum targetcum, float portion = 0.1f) public float CumOut(Cum targetcum, float portion = 0.1f)
{ {
float leakfactor = 1.0f; float leakfactor = 1.0f;
float totalleak = 0;
List<string> filthlabels = new List<string>();
if (cums.NullOrEmpty()) return 0; if (cums.NullOrEmpty()) return 0;
float outcum = 0; float outcum = 0;
float cumd = TotalCumPercent;
List<Cum> removecums = new List<Cum>(); List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums) foreach (Cum cum in cums)
{ {
@ -637,15 +745,22 @@ namespace RJW_Menstruation
if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist)); if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist));
cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist)) * leakfactor); cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist)) * leakfactor);
cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist)) * leakfactor) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist)))); cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist)) * leakfactor) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
MakeCumFilth(cum, vd - cum.volume); //MakeCumFilth(cum, vd - cum.volume);
string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn.LabelShort, 1.ToString());
filthlabels.Add(tmp.Replace(" x1", ""));
totalleak += vd - cum.volume;
if (cum.fertvolume < 0.01f) cum.fertvolume = 0; if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.01f) removecums.Add(cum); if (cum.volume < 0.01f) removecums.Add(cum);
} }
if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
foreach (Cum cum in removecums) foreach (Cum cum in removecums)
{ {
cums.Remove(cum); cums.Remove(cum);
} }
removecums.Clear(); removecums.Clear();
cumd = TotalCumPercent - cumd;
AfterFluidOut(cumd);
return outcum; return outcum;
} }
@ -659,6 +774,9 @@ namespace RJW_Menstruation
{ {
if (cums.NullOrEmpty()) return 0; if (cums.NullOrEmpty()) return 0;
float outcum = 0; float outcum = 0;
float totalleak = 0;
List<string> filthlabels = new List<string>();
float cumd = TotalCumPercent;
List<Cum> removecums = new List<Cum>(); List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums) foreach (Cum cum in cums)
{ {
@ -666,15 +784,22 @@ namespace RJW_Menstruation
if (cum.Equals(targetcum)) outcum = cum.volume * (portion); if (cum.Equals(targetcum)) outcum = cum.volume * (portion);
cum.volume *= 1 - (portion); cum.volume *= 1 - (portion);
cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio)); cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio));
MakeCumFilth(cum, vd - cum.volume); //MakeCumFilth(cum, vd - cum.volume);
string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn.LabelShort, 1.ToString());
filthlabels.Add(tmp.Replace(" x1", ""));
totalleak += vd - cum.volume;
if (cum.fertvolume < 0.01f) cum.fertvolume = 0; if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
if (cum.volume < 0.1f) removecums.Add(cum); if (cum.volume < 0.1f) removecums.Add(cum);
} }
if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
foreach (Cum cum in removecums) foreach (Cum cum in removecums)
{ {
cums.Remove(cum); cums.Remove(cum);
} }
removecums.Clear(); removecums.Clear();
cumd = TotalCumPercent - cumd;
AfterFluidOut(cumd);
return outcum; return outcum;
} }
@ -784,24 +909,6 @@ namespace RJW_Menstruation
if (sexNeed.CurLevel < 0.5) sexNeed.CurLevel += 0.01f; if (sexNeed.CurLevel < 0.5) sexNeed.CurLevel += 0.01f;
} }
} }
//if (Configurations.LLActivated)
//{
// float tcp = TotalCumPercent;
// if (tcp > 2.0f)
// {
// Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Cumflation);
// if (hediff != null)
// {
//
// }
// else
// {
//
// }
// }
//
//}
} }
@ -910,13 +1017,13 @@ namespace RJW_Menstruation
} }
/// <summary> /// <summary>
/// Make filth from considering absorber /// Absorb cum and return leaked amount
/// </summary> /// </summary>
/// <param name="cum"></param> /// <param name="cum"></param>
/// <param name="amount"></param> /// <param name="amount"></param>
/// <param name="absorber"></param> /// <param name="absorber"></param>
/// <returns></returns> /// <returns></returns>
private float MakeCumFilth(Cum cum, float amount, Absorber absorber) private float AbsorbCum(Cum cum, float amount, Absorber absorber)
{ {
if (absorber != null) if (absorber != null)
@ -935,18 +1042,40 @@ namespace RJW_Menstruation
} }
else else
{ {
if (absorber.LeakAfterDirty) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
//if (absorber.LeakAfterDirty) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount; return amount;
} }
} }
else else
{ {
if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); //if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount; return amount;
} }
return 0; return 0;
} }
private float MakeCumFilthMixture(float amount, List<string> cumlabels)
{
if (amount >= minmakefilthvalue)
{
FilthMaker_Colored.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, VariousDefOf.FilthMixture, cumlabels,GetCumMixtureColor,false);
}
return amount;
}
private string FilthLabelMaker(List<string> labels)
{
string res = "";
foreach (string label in labels)
{
res += label;
}
return res;
}
private void EggDecay() private void EggDecay()
@ -1073,6 +1202,8 @@ namespace RJW_Menstruation
if (curStageHrs >= bleedingIntervalhours) if (curStageHrs >= bleedingIntervalhours)
{ {
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor); follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff);
GoNextStage(Stage.Follicular); GoNextStage(Stage.Follicular);
} }
else else

View file

@ -16,7 +16,7 @@ namespace RJW_Menstruation
{ {
static First() static First()
{ {
var har = new Harmony("LL"); var har = new Harmony("RJW_Menstruation");
har.PatchAll(Assembly.GetExecutingAssembly()); har.PatchAll(Assembly.GetExecutingAssembly());
} }
} }

View file

@ -89,4 +89,5 @@ namespace RJW_Menstruation
} }

View file

@ -60,6 +60,7 @@
<Compile Include="Dialog_WombStatus.cs" /> <Compile Include="Dialog_WombStatus.cs" />
<Compile Include="DNADef.cs" /> <Compile Include="DNADef.cs" />
<Compile Include="DrugOutcomDoers.cs" /> <Compile Include="DrugOutcomDoers.cs" />
<Compile Include="FilthMaker_Colored.cs" />
<Compile Include="HARCompatibility.cs" /> <Compile Include="HARCompatibility.cs" />
<Compile Include="Hediff_MultiplePregnancy.cs" /> <Compile Include="Hediff_MultiplePregnancy.cs" />
<Compile Include="JobDrivers.cs" /> <Compile Include="JobDrivers.cs" />

View file

@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Reflection; using System.Reflection;
using RimWorld;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -12,14 +13,14 @@ namespace RJW_Menstruation
public static object GetMemberValue(this Type type, string name) public static object GetMemberValue(this Type type, string name)
{ {
BindingFlags flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; BindingFlags flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
FieldInfo fieldInfo = (type != null) ? type.GetField(name, flags) : null; FieldInfo fieldInfo = type?.GetField(name, flags);
return fieldInfo?.GetValue(null); return fieldInfo?.GetValue(null);
} }
public static object GetMemberValue(this object obj, string name) public static object GetMemberValue(this object obj, string name)
{ {
BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
FieldInfo fieldInfo = (obj != null) ? obj.GetType().GetField(name, flags) : null; FieldInfo fieldInfo = obj?.GetType().GetField(name, flags);
return fieldInfo?.GetValue(obj); return fieldInfo?.GetValue(obj);
} }
@ -43,5 +44,6 @@ namespace RJW_Menstruation
} }
} }
} }
} }

View file

@ -76,6 +76,44 @@ namespace RJW_Menstruation
} }
public class Filth_Colored : Filth
{
private Color color = Color.white;
public override void ExposeData()
{
base.ExposeData();
Scribe_Values.Look(ref color, "color", color, true);
}
public override Color DrawColor
{
get
{
if (color != Color.white)
{
return color;
}
if (Stuff != null)
{
return def.GetColorForStuff(Stuff);
}
if (def.graphicData != null)
{
return def.graphicData.color;
}
return color;
}
set
{
color = value;
}
}
}

View file

@ -1,4 +1,6 @@
using System; using System;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -202,9 +204,9 @@ namespace RJW_Menstruation
public static Texture2D GetGenitalIcon(this Pawn pawn) public static Texture2D GetGenitalIcon(this Pawn pawn)
{ {
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina")); var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
CompProperties_Menstruation Props = (CompProperties_Menstruation)hediff.TryGetComp<HediffComp_Menstruation>().props; HediffComp_Menstruation comp = pawn.GetMenstruationComp();
string icon; string icon;
if (Props != null) icon = Props.vagTex; if (comp != null) icon = comp.vagTex;
else icon = "Genitals/Vagina"; else icon = "Genitals/Vagina";
if (hediff.Severity < 0.20f) icon += "00"; //micro if (hediff.Severity < 0.20f) icon += "00"; //micro
@ -279,5 +281,6 @@ namespace RJW_Menstruation
} }
} }

View file

@ -21,6 +21,7 @@ namespace RJW_Menstruation
public static readonly ThingDef CumFilth = DefDatabase<ThingDef>.GetNamed("FilthCum"); public static readonly ThingDef CumFilth = DefDatabase<ThingDef>.GetNamed("FilthCum");
public static readonly ThingDef Tampon = DefDatabase<ThingDef>.GetNamed("Absorber_Tampon"); public static readonly ThingDef Tampon = DefDatabase<ThingDef>.GetNamed("Absorber_Tampon");
public static readonly ThingDef Tampon_Dirty = DefDatabase<ThingDef>.GetNamed("Absorber_Tampon_Dirty"); public static readonly ThingDef Tampon_Dirty = DefDatabase<ThingDef>.GetNamed("Absorber_Tampon_Dirty");
public static readonly ThingDef FilthMixture = DefDatabase<ThingDef>.GetNamed("FilthMixture");
public static readonly HediffDef RJW_IUD = DefDatabase<HediffDef>.GetNamed("RJW_IUD"); public static readonly HediffDef RJW_IUD = DefDatabase<HediffDef>.GetNamed("RJW_IUD");
public static readonly HediffDef Hediff_MenstrualCramp = DefDatabase<HediffDef>.GetNamed("Hediff_MenstrualCramp"); public static readonly HediffDef Hediff_MenstrualCramp = DefDatabase<HediffDef>.GetNamed("Hediff_MenstrualCramp");
public static readonly HediffDef Hediff_Climacteric = DefDatabase<HediffDef>.GetNamed("Hediff_Climacteric"); public static readonly HediffDef Hediff_Climacteric = DefDatabase<HediffDef>.GetNamed("Hediff_Climacteric");
@ -47,6 +48,8 @@ namespace RJW_Menstruation
// Defs from Licentia Labs // Defs from Licentia Labs
public static readonly HediffDef Cumflation = DefDatabase<HediffDef>.GetNamedSilentFail("Cumflation"); public static readonly HediffDef Cumflation = DefDatabase<HediffDef>.GetNamedSilentFail("Cumflation");
public static readonly ThoughtDef GotOverCumflated = DefDatabase<ThoughtDef>.GetNamedSilentFail("GotOverCumflated");
public static readonly ThoughtDef GotOverCumflatedEnjoyed = DefDatabase<ThoughtDef>.GetNamedSilentFail("GotOverCumflatedEnjoyed");