This commit is contained in:
moreoreganostodump 2021-10-16 22:17:39 +09:00
parent 1a8d386e02
commit 77cdbb23c8
15 changed files with 131 additions and 52 deletions

Binary file not shown.

View file

@ -19,7 +19,7 @@
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breasts_Artificial</BreastTex>
<BreastTex>Breasts_Artificial/Breast</BreastTex>
<BlacknippleColor>(255,255,255)</BlacknippleColor>
</li>
</comps>
@ -31,7 +31,7 @@
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breasts_Artificial</BreastTex>
<BreastTex>Breasts_Artificial/Breast</BreastTex>
<BlacknippleColor>(255,255,255)</BlacknippleColor>
</li>
</comps>

View file

@ -195,12 +195,12 @@ namespace RJW_Menstruation
{
if (updatefilthDef != null) filthDef = updatefilthDef;
volume += volumein;
cumthickness = Mathf.Lerp(cumthickness, thickness, volumein / volume);
notcumthickness = Mathf.Lerp(notcumthickness, thickness, volumein / volume);
}
public bool ShouldRemove()
{
if (fertvolume < 0.001f && volume < 0.001f) return true;
if ((notcum || fertvolume < 0.001f) && volume < 0.01f) return true;
return false;
}
@ -218,7 +218,7 @@ namespace RJW_Menstruation
public float DismishForce(float portion, float leakfactor = 1.0f)
{
float totalleak = volume;
volume *= Math.Max(0, 1 - (portion * (1 - decayresist)) * leakfactor);
volume *= Math.Max(0, 1 - (portion * (1 - decayresist/10)) * leakfactor);
fertvolume *= Math.Max(0, 1 - (portion * (1 - decayresist)) * leakfactor);
CutMinor();
totalleak -= volume;

View file

@ -148,9 +148,17 @@ namespace RJW_Menstruation
public override void CompPostPostRemoved()
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(action);
ModLog.Message(parent.pawn.Label + "breast tick scheduler removed");
base.CompPostPostRemoved();
if (parent?.pawn?.GetBreastComp() == this)
{
Log.Warning("Something tried to remove hediff with wrong way.");
}
else
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(action);
Log.Message(parent.pawn.Label + "breast tick scheduler removed");
base.CompPostPostRemoved();
}
}
public void Initialize()

View file

@ -529,9 +529,16 @@ namespace RJW_Menstruation
public override void CompPostPostRemoved()
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref);
Log.Message(parent.pawn.Label + "tick scheduler removed");
base.CompPostPostRemoved();
if (parent?.pawn?.GetMenstruationComp() == this)
{
Log.Warning("Something tried to remove hediff with wrong way.");
}
else
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(actionref);
Log.Message(parent.pawn.Label + "tick scheduler removed");
base.CompPostPostRemoved();
}
}
@ -759,7 +766,7 @@ namespace RJW_Menstruation
/// </summary>
/// <param name="targetcum"></param>
/// <param name="portion"></param>
/// <returns></returns>
/// <returns>Amount of target cum</returns>
public float CumOut(Cum targetcum, float portion = 0.1f)
{
if (cums.NullOrEmpty()) return 0;
@ -869,12 +876,21 @@ namespace RJW_Menstruation
InitOvary(parent.pawn.ageTracker.AgeBiologicalYears);
if (parent.pawn.IsPregnant())
Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy();
if (pregnancy != null)
{
Hediff_BasePregnancy hediff = (Hediff_BasePregnancy)PregnancyHelper.GetPregnancy(parent.pawn);
currentIntervalhours = (int)(hediff?.GestationHours());
curStage = Stage.Pregnant;
Hediff hediff = PregnancyHelper.GetPregnancy(parent.pawn);
if (hediff != null)
{
if (hediff is Hediff_BasePregnancy)
{
Hediff_BasePregnancy preg = (Hediff_BasePregnancy)hediff;
currentIntervalhours = (int)(preg.GestationHours());
curStage = Stage.Pregnant;
}
}
}
if (parent.pawn.IsAnimal())
{
if (Configurations.EnableAnimalCycle)
@ -884,7 +900,7 @@ namespace RJW_Menstruation
}
else
{
if (!parent.pawn.IsPregnant() && parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Young), tickInterval, parent.pawn, false);
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);
}
}
@ -1044,7 +1060,28 @@ namespace RJW_Menstruation
if (!egg.fertilized || egg.fertstage < 168) continue;
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * Props.baseImplantationChanceFactor * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
{
if (!parent.pawn.IsPregnant())
Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy();
if (pregnancy != null)
{
if (Configurations.UseMultiplePregnancy && Configurations.EnableHeteroOvularTwins)
{
if (pregnancy is Hediff_MultiplePregnancy)
{
Hediff_MultiplePregnancy h = (Hediff_MultiplePregnancy)pregnancy;
h.AddNewBaby(parent.pawn, egg.fertilizer);
}
pregnant = true;
deadeggs.Add(egg);
}
else
{
pregnant = true;
break;
}
}
else
{
if (!Configurations.UseMultiplePregnancy)
{
@ -1064,22 +1101,7 @@ namespace RJW_Menstruation
deadeggs.Add(egg);
}
}
else if (Configurations.UseMultiplePregnancy && Configurations.EnableHeteroOvularTwins)
{
Hediff hediff = PregnancyHelper.GetPregnancy(parent.pawn);
if (hediff is Hediff_MultiplePregnancy)
{
Hediff_MultiplePregnancy h = (Hediff_MultiplePregnancy)hediff;
h.AddNewBaby(parent.pawn, egg.fertilizer);
}
pregnant = true;
deadeggs.Add(egg);
}
else
{
pregnant = true;
break;
}
}
else deadeggs.Add(egg);
}
@ -1342,7 +1364,7 @@ namespace RJW_Menstruation
Implant();
}
if (parent.pawn.IsPregnant())
if (parent.pawn.GetRJWPregnancy() != null)
{
curStageHrs += 1;
StayCurrentStageConst(Stage.Pregnant);

View file

@ -309,7 +309,6 @@ namespace RJW_Menstruation
public Pawn GenerateBaby(PawnGenerationRequest request, Pawn mother, Pawn father)
{
Pawn baby = PawnGenerator.GeneratePawn(request);
if (baby != null)
{
@ -356,6 +355,7 @@ namespace RJW_Menstruation
}
}
}
else Log.Error("Baby not generated. Request: " + request.ToString());
return baby;
}

View file

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using rjw;
namespace RJW_Menstruation
{
public class IngestionOutcomeDoer_GiveHediff_StackCount : IngestionOutcomeDoer_GiveHediff
{
private bool divideByBodySize = false;
protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested)
{
Hediff hediff = HediffMaker.MakeHediff(hediffDef, pawn);
float effect = ((!(severity > 0f)) ? hediffDef.initialSeverity : severity) * ingested.stackCount;
if (divideByBodySize)
{
effect /= pawn.BodySize;
}
AddictionUtility.ModifyChemicalEffectForToleranceAndBodySize(pawn, toleranceChemical, ref effect);
hediff.Severity = effect;
pawn.health.AddHediff(hediff);
}
}
}

View file

@ -11,6 +11,7 @@ namespace RJW_Menstruation
{
var har = new Harmony("RJW_Menstruation");
har.PatchAll(Assembly.GetExecutingAssembly());
}
}

View file

@ -122,7 +122,6 @@ namespace RJW_Menstruation
float morph = Mathf.Max(baby.BodySize - Mathf.Pow(vagina.Severity * mother.BodySize,2), 0f);
vagina.Severity += morph * Configurations.VaginaMorphPower;
}
}
}

View file

@ -61,6 +61,7 @@
<Compile Include="Configurations.cs" />
<Compile Include="Cum.cs" />
<Compile Include="HediffComps\MenstruationUtility.cs" />
<Compile Include="IngestionOutcomeDoers.cs" />
<Compile Include="Recipe_Surgery.cs" />
<Compile Include="UI\Dialog_HybridCustom.cs" />
<Compile Include="UI\Dialog_WombStatus.cs" />

View file

@ -179,6 +179,10 @@ namespace RJW_Menstruation
return null;
}
public static Hediff_BasePregnancy GetRJWPregnancy(this Pawn pawn)
{
return (Hediff_BasePregnancy)pawn.health.hediffSet.hediffs.FirstOrDefault(x => x is Hediff_BasePregnancy);
}
public static void DrawBreastIcon(this Pawn pawn, Rect rect , bool drawOrigin = false)
{

View file

@ -25,10 +25,10 @@ namespace RJW_Menstruation.Sexperience
{
HediffComp_Menstruation Comp = pawn.GetMenstruationComp();
this.FailOn(delegate
{
return !(Comp.TotalCumPercent > 0.001);
});
//this.FailOn(delegate
//{
// return !(Comp.TotalCumPercent > 0.001);
//});
yield return Toils_Goto.GotoThing(TargetIndex.B, PathEndMode.ClosestTouch);
Toil excreting = Toils_General.Wait(excretingTime, TargetIndex.None);//duration of
@ -38,18 +38,22 @@ namespace RJW_Menstruation.Sexperience
{
initAction = delegate ()
{
CumMixture mixture = Comp.MixtureOut(RJWSexperience.VariousDefOf.GatheredCum, 0.5f);
float amount = mixture.Volume;
if (mixture.ispurecum)
if (Comp.TotalCumPercent > 0.001)
{
Bucket.AddCum(amount);
}
else
{
GatheredCumMixture cummixture = (GatheredCumMixture)ThingMaker.MakeThing(VariousDefOf.GatheredCumMixture);
cummixture.InitwithCum(mixture);
Bucket.AddCum(amount, cummixture);
CumMixture mixture = Comp.MixtureOut(RJWSexperience.VariousDefOf.GatheredCum, 0.5f);
float amount = mixture.Volume;
if (mixture.ispurecum)
{
Bucket.AddCum(amount);
}
else
{
GatheredCumMixture cummixture = (GatheredCumMixture)ThingMaker.MakeThing(VariousDefOf.GatheredCumMixture);
cummixture.InitwithCum(mixture);
Bucket.AddCum(amount, cummixture);
}
}
else ReadyForNextToil();
if (Comp.TotalCumPercent > 0.001) JumpToToil(excreting);
}
};

View file

@ -1,11 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>RJW Menstruation</identifier>
<version>1.0.5.8</version>
<version>1.0.5.9</version>
<dependencies>
</dependencies>
<incompatibleWith />
<loadAfter>
<li>UnlimitedHugs.HugsLib</li>
<li>brrainz.harmony</li>
<li>rim.job.world</li>
<li>Abraxas.RJW.RaceSupport</li>
<li>rjw.milk.humanoid</li>
<li>rjw.sexperience</li>
</loadAfter>
<suggests>
</suggests>

View file

@ -1,3 +1,6 @@
Version 1.0.5.9
- minor bug fixes
Version 1.0.5.8
- requires RJW 4.8.1 or later
- added toggle for gather cums in womb into a cum bucket