This commit is contained in:
moreoreganostodump 2021-02-13 18:45:22 +09:00
parent bf20fc3ceb
commit 6e31ac190b
19 changed files with 200 additions and 48 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.1</version> <version>1.0.1.2</version>
<dependencies> <dependencies>
</dependencies> </dependencies>
<incompatibleWith /> <incompatibleWith />

Binary file not shown.

View file

@ -21,7 +21,7 @@
<li> <li>
<label>unpleasant</label> <label>unpleasant</label>
<statFactors> <statFactors>
<SexFrequency>0.90</SexFrequency> <SexFrequency>0.50</SexFrequency>
<SexSatisfaction>0.95</SexSatisfaction> <SexSatisfaction>0.95</SexSatisfaction>
</statFactors> </statFactors>
<painOffset>0.05</painOffset> <painOffset>0.05</painOffset>
@ -30,8 +30,8 @@
<minSeverity>0.2</minSeverity> <minSeverity>0.2</minSeverity>
<label>annoy</label> <label>annoy</label>
<statFactors> <statFactors>
<SexFrequency>0.70</SexFrequency> <SexFrequency>0.40</SexFrequency>
<SexSatisfaction>0.90</SexSatisfaction> <SexSatisfaction>0.95</SexSatisfaction>
</statFactors> </statFactors>
<painOffset>0.1</painOffset> <painOffset>0.1</painOffset>
</li> </li>
@ -39,8 +39,8 @@
<minSeverity>0.4</minSeverity> <minSeverity>0.4</minSeverity>
<label>ache</label> <label>ache</label>
<statFactors> <statFactors>
<SexFrequency>0.50</SexFrequency> <SexFrequency>0.20</SexFrequency>
<SexSatisfaction>0.70</SexSatisfaction> <SexSatisfaction>0.95</SexSatisfaction>
</statFactors> </statFactors>
<painOffset>0.2</painOffset> <painOffset>0.2</painOffset>
</li> </li>
@ -49,7 +49,7 @@
<label>painful</label> <label>painful</label>
<statFactors> <statFactors>
<SexFrequency>0.0</SexFrequency> <SexFrequency>0.0</SexFrequency>
<SexSatisfaction>0.50</SexSatisfaction> <SexSatisfaction>0.95</SexSatisfaction>
</statFactors> </statFactors>
<painOffset>0.4</painOffset> <painOffset>0.4</painOffset>
</li> </li>
@ -81,8 +81,8 @@
<stages> <stages>
<li> <li>
<statFactors> <statFactors>
<SexFrequency>0.20</SexFrequency> <SexFrequency>0.01</SexFrequency>
<SexSatisfaction>0.25</SexSatisfaction> <SexSatisfaction>0.50</SexSatisfaction>
</statFactors> </statFactors>
<capMods> <capMods>
<li> <li>
@ -117,7 +117,7 @@
<li> <li>
<label>early</label> <label>early</label>
<statFactors> <statFactors>
<SexFrequency>0.75</SexFrequency> <SexFrequency>0.50</SexFrequency>
<SexSatisfaction>0.8</SexSatisfaction> <SexSatisfaction>0.8</SexSatisfaction>
</statFactors> </statFactors>
<capMods> <capMods>
@ -131,8 +131,8 @@
<label>middle</label> <label>middle</label>
<minSeverity>0.2</minSeverity> <minSeverity>0.2</minSeverity>
<statFactors> <statFactors>
<SexFrequency>0.50</SexFrequency> <SexFrequency>0.25</SexFrequency>
<SexSatisfaction>0.6</SexSatisfaction> <SexSatisfaction>0.7</SexSatisfaction>
</statFactors> </statFactors>
<capMods> <capMods>
<li> <li>
@ -145,8 +145,8 @@
<label>latter</label> <label>latter</label>
<minSeverity>0.4</minSeverity> <minSeverity>0.4</minSeverity>
<statFactors> <statFactors>
<SexFrequency>0.40</SexFrequency> <SexFrequency>0.10</SexFrequency>
<SexSatisfaction>0.4</SexSatisfaction> <SexSatisfaction>0.6</SexSatisfaction>
</statFactors> </statFactors>
<capMods> <capMods>
<li> <li>
@ -159,8 +159,8 @@
<label>end</label> <label>end</label>
<minSeverity>0.6</minSeverity> <minSeverity>0.6</minSeverity>
<statFactors> <statFactors>
<SexFrequency>0.25</SexFrequency> <SexFrequency>0.05</SexFrequency>
<SexSatisfaction>0.25</SexSatisfaction> <SexSatisfaction>0.5</SexSatisfaction>
</statFactors> </statFactors>
<capMods> <capMods>
<li> <li>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef Name="VaginaWashing">
<defName>VaginaWashing</defName>
<driverClass>RJW_Menstruation.JobDriver_VaginaWashing</driverClass>
<reportString>wasing vagina</reportString>
<casualInterruptible>true</casualInterruptible>
</JobDef>
</Defs>

View file

@ -74,7 +74,7 @@
<description>An wet used tampon</description> <description>An wet used tampon</description>
<thingClass>RJW_Menstruation.Absorber_Tampon</thingClass> <thingClass>RJW_Menstruation.Absorber_Tampon</thingClass>
<graphicData> <graphicData>
<texPath>Things/Item/Tampon_Dirty</texPath> <texPath>Things/Item/Tampon</texPath>
<graphicClass>Graphic_Single</graphicClass> <graphicClass>Graphic_Single</graphicClass>
</graphicData> </graphicData>
<tickerType>Never</tickerType> <tickerType>Never</tickerType>
@ -133,7 +133,7 @@
<tickerType>Never</tickerType> <tickerType>Never</tickerType>
<smeltable>false</smeltable> <smeltable>false</smeltable>
<statBases> <statBases>
<MaxHitPoints>20</MaxHitPoints> <MaxHitPoints>40</MaxHitPoints>
<Mass>0.02</Mass> <Mass>0.02</Mass>
<WorkToMake>1000</WorkToMake> <WorkToMake>1000</WorkToMake>
<Flammability>1.0</Flammability> <Flammability>1.0</Flammability>
@ -192,13 +192,13 @@
<description>An wet used pad</description> <description>An wet used pad</description>
<thingClass>RJW_Menstruation.Absorber</thingClass> <thingClass>RJW_Menstruation.Absorber</thingClass>
<graphicData> <graphicData>
<texPath>Things/Item/Pad_Dirty</texPath> <texPath>Things/Item/Pad</texPath>
<graphicClass>Graphic_Single</graphicClass> <graphicClass>Graphic_Single</graphicClass>
</graphicData> </graphicData>
<tickerType>Never</tickerType> <tickerType>Never</tickerType>
<smeltable>false</smeltable> <smeltable>false</smeltable>
<statBases> <statBases>
<MaxHitPoints>20</MaxHitPoints> <MaxHitPoints>40</MaxHitPoints>
<Mass>0.10</Mass> <Mass>0.10</Mass>
<MarketValue>0</MarketValue> <MarketValue>0</MarketValue>
<WorkToMake>1000</WorkToMake> <WorkToMake>1000</WorkToMake>

View file

@ -61,4 +61,6 @@
<Option17_Label>max enzygotic twins</Option17_Label> <Option17_Label>max enzygotic twins</Option17_Label>
<Option17_Desc>set max number of twins</Option17_Desc> <Option17_Desc>set max number of twins</Option17_Desc>
<FloatMenu_CleanSelf>Vaginal washing</FloatMenu_CleanSelf>
</LanguageData> </LanguageData>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
<VaginaWashing.reportString>질세척 하는중</VaginaWashing.reportString>
</LanguageData>

View file

@ -61,5 +61,6 @@
<Option17_Label>최대 일란성 쌍둥이 수</Option17_Label> <Option17_Label>최대 일란성 쌍둥이 수</Option17_Label>
<Option17_Desc>일란성 쌍둥이의 수를 제한합니다.</Option17_Desc> <Option17_Desc>일란성 쌍둥이의 수를 제한합니다.</Option17_Desc>
<FloatMenu_CleanSelf>질세척</FloatMenu_CleanSelf>
</LanguageData> </LanguageData>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -1,9 +1,15 @@
Version 1.0.1.2
- reduced sex satisfaction debuffs
- if pawn is climacteric or menopause sex need recover to 50%.
- added vaginal washing
- fixed bugs absorber does not work properly
- used absorbers are colored fluid's color
Version 1.0.1.1 Version 1.0.1.1
- requires RJW 4.6.1 or later - requires RJW 4.6.1 or later
- added superovulation inducing agent - added superovulation inducing agent
- cumflations (no effects yet) - cumflations (no effects yet)
- added tampon and sanitary pad can absorb fluids. - added tampon and sanitary pad can absorb fluids.
- tampon blocks fluids completly. however, keep wearing dirty tampon can cause infection. - tampon blocks fluids completely. however, keep wearing dirty tampon can cause infection.
- pad blocks fluids for a while, but if exceed over the absorbable, fluids leak again. - pad blocks fluids for a while, but if exceed over the absorbable, fluids leak again.
- fixed erros when male pawn take hyperfertility pills. - fixed erros when male pawn take hyperfertility pills.

View file

@ -89,6 +89,8 @@ namespace RJW_Menstruation
private int bleedingIntervalhours = -1; private int bleedingIntervalhours = -1;
private int recoveryIntervalhours = -1; private int recoveryIntervalhours = -1;
private float crampPain= -1; private float crampPain= -1;
private Need sexNeed = null;
private string customwombtex = null;
public float TotalCum public float TotalCum
{ {
@ -236,6 +238,19 @@ namespace RJW_Menstruation
} }
public string wombTex
{
get
{
if (customwombtex == null) return Props.wombTex;
else return customwombtex;
}
set
{
customwombtex = value;
}
}
public string GetFertilizingInfo public string GetFertilizingInfo
{ {
get get
@ -555,7 +570,7 @@ namespace RJW_Menstruation
/// <param name="targetcum"></param> /// <param name="targetcum"></param>
/// <param name="portion"></param> /// <param name="portion"></param>
/// <returns></returns> /// <returns></returns>
public float CumOutForce(Cum targetcum, float portion = 0.1f) public float CumOutForce(Cum targetcum = null, float portion = 0.1f)
{ {
if (cums.NullOrEmpty()) return 0; if (cums.NullOrEmpty()) return 0;
float outcum = 0; float outcum = 0;
@ -674,6 +689,19 @@ namespace RJW_Menstruation
loaded = true; loaded = true;
} }
public void AfterSimulator()
{
if (ovarypower < ovarypowerthreshold)
{
if (sexNeed == null) sexNeed = parent.pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
else
{
if (sexNeed.CurLevel < 0.5) sexNeed.CurLevel += 0.02f;
}
}
}
private Pawn Fertilize() private Pawn Fertilize()
{ {
@ -765,7 +793,7 @@ namespace RJW_Menstruation
private void BleedOut() private void BleedOut()
{ {
//FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label); //FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label);
CumIn(parent.pawn, Rand.Range(0f, 5f), Translations.Menstrual_Blood,-5.0f,ThingDefOf.Filth_Blood); CumIn(parent.pawn, Rand.Range(1f, 2f), Translations.Menstrual_Blood,-5.0f,ThingDefOf.Filth_Blood);
GetNotCum(Translations.Menstrual_Blood).color = Colors.blood; GetNotCum(Translations.Menstrual_Blood).color = Colors.blood;
} }
@ -777,9 +805,11 @@ namespace RJW_Menstruation
if (!absorber.dirty) if (!absorber.dirty)
{ {
absorber.absorbedfluids += amount; absorber.absorbedfluids += amount;
if (absorber.absorbedfluids < 10) if (absorber.absorbedfluids > absorber.GetStatValue(VariousDefOf.MaxAbsorbable))
{ {
absorber.def = absorber.DirtyDef; absorber.def = absorber.DirtyDef;
//absorber.fluidColor = GetCumMixtureColor;
absorber.SetColor(GetCumMixtureColor);
absorber.dirty = true; absorber.dirty = true;
} }
} }
@ -814,7 +844,7 @@ namespace RJW_Menstruation
} }
private Action PeriodSimulator(Enum targetstage) private Action PeriodSimulator(Stage targetstage)
{ {
Action action = null; Action action = null;
switch (targetstage) switch (targetstage)
@ -930,22 +960,24 @@ namespace RJW_Menstruation
case Stage.Fertilized: //Obsoleted stage. merged in luteal stage case Stage.Fertilized: //Obsoleted stage. merged in luteal stage
action = delegate action = delegate
{ {
if (curStageHrs >= 24) ModLog.Message("Obsoleted stage. skipping...");
{ GoNextStage(Stage.Luteal);
if (Implant()) //if (curStageHrs >= 24)
{ //{
GoNextStage(Stage.Pregnant); // if (Implant())
} // {
else // GoNextStage(Stage.Pregnant);
{ // }
GoNextStageSetHour(Stage.Luteal, 96); // else
} // {
} // GoNextStageSetHour(Stage.Luteal, 96);
else // }
{ //}
curStageHrs+=Configurations.CycleAcceleration; //else
StayCurrentStage(); //{
} // curStageHrs+=Configurations.CycleAcceleration;
// StayCurrentStage();
//}
}; };
break; break;
case Stage.Pregnant: case Stage.Pregnant:
@ -1095,6 +1127,7 @@ namespace RJW_Menstruation
{ {
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young; if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
CumOut(); CumOut();
AfterSimulator();
}; };
actionref = action; actionref = action;
@ -1107,6 +1140,7 @@ namespace RJW_Menstruation
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false); HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(nextstage), (int)(tickInterval * factor), parent.pawn, false);
} }
void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f) void GoNextStageSetHour(Stage nextstage, int hour, float factor = 1.0f)
{ {
curStageHrs = hour; curStageHrs = hour;

View file

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;
using Verse.AI;
namespace RJW_Menstruation
{
public class JobDriver_VaginaWashing : JobDriver
{
const int excretingTime = 300;//ticks - 120 = 2 real seconds, 3 in-game minutes
public override bool TryMakePreToilReservations(bool errorOnFailed)
{
return pawn.Reserve(pawn, job, 1, -1, null, errorOnFailed);
}
protected override IEnumerable<Toil> MakeNewToils()
{
HediffComp_Menstruation Comp = Utility.GetMenstruationComp(pawn);
this.FailOn(delegate
{
return !(Comp.TotalCumPercent > 0.01);
});
Toil excreting = Toils_General.Wait(excretingTime, TargetIndex.None);//duration of
excreting.WithProgressBarToilDelay(TargetIndex.A);
yield return excreting;
yield return new Toil()
{
initAction = delegate ()
{
Comp.CumOutForce(null, 0.5f);
if (Comp.TotalCumPercent > 0.01) this.JumpToToil(excreting);
}
};
//yield return excreting;
}
}
}

View file

@ -3,11 +3,12 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine;
using RimWorld; using RimWorld;
using Verse; using Verse;
using HarmonyLib; using HarmonyLib;
using HugsLib; using HugsLib;
using rjw;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -25,8 +26,47 @@ namespace RJW_Menstruation
comp.Initialize(); comp.Initialize();
} }
} }
}
[HarmonyPatch(typeof(FloatMenuMakerMap), "AddHumanlikeOrders")]
public class HumanlikeOrder_Patch
{
public static void Postfix(Vector3 clickPos, Pawn pawn, List<FloatMenuOption> opts)
{
var selftargets = GenUI.TargetsAt_NewTemp(clickPos, TargetingParameters.ForSelf(pawn));
foreach (LocalTargetInfo t in selftargets)
{
opts.AddDistinct(MakeSelfMenu(pawn, t));
}
}
public static FloatMenuOption MakeSelfMenu(Pawn pawn, LocalTargetInfo target)
{
FloatMenuOption option = null;
if (Utility.HasMenstruationComp(pawn))
{
option = FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(Translations.FloatMenu_CleanSelf, delegate ()
{
pawn.jobs.TryTakeOrderedJob_NewTemp(new Verse.AI.Job(VariousDefOf.VaginaWashing, null, null, target.Cell));
}, MenuOptionPriority.Low), pawn, target);
}
return option;
}
} }
} }

View file

@ -61,6 +61,7 @@
<Compile Include="DNADef.cs" /> <Compile Include="DNADef.cs" />
<Compile Include="DrugOutcomDoers.cs" /> <Compile Include="DrugOutcomDoers.cs" />
<Compile Include="Hediff_MultiplePregnancy.cs" /> <Compile Include="Hediff_MultiplePregnancy.cs" />
<Compile Include="JobDrivers.cs" />
<Compile Include="Patch\GetGizmos.cs" /> <Compile Include="Patch\GetGizmos.cs" />
<Compile Include="Gizmo_Womb.cs" /> <Compile Include="Gizmo_Womb.cs" />
<Compile Include="Patch\Harmony.cs" /> <Compile Include="Patch\Harmony.cs" />

View file

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using RimWorld; using RimWorld;
using Verse; using Verse;
using rjw; using rjw;
using UnityEngine;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -29,7 +30,9 @@ namespace RJW_Menstruation
public virtual ThingDef DirtyDef => def.GetModExtension<AbsorberModExtention>().dirtyDef; public virtual ThingDef DirtyDef => def.GetModExtension<AbsorberModExtention>().dirtyDef;
public virtual int MinHrstoDirtyEffect => def.GetModExtension<AbsorberModExtention>().minHourstoDirtyEffect; public virtual int MinHrstoDirtyEffect => def.GetModExtension<AbsorberModExtention>().minHourstoDirtyEffect;
public Color fluidColor = Color.white;
public virtual void DirtyEffect() {} public virtual void DirtyEffect() {}
@ -38,12 +41,15 @@ namespace RJW_Menstruation
wearhours++; wearhours++;
} }
public override Color DrawColorTwo => fluidColor;
public override void ExposeData() public override void ExposeData()
{ {
base.ExposeData(); base.ExposeData();
Scribe_Values.Look(ref absorbedfluids, "absorbedfluids", absorbedfluids, true); Scribe_Values.Look(ref absorbedfluids, "absorbedfluids", absorbedfluids, true);
Scribe_Values.Look(ref dirty, "dirty", dirty, true); Scribe_Values.Look(ref dirty, "dirty", dirty, true);
Scribe_Values.Look(ref wearhours, "wearhours", wearhours, true); Scribe_Values.Look(ref wearhours, "wearhours", wearhours, true);
Scribe_Values.Look(ref fluidColor, "fluidColor", fluidColor, true);
} }
} }

View file

@ -67,7 +67,7 @@ namespace RJW_Menstruation
public static readonly string Option17_Label = "Option17_Label".Translate(); public static readonly string Option17_Label = "Option17_Label".Translate();
public static readonly string Option17_Desc = "Option17_Desc".Translate(); public static readonly string Option17_Desc = "Option17_Desc".Translate();
public static readonly string FloatMenu_CleanSelf = "FloatMenu_CleanSelf".Translate();
} }
} }

View file

@ -122,7 +122,7 @@ namespace RJW_Menstruation
{ {
Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff;
string fetustex = DefDatabase<DNADef>.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default"; string fetustex = DefDatabase<DNADef>.GetNamedSilentFail(h.babies.First().def.defName)?.fetusTexPath ?? "Fetus/Fetus_Default";
if (h.GestationProgress < 0.2f) icon = comp.Props.wombTex + "_Implanted"; if (h.GestationProgress < 0.2f) icon = comp.wombTex + "_Implanted";
else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00"; else if (h.GestationProgress < 0.3f) icon += "Fetus/Fetus_Early00";
else if (h.GestationProgress < 0.4f) icon += fetustex + "00"; else if (h.GestationProgress < 0.4f) icon += fetustex + "00";
else if (h.GestationProgress < 0.5f) icon += fetustex + "01"; else if (h.GestationProgress < 0.5f) icon += fetustex + "01";
@ -137,7 +137,7 @@ namespace RJW_Menstruation
public static Texture2D GetCumIcon(HediffComp_Menstruation comp) public static Texture2D GetCumIcon(HediffComp_Menstruation comp)
{ {
string icon = comp.Props.wombTex; string icon = comp.wombTex;
float cumpercent = comp.TotalCumPercent; float cumpercent = comp.TotalCumPercent;
if (cumpercent < 0.001f) icon = "Womb/Empty"; if (cumpercent < 0.001f) icon = "Womb/Empty";
else if (cumpercent < 0.01f) icon += "_Cum_00"; else if (cumpercent < 0.01f) icon += "_Cum_00";
@ -164,7 +164,7 @@ namespace RJW_Menstruation
public static Texture2D GetWombIcon(HediffComp_Menstruation comp) public static Texture2D GetWombIcon(HediffComp_Menstruation comp)
{ {
string icon = comp.Props.wombTex; string icon = comp.wombTex;
HediffComp_Menstruation.Stage stage = comp.curStage; HediffComp_Menstruation.Stage stage = comp.curStage;
if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding"; if (stage == HediffComp_Menstruation.Stage.Bleeding) icon += "_Bleeding";

View file

@ -29,8 +29,8 @@ namespace RJW_Menstruation
public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable"); public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable");
public static readonly PawnRelationDef Relation_birthgiver = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Sire"); 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 PawnRelationDef Relation_spawn = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Pup");
public static readonly NeedDef SexNeed = DefDatabase<NeedDef>.GetNamed("Sex");
public static readonly JobDef VaginaWashing = DefDatabase<JobDef>.GetNamed("VaginaWashing");
} }
} }