This commit is contained in:
moreoreganostodump 2021-03-01 23:40:50 +09:00
parent 9e41472468
commit 8d75d7aac1
17 changed files with 542 additions and 81 deletions

View file

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

Binary file not shown.

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<KeyBindingDef ParentName="GameKeyBinding">
<defName>OpenStatusWindow</defName>
<label>menstruation: open status window</label>
<defaultKeyCodeA>Q</defaultKeyCodeA>
</KeyBindingDef>
</Defs>

View file

@ -13,6 +13,8 @@
<Stage_Recover>Recovering from birth</Stage_Recover>
<Stage_None>None</Stage_None>
<Stage_Climacteric>Climacteric</Stage_Climacteric>
<Stage_Anestrus>Anestrus</Stage_Anestrus>
<Button_HealthTab>Status</Button_HealthTab>
<Dialog_WombInfo01>State</Dialog_WombInfo01>
<Dialog_WombInfo02>Fetus</Dialog_WombInfo02>
<Dialog_WombInfo03>Father</Dialog_WombInfo03>
@ -23,8 +25,8 @@
<Dialog_WombInfo08></Dialog_WombInfo08>
<Dialog_WombInfo09></Dialog_WombInfo09>
<Option1_Label>enable womb icon</Option1_Label>
<Option1_Desc>enable womb icon gizmo</Option1_Desc>
<Option1_Label_1>enable womb icon</Option1_Label_1>
<Option1_Label_2>enable button in health tab</Option1_Label_2>
<Option2_Label>enable animal cycle</Option2_Label>
<Option2_Desc>simulate animal's cycle.&#10;this option will apply after save loaded&#10;not recommended</Option2_Desc>
<Option3_Label>implantation chance</Option3_Label>
@ -62,6 +64,16 @@
<Option17_Desc>set max number of twins</Option17_Desc>
<Option18_Label>enable egg overlay</Option18_Label>
<Option18_Desc>enable egg overlay on womb icon</Option18_Desc>
<Option19_Label_1>bleeding amount</Option19_Label_1>
<Option19_Label_2>estimated total bleeding amount</Option19_Label_2>
<Option19_Desc>set bleeding amount&#10;actual bleeding amount can be different depending on vagina&#10;the generic bleeding amount of human female is about 20~80ml per month</Option19_Desc>
<Option20_Label_1>Colonist</Option20_Label_1>
<Option20_Label_2>Prisoner</Option20_Label_2>
<Option20_Label_3>Ally Faction</Option20_Label_3>
<Option20_Label_4>Neutral</Option20_Label_4>
<Option20_Label_5>Hostile Faction</Option20_Label_5>
<Option21_Label>target pawns</Option21_Label>
<Option21_Desc>the gizmo and button will appear for these pawns</Option21_Desc>
<FloatMenu_CleanSelf>Vaginal washing</FloatMenu_CleanSelf>

View file

@ -13,6 +13,8 @@
<Stage_Recover>회복기</Stage_Recover>
<Stage_None>없음</Stage_None>
<Stage_Climacteric>갱년기</Stage_Climacteric>
<Stage_Anestrus>휴지기</Stage_Anestrus>
<Button_HealthTab>상태창</Button_HealthTab>
<Dialog_WombInfo01>상태</Dialog_WombInfo01>
<Dialog_WombInfo02>태아</Dialog_WombInfo02>
<Dialog_WombInfo03></Dialog_WombInfo03>
@ -23,8 +25,8 @@
<Dialog_WombInfo08></Dialog_WombInfo08>
<Dialog_WombInfo09></Dialog_WombInfo09>
<Option1_Label>자궁아이콘 활성화</Option1_Label>
<Option1_Desc>자궁아이콘을 활성화 합니다.</Option1_Desc>
<Option1_Label_1>자궁아이콘 활성화</Option1_Label_1>
<Option1_Label_2>건강탭에 버튼 추가</Option1_Label_2>
<Option2_Label>동물주기 활성화</Option2_Label>
<Option2_Desc>동물의 월경주기를 시뮬레이션합니다.&#10;변경한후에 세이브로드가 필요합니다.&#10;not recommended</Option2_Desc>
<Option3_Label>착상확률</Option3_Label>
@ -62,6 +64,16 @@
<Option17_Desc>일란성 쌍둥이의 수를 제한합니다.</Option17_Desc>
<Option18_Label>난자 오버레이</Option18_Label>
<Option18_Desc>자궁그림 위에 난자그림를 표시합니다.</Option18_Desc>
<Option19_Label_1>생리양</Option19_Label_1>
<Option19_Label_2>예상되는 총 생리양</Option19_Label_2>
<Option19_Desc>생리혈의 양을 설정합니다.&#10;실제 생리양은 보지에따라 다를수 있습니다.&#10;일반적인 인간 여성의 생리량은 약 20~80ml입니다.</Option19_Desc>
<Option20_Label_1>정착민</Option20_Label_1>
<Option20_Label_2>죄수</Option20_Label_2>
<Option20_Label_3>동맹관계</Option20_Label_3>
<Option20_Label_4>중립</Option20_Label_4>
<Option20_Label_5>적대관계</Option20_Label_5>
<Option21_Label>표시 대상</Option21_Label>
<Option21_Desc>아이콘과 버튼을 표시할 대상입니다.</Option21_Desc>
<FloatMenu_CleanSelf>질세척</FloatMenu_CleanSelf>

View file

@ -21,7 +21,7 @@
<lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>6</bleedingIntervalDays>
<recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>3</eggLifespanDays>
<eggLifespanDays>1</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<ovaryPower>420</ovaryPower>
@ -31,26 +31,6 @@
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="DragonVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>50</maxCumCapacity>
<baseImplantationChanceFactor>0.5</baseImplantationChanceFactor>
<basefertilizationChanceFactor>0.2</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>30</folicularIntervalDays>
<lutealIntervalDays>30</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>15</recoveryIntervalDays>
<eggLifespanDays>30</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GenericVagina"]</xpath>

View file

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- one cycle = folicularIntervalDays + lutealIntervalDays -->
<!-- folicularIntervalDays includes bleedingIntervalDays. -->
<!-- bleedingIntervalDays must be smaller than folicularIntervalDays -->
<!-- unit of maxCumCapacity is ml -->
<!-- actual max cum capacity is 500times of maxCumCapacity -->
<!-- one egg = 1 ovaryPower-->
<!-- the value for breeding season: Always, Spring, Summer, Fall, Winter, FirstHalf, SecondHalf -->
<!-- total estrus days = estrusDaysBeforeOvulation + eggLifespanDays -->
<Patch>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="DogVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>8</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>14</folicularIntervalDays>
<lutealIntervalDays>166</lutealIntervalDays>
<bleedingIntervalDays>8</bleedingIntervalDays>
<recoveryIntervalDays>15</recoveryIntervalDays>
<eggLifespanDays>4</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<estrusDaysBeforeOvulation>9</estrusDaysBeforeOvulation>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="CatVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>6</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>2.0</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>6</folicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>15</recoveryIntervalDays>
<eggLifespanDays>14</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<breedingSeason>FirstHalf</breedingSeason>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="HorseVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>25</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>7</folicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>30</recoveryIntervalDays>
<eggLifespanDays>1</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<breedingSeason>FirstHalf</breedingSeason>
<estrusDaysBeforeOvulation>5</estrusDaysBeforeOvulation>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="DragonVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>50</maxCumCapacity>
<baseImplantationChanceFactor>0.5</baseImplantationChanceFactor>
<basefertilizationChanceFactor>0.2</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>270</folicularIntervalDays>
<lutealIntervalDays>30</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>300</recoveryIntervalDays>
<eggLifespanDays>30</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<estrusDaysBeforeOvulation>0</estrusDaysBeforeOvulation>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NarrowVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>10</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>1.0</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>5</folicularIntervalDays>
<lutealIntervalDays>16</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>15</recoveryIntervalDays>
<eggLifespanDays>2</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<estrusDaysBeforeOvulation>1</estrusDaysBeforeOvulation>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="RodentVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Menstruation">
<maxCumCapacity>5</maxCumCapacity>
<baseImplantationChanceFactor>1.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>2.0</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>2</folicularIntervalDays>
<lutealIntervalDays>7</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>3</recoveryIntervalDays>
<eggLifespanDays>7</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<estrusDaysBeforeOvulation>1</estrusDaysBeforeOvulation>
</li>
</comps>
</value>
</Operation>
</Patch>

View file

@ -1,31 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
<Operation Class="PatchOperationAdd">
<Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Race's defName"]</xpath>
<value>
<modExtensions>
<li Class="RJW_Menstruation.PawnDNAModExtention">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath>
<cumColor>(255,255,255,255)</cumColor>
<cumThickness>0.2</cumThickness>
</li>
</modExtensions>
</value>
</Operation>
-->
<Patch>
<Operation Class="PatchOperationAdd">
<Operation Class="PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName="Human"]</xpath>
<value>
<modExtensions>
<li Class="RJW_Menstruation.PawnDNAModExtention">
<fetusTexPath>Fetus/Fetus_Default</fetusTexPath>
<cumColor>(255,255,255,255)</cumColor>
<cumThickness>0.2</cumThickness>
</li>
</modExtensions>
</value>
</Operation>

View file

@ -1,11 +1,20 @@
Version 1.0.1.11
- added a button for opening status window in health tab
- added option for this
- added option for select which pawn displays status
- fixed erros when pawn's anus missing
- added breedingSeason and estrusDaysBeforeOvulation attributes to CompProperties_Menstruation
- added patch for dog, cat, horse , narrow, rodent vagina
Version 1.0.1.10
- added option for adjusting bleeding amount
- added hotkey for opening status window
Version 1.0.1.9
- add estrus effects
- added estrus effects
- estrus increases pawn's sex drive greatly
- add consealedEstrus attribute to CompProperties_Menstruation
- added consealedEstrus attribute to CompProperties_Menstruation
- if consealedEstrus set as true, the pawn will get less effective estrus
- hyperfertility pills induce esturs
- now initial ovarypower is affected by pawn's life expectancy and litter size
Version 1.0.1.8
- fixed problems with animal status window
- fixed RMB menu crash

View file

@ -22,6 +22,8 @@ namespace RJW_Menstruation
public const float EnzygoticTwinsChanceDefault = 0.002f;
public const int EnzygoticTwinsChanceAdjustDefault = 2;
public const int MaxEnzygoticTwinsDefault = 9;
public const int BleedingAmountDefault = 50;
public static float ImplantationChance = ImplantationChanceDefault;
public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault;
@ -46,8 +48,9 @@ namespace RJW_Menstruation
public static float EnzygoticTwinsChance = EnzygoticTwinsChanceDefault;
public static int EnzygoticTwinsChanceAdjust = EnzygoticTwinsChanceAdjustDefault;
public static int MaxEnzygoticTwins = MaxEnzygoticTwinsDefault;
public static int BleedingAmount = BleedingAmountDefault;
public static bool EnableButtonInHT = false;
public static PawnFlags ShowFlag = PawnFlags.Colonist | PawnFlags.Prisoner;
public static bool HARActivated = false;
public static bool LLActivated = false;
@ -74,12 +77,21 @@ namespace RJW_Menstruation
return "Hide";
default:
return "";
}
}
[Flags]public enum PawnFlags
{
None = 0,
Colonist = 1,
Prisoner = 2,
Ally = 4,
Neutral = 8,
Hostile = 16
}
public override void ExposeData()
{
Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true);
@ -105,6 +117,9 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref EnzygoticTwinsChance, "EnzygoticTwinsChance", EnzygoticTwinsChance, true);
Scribe_Values.Look(ref EnzygoticTwinsChanceAdjust, "EnzygoticTwinsChanceAdjust", EnzygoticTwinsChanceAdjust, true);
Scribe_Values.Look(ref MaxEnzygoticTwins, "MaxEnzygoticTwins", MaxEnzygoticTwins, true);
Scribe_Values.Look(ref BleedingAmount, "BleedingAmount", BleedingAmount, true);
Scribe_Values.Look(ref EnableButtonInHT, "EnableButtonInHT", EnableButtonInHT, true);
Scribe_Values.Look(ref ShowFlag, "ShowFlag", ShowFlag, true);
base.ExposeData();
}
@ -119,6 +134,26 @@ namespace RJW_Menstruation
private static Vector2 scroll;
public static float EstimatedBleedingAmount
{
get
{
int days = VariousDefOf.VaginaCompProperties.bleedingIntervalDays;
return days * 0.03f * Configurations.BleedingAmount * 6;
}
}
public static float EstimatedBleedingAmountPerHour
{
get
{
int days = VariousDefOf.VaginaCompProperties.bleedingIntervalDays;
return 0.03f * Configurations.BleedingAmount * Configurations.CycleAcceleration;
}
}
public RJW_Menstruation(ModContentPack content) : base(content)
{
config = GetSettings<Configurations>();
@ -142,10 +177,13 @@ namespace RJW_Menstruation
listmain.BeginScrollView(outRect, ref scroll, ref mainRect);
listmain.Begin(mainRect);
listmain.Gap(20f);
listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc);
if (Configurations.EnableWombIcon)
Rect optionrect1 = listmain.GetRect(30f);
Widgets.CheckboxLabeled(optionrect1.LeftHalf(), Translations.Option1_Label_1, ref Configurations.EnableWombIcon);
Widgets.CheckboxLabeled(optionrect1.RightHalf(), Translations.Option1_Label_2, ref Configurations.EnableButtonInHT);
//listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc);
if (Configurations.EnableWombIcon || Configurations.EnableButtonInHT)
{
Listing_Standard wombsection = listmain.BeginSection_NewTemp(131);
Listing_Standard wombsection = listmain.BeginSection_NewTemp(186);
wombsection.CheckboxLabeled(Translations.Option9_Label, ref Configurations.DrawWombStatus, Translations.Option9_Desc);
if (Configurations.DrawWombStatus)
{
@ -172,6 +210,36 @@ namespace RJW_Menstruation
wombsection.Label(Translations.Option11_Desc_4);
break;
}
wombsection.Label(Translations.Option21_Label + " " + Configurations.ShowFlag,-1, Translations.Option21_Desc);
Rect flagrect = wombsection.GetRect(30f);
Rect[] flagrects = new Rect[5];
for (int i = 0; i < 5; i++)
{
flagrects[i] = new Rect(flagrect.x + (flagrect.width / 5) * i, flagrect.y, flagrect.width / 5, flagrect.height);
}
if (Widgets.ButtonText(flagrects[0], Translations.Option20_Label_1 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Colonist)))
{
Configurations.ShowFlag ^= Configurations.PawnFlags.Colonist;
}
if (Widgets.ButtonText(flagrects[1], Translations.Option20_Label_2 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Prisoner)))
{
Configurations.ShowFlag ^= Configurations.PawnFlags.Prisoner;
}
if (Widgets.ButtonText(flagrects[2], Translations.Option20_Label_3 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Ally)))
{
Configurations.ShowFlag ^= Configurations.PawnFlags.Ally;
}
if (Widgets.ButtonText(flagrects[3], Translations.Option20_Label_4 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Neutral)))
{
Configurations.ShowFlag ^= Configurations.PawnFlags.Neutral;
}
if (Widgets.ButtonText(flagrects[4], Translations.Option20_Label_5 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Hostile)))
{
Configurations.ShowFlag ^= Configurations.PawnFlags.Hostile;
}
listmain.EndSection(wombsection);
}
@ -198,6 +266,12 @@ namespace RJW_Menstruation
listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc);
Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration,1,50);
float var2 = EstimatedBleedingAmountPerHour;
float var1 = Math.Max(EstimatedBleedingAmount,var2);
listmain.LabelDouble(Translations.Option19_Label_1, Translations.Option19_Label_2 + ": " + var1 + "ml, " + var2 + "ml/h", Translations.Option19_Desc);
Configurations.BleedingAmount = (int)listmain.Slider(Configurations.BleedingAmount, 0, 200);
listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc);
if (Configurations.UseMultiplePregnancy)
{
@ -215,10 +289,10 @@ namespace RJW_Menstruation
twinsection.Label(Translations.Option17_Label + " " + Configurations.MaxEnzygoticTwins, -1, Translations.Option17_Desc);
Configurations.MaxEnzygoticTwins = (int)twinsection.Slider(Configurations.MaxEnzygoticTwins, 2, 100);
}
listmain.EndSection(twinsection);
}
listmain.EndScrollView(ref mainRect);
listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc);
@ -236,6 +310,7 @@ namespace RJW_Menstruation
Configurations.EnableHeteroOvularTwins = true;
Configurations.UseMultiplePregnancy = true;
Configurations.MaxEnzygoticTwins = Configurations.MaxEnzygoticTwinsDefault;
Configurations.BleedingAmount = Configurations.BleedingAmountDefault;
}
listmain.End();

View file

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using Verse.Sound;
using RimWorld;
using rjw;
@ -12,7 +13,7 @@ namespace RJW_Menstruation
{
public class Dialog_WombStatus : Window
{
private Pawn pawn;
public Pawn pawn;
private HediffComp_Menstruation comp;
private const float windowMargin = 20f;
private const float pawnRectWidth = 150f;
@ -50,13 +51,39 @@ namespace RJW_Menstruation
}
}
public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp, Texture2D icon)
public Dialog_WombStatus(Pawn pawn, HediffComp_Menstruation comp)
{
this.pawn = pawn;
this.comp = comp;
womb = icon;
}
public void ChangePawn(Pawn pawn, HediffComp_Menstruation comp)
{
this.pawn = pawn;
this.comp = comp;
}
public static void ToggleWindow(Pawn pawn, HediffComp_Menstruation comp)
{
Dialog_WombStatus window = (Dialog_WombStatus)Find.WindowStack.Windows.FirstOrDefault(x => x.GetType().Equals(typeof(Dialog_WombStatus)));
if (window != null)
{
if (window.pawn != pawn)
{
SoundDefOf.TabOpen.PlayOneShotOnCamera();
window.ChangePawn(pawn, comp);
}
else Find.WindowStack.TryRemove(typeof(Dialog_WombStatus), true);
}
else
{
SoundDefOf.InfoCard_Open.PlayOneShotOnCamera();
Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp));
}
}
public override void DoWindowContents(Rect inRect)
{
bool flag = false;

View file

@ -11,6 +11,18 @@ using UnityEngine;
namespace RJW_Menstruation
{
[Flags]public enum SeasonalBreed
{
Always = 0,
Spring = 1,
Summer = 2,
Fall = 4,
Winter = 8,
FirstHalf = Spring | Summer,
SecondHalf = Fall | Winter
}
public class CompProperties_Menstruation : HediffCompProperties
{
public float maxCumCapacity; // ml
@ -27,6 +39,8 @@ namespace RJW_Menstruation
public bool infertile = false;
public int ovaryPower = 600000000; // default: almost unlimited ovulation
public bool consealedEstrus = false;
public SeasonalBreed breedingSeason = SeasonalBreed.Always;
public int estrusDaysBeforeOvulation = 3;
public CompProperties_Menstruation()
{
@ -81,6 +95,7 @@ namespace RJW_Menstruation
ClimactericFollicular,
ClimactericLuteal,
ClimactericBleeding,
Anestrus
}
private List<Cum> cums;
@ -252,6 +267,8 @@ namespace RJW_Menstruation
return Translations.Stage_Luteal + " - " + Translations.Stage_Climacteric;
case Stage.ClimactericBleeding:
return Translations.Stage_Bleeding + " - " + Translations.Stage_Climacteric;
case Stage.Anestrus:
return Translations.Stage_Anestrus;
default:
return "";
}
@ -1061,7 +1078,7 @@ namespace RJW_Menstruation
private void BleedOut()
{
//FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, ThingDefOf.Filth_Blood,parent.pawn.Label);
CumIn(parent.pawn, Rand.Range(1f, 2f), Translations.Menstrual_Blood,-5.0f,ThingDefOf.Filth_Blood);
CumIn(parent.pawn, Rand.Range(0.02f * Configurations.BleedingAmount, 0.04f * Configurations.BleedingAmount), Translations.Menstrual_Blood,-5.0f,ThingDefOf.Filth_Blood);
GetNotCum(Translations.Menstrual_Blood).color = BloodColor;
}
@ -1137,7 +1154,6 @@ namespace RJW_Menstruation
if (egg.lifespanhrs < 0) deadeggs.Add(egg);
if (egg.fertilized) egg.fertstage += Configurations.CycleAcceleration;
}
if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
@ -1157,6 +1173,29 @@ namespace RJW_Menstruation
case Stage.Follicular:
action = delegate
{
if (Props.breedingSeason != SeasonalBreed.Always)
{
if (!Props.breedingSeason.HasFlag(SeasonalBreed.Spring) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Spring))
{
GoNextStage(Stage.Anestrus);
return;
}
else if (!Props.breedingSeason.HasFlag(SeasonalBreed.Summer) && (GenLocalDate.Season(parent.pawn.Map).Equals(Season.Summer) || GenLocalDate.Season(parent.pawn.Map).Equals(Season.PermanentSummer)))
{
GoNextStage(Stage.Anestrus);
return;
}
else if (!Props.breedingSeason.HasFlag(SeasonalBreed.Fall) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Fall))
{
GoNextStage(Stage.Anestrus);
return;
}
else if (!Props.breedingSeason.HasFlag(SeasonalBreed.Winter) && (GenLocalDate.Season(parent.pawn.Map).Equals(Season.Winter) || GenLocalDate.Season(parent.pawn.Map).Equals(Season.PermanentWinter)))
{
GoNextStage(Stage.Anestrus);
return;
}
}
if (curStageHrs >= FollicularIntervalHours)
{
GoNextStage(Stage.Ovulatory);
@ -1164,10 +1203,10 @@ namespace RJW_Menstruation
else
{
curStageHrs+=Configurations.CycleAcceleration;
if (!estrusflag && curStageHrs > FollicularIntervalHours - 72)
if (!estrusflag && curStageHrs > FollicularIntervalHours - Props.estrusDaysBeforeOvulation*24)
{
estrusflag = true;
SetEstrus(Props.eggLifespanDays + 3);
SetEstrus(Props.eggLifespanDays + Props.estrusDaysBeforeOvulation);
}
StayCurrentStage();
}
@ -1428,7 +1467,37 @@ namespace RJW_Menstruation
}
};
break;
case Stage.Anestrus:
action = delegate
{
if (Props.breedingSeason == SeasonalBreed.Always)
{
//case for XML changes
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else if (Props.breedingSeason.HasFlag(SeasonalBreed.Spring) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Spring))
{
GoFollicularOrBleeding();
}
else if (Props.breedingSeason.HasFlag(SeasonalBreed.Summer) && (GenLocalDate.Season(parent.pawn.Map).Equals(Season.Summer) || GenLocalDate.Season(parent.pawn.Map).Equals(Season.PermanentSummer)))
{
GoFollicularOrBleeding();
}
else if (Props.breedingSeason.HasFlag(SeasonalBreed.Fall) && GenLocalDate.Season(parent.pawn.Map).Equals(Season.Fall))
{
GoFollicularOrBleeding();
}
else if (Props.breedingSeason.HasFlag(SeasonalBreed.Winter) && (GenLocalDate.Season(parent.pawn.Map).Equals(Season.Winter) || GenLocalDate.Season(parent.pawn.Map).Equals(Season.PermanentWinter)))
{
GoFollicularOrBleeding();
}
else
{
StayCurrentStage();
}
};
break;
default:
curStage = Stage.Follicular;
curStageHrs = 0;
@ -1473,6 +1542,20 @@ namespace RJW_Menstruation
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curstage), (int)(tickInterval * factor), parent.pawn, false);
}
void GoFollicularOrBleeding()
{
if (Props.bleedingIntervalDays == 0)
{
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Follicular);
}
else
{
bleedingIntervalhours = PeriodRandomizer(bleedingIntervalhours, Props.deviationFactor);
GoNextStage(Stage.Bleeding);
}
}
}

View file

@ -18,9 +18,8 @@ namespace RJW_Menstruation
public static void Postfix(ref IEnumerable<Gizmo> __result, Pawn __instance)
{
List<Gizmo> gizmoList = __result.ToList();
bool isCreatureMine = __instance.Faction != null && (__instance.Faction.IsPlayer || __instance.IsPrisonerOfColony);
if (!isCreatureMine)
if (!__instance.ShowStatus())
{
return;
}
@ -49,12 +48,6 @@ namespace RJW_Menstruation
HediffComp_Menstruation comp = __instance.GetMenstruationComp();
if (comp != null) gizmoList.Add(CreateGizmo_WombStatus(__instance, comp));
//If should i have to add multiple vagina support.
//foreach (HediffComp comp in __instance.health.hediffSet.GetAllComps())
//{
// if (comp is HediffComp_Menstruation) gizmoList.Add(CreateGizmo_WombStatus(__instance, (HediffComp_Menstruation)comp));
//}
}
private static Gizmo CreateGizmo_WombStatus(Pawn pawn , HediffComp_Menstruation comp)
@ -101,10 +94,10 @@ namespace RJW_Menstruation
cumcolor = c,
comp = comp,
order = 100,
hotKey = VariousDefOf.OpenStatusWindowKey,
action = delegate
{
SoundDefOf.InfoCard_Open.PlayOneShotOnCamera();
Find.WindowStack.Add(new Dialog_WombStatus(pawn, comp,icon));
Dialog_WombStatus.ToggleWindow(pawn, comp);
}
};
return gizmo;

View file

@ -19,7 +19,7 @@ namespace RJW_Menstruation
public static void Postfix(Map map, bool respawningAfterLoad, Pawn __instance)
{
//Log.Message("Initialize on spawnsetup");
HediffComp_Menstruation comp = Utility.GetMenstruationComp(__instance);
HediffComp_Menstruation comp = __instance.GetMenstruationComp();
if (comp != null)
{
HugsLibController.Instance.TickDelayScheduler.TryUnscheduleCallback(comp.actionref);
@ -60,6 +60,53 @@ namespace RJW_Menstruation
}
//[HarmonyPatch(typeof(HealthCardUtility), "DrawHediffListing")]
//public class DrawHediffListing_Patch
//{
// public const float buttonWidth = 80f;
// public const float buttonHeight = 20f;
//
// public static void Postfix(Rect rect, Pawn pawn, bool showBloodLoss)
// {
// if (Configurations.EnableButtonInHT && pawn.HasMenstruationComp())
// {
// Rect buttonrect = new Rect(rect.xMax - buttonWidth, rect.yMax - buttonHeight, buttonWidth, buttonHeight);
// if (Widgets.ButtonText(buttonrect, "Status"))
// {
// Dialog_WombStatus.ToggleWindow(pawn,pawn.GetMenstruationComp());
// }
// }
//
//
// }
//}
[HarmonyPatch(typeof(HealthCardUtility), "DrawHediffRow")]
public class DrawHediffRow_Patch
{
public const float buttonWidth = 50f;
public const float buttonHeight = 20f;
public static void Prefix(Rect rect, Pawn pawn, IEnumerable<Hediff> diffs, ref float curY)
{
if (Configurations.EnableButtonInHT && pawn.ShowStatus())
{
HediffComp_Menstruation comp = diffs.First().GetMenstruationComp();
if (comp != null)
{
Rect buttonrect = new Rect((rect.xMax) / 2 - 5f, curY + 2f, buttonWidth, buttonHeight);
if (Widgets.ButtonText(buttonrect, Translations.Button_HealthTab))
{
Dialog_WombStatus.ToggleWindow(pawn, comp);
}
}
}
}
}
//[HarmonyPatch(typeof(JobGiver_OptimizeApparel), "ApparelScoreGain_NewTmp")]
//public class OptimizeApparel_Patch
//{

View file

@ -16,6 +16,8 @@ namespace RJW_Menstruation
public static readonly string Stage_Recover = "Stage_Recover".Translate();
public static readonly string Stage_None = "Stage_None".Translate();
public static readonly string Stage_Climacteric = "Stage_Climacteric".Translate();
public static readonly string Stage_Anestrus = "Stage_Anestrus".Translate();
public static readonly string Button_HealthTab = "Button_HealthTab".Translate();
public static readonly string Dialog_WombInfo01 = "Dialog_WombInfo01".Translate();
public static readonly string Dialog_WombInfo02 = "Dialog_WombInfo02".Translate();
@ -29,8 +31,8 @@ namespace RJW_Menstruation
public static readonly string Dialog_WombInfo10 = "Dialog_WombInfo10".Translate();
public static readonly string Option1_Label = "Option1_Label".Translate();
public static readonly string Option1_Desc = "Option1_Desc".Translate();
public static readonly string Option1_Label_1 = "Option1_Label_1".Translate();
public static readonly string Option1_Label_2 = "Option1_Label_2".Translate();
public static readonly string Option2_Label = "Option2_Label".Translate();
public static readonly string Option2_Desc = "Option2_Desc".Translate();
public static readonly string Option3_Label = "Option3_Label".Translate();
@ -68,6 +70,16 @@ namespace RJW_Menstruation
public static readonly string Option17_Desc = "Option17_Desc".Translate();
public static readonly string Option18_Label = "Option18_Label".Translate();
public static readonly string Option18_Desc = "Option18_Desc".Translate();
public static readonly string Option19_Label_1 = "Option19_Label_1".Translate();
public static readonly string Option19_Label_2 = "Option19_Label_2".Translate();
public static readonly string Option19_Desc = "Option19_Desc".Translate();
public static readonly string Option20_Label_1 = "Option20_Label_1".Translate();
public static readonly string Option20_Label_2 = "Option20_Label_2".Translate();
public static readonly string Option20_Label_3 = "Option20_Label_3".Translate();
public static readonly string Option20_Label_4 = "Option20_Label_4".Translate();
public static readonly string Option20_Label_5 = "Option20_Label_5".Translate();
public static readonly string Option21_Label = "Option21_Label".Translate();
public static readonly string Option21_Desc = "Option21_Desc".Translate();
public static readonly string FloatMenu_CleanSelf = "FloatMenu_CleanSelf".Translate();

View file

@ -86,6 +86,15 @@ namespace RJW_Menstruation
return null;
}
public static HediffComp_Menstruation GetMenstruationComp(this Hediff hediff)
{
if (hediff is Hediff_PartBaseNatural || hediff is Hediff_PartBaseArtifical)
{
return hediff.TryGetComp<HediffComp_Menstruation>();
}
return null;
}
public static bool HasMenstruationComp(this Pawn pawn)
{
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn))?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
@ -102,6 +111,16 @@ namespace RJW_Menstruation
return false;
}
public static bool HasMenstruationComp(this Hediff hediff)
{
if (hediff is Hediff_PartBaseNatural || hediff is Hediff_PartBaseArtifical)
{
if (hediff.TryGetComp<HediffComp_Menstruation>() != null) return true;
}
return false;
}
public static HediffComp_Menstruation.Stage GetCurStage(this Pawn pawn)
{
return GetMenstruationComp(pawn)?.curStage ?? HediffComp_Menstruation.Stage.Bleeding;
@ -237,19 +256,26 @@ namespace RJW_Menstruation
public static Texture2D GetAnalIcon(this Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus"));
CompProperties_Anus Props = (CompProperties_Anus)hediff.TryGetComp<HediffComp_Anus>().props;
string icon;
if (Props != null) icon = Props.analTex ?? "Genitals/Anal";
else icon = "Genitals/Anal";
if (hediff.Severity < 0.20f) icon += "00"; //micro
else if (hediff.Severity < 0.40f) icon += "01"; //tight
else if (hediff.Severity < 0.60f) icon += "02"; //average
else if (hediff.Severity < 0.80f) icon += "03"; //accomodating
else if (hediff.Severity < 1.01f) icon += "04"; //cavernous
else icon += "05"; //abyssal
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("anus"));
if (hediff != null)
{
CompProperties_Anus Props = (CompProperties_Anus)hediff.TryGetComp<HediffComp_Anus>().props;
string icon;
if (Props != null) icon = Props.analTex ?? "Genitals/Anal";
else icon = "Genitals/Anal";
if (hediff.Severity < 0.20f) icon += "00"; //micro
else if (hediff.Severity < 0.40f) icon += "01"; //tight
else if (hediff.Severity < 0.60f) icon += "02"; //average
else if (hediff.Severity < 0.80f) icon += "03"; //accomodating
else if (hediff.Severity < 1.01f) icon += "04"; //cavernous
else icon += "05"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
return ContentFinder<Texture2D>.Get((icon), true);
}
else
{
return ContentFinder<Texture2D>.Get(("Genitals/Anal00"), true);
}
}
public static string GetVaginaLabel(this Pawn pawn)
@ -259,8 +285,9 @@ namespace RJW_Menstruation
}
public static string GetAnusLabel(this Pawn pawn)
{
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).Find((Hediff h) => h.def.defName.ToLower().Contains("anus"));
return hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")";
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("anus"));
if (hediff != null) return hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")";
else return "";
}
public static bool ShowFetusImage(this Hediff_BasePregnancy hediff)
@ -277,6 +304,34 @@ namespace RJW_Menstruation
else return false;
}
public static bool ShowStatus(this Pawn pawn)
{
if (pawn.Faction != null && Configurations.ShowFlag != Configurations.PawnFlags.None)
{
if (pawn.Faction.IsPlayer)
{
if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Colonist)) return true;
}
else if (pawn.IsPrisonerOfColony)
{
if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Prisoner)) return true;
}
else if (pawn.Faction.PlayerRelationKind == FactionRelationKind.Ally)
{
if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Ally)) return true;
}
else if (pawn.Faction.PlayerRelationKind == FactionRelationKind.Hostile)
{
if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Hostile)) return true;
}
else if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Neutral)) return true;
else return false;
}
else if (Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Neutral)) return true;
return false;
}
public static Pawn GetFather(Pawn pawn, Pawn mother)
{
Pawn res = pawn.GetFather();

View file

@ -37,9 +37,9 @@ namespace RJW_Menstruation
public static readonly ThoughtDef CameInsideM = DefDatabase<ThoughtDef>.GetNamed("CameInsideM");
public static readonly ThoughtDef HaterCameInsideM = DefDatabase<ThoughtDef>.GetNamed("HaterCameInsideM");
public static readonly ThoughtDef UnwantedPregnancy = DefDatabase<ThoughtDef>.GetNamed("UnwantedPregnancy");
public static readonly HediffDef_PartBase Vagina = DefDatabase<HediffDef_PartBase>.GetNamed("Vagina");
public static readonly CompProperties_Menstruation VaginaCompProperties = (CompProperties_Menstruation)Vagina.comps.FirstOrDefault(x => x is CompProperties_Menstruation);
public static readonly KeyBindingDef OpenStatusWindowKey = DefDatabase<KeyBindingDef>.GetNamed("OpenStatusWindow");
// Defs from Licentia Labs
public static readonly HediffDef Cumflation = DefDatabase<HediffDef>.GetNamedSilentFail("Cumflation");