This commit is contained in:
moreoreganostodump 2021-08-07 02:26:13 +09:00
parent 595ad1318c
commit 1851627615
19 changed files with 179 additions and 33 deletions

Binary file not shown.

View File

@ -92,7 +92,14 @@
<Option28_Tooltip>Open custom hybrid editor.&#10;This will overrides hybrid definitions of XML files.</Option28_Tooltip>
<Option29_Label>Allow shrink icon</Option29_Label>
<Option29_Desc>Let icon become smaller If needed.</Option29_Desc>
<EstimatedCumLifespan>estimated sperm lifespan</EstimatedCumLifespan>
<Option30_Label>Egg lifespan multiplier</Option30_Label>
<Option30_Desc>Multiply egg's lifespan.&#10;Eggs will die at end of luteal stage regardless of this setting.</Option30_Desc>
<Option31_Label>Enable vagina morph after birth</Option31_Label>
<Option31_Desc>Enable permanent vagina stretch after birth.&#10;If you are using another mod handling this, turn off this option.</Option31_Desc>
<Option32_Label>Morph power</Option32_Label>
<Option32_Desc>Set morph power.</Option32_Desc>
<EstimatedCumLifespan>Estimated sperm lifespan</EstimatedCumLifespan>
<EstimatedEggLifespan>Estimated egg lifespan</EstimatedEggLifespan>
<FertilityDesc>Chance of fertilization within an hour: {0}%&#10;The chance of pregnancy of fertilized egg.&#10;The white overlay is indicates fertilization chance of sperms in womb.</FertilityDesc>
<FloatMenu_CleanSelf>Vaginal washing</FloatMenu_CleanSelf>

View File

@ -92,7 +92,14 @@
<Option28_Tooltip>사용자 지정 잡종 편집기를 엽니다.&#10;이 설정은 XML파일의 잡종 정의를 대체합니다.</Option28_Tooltip>
<Option29_Label>아이콘 축소 허용</Option29_Label>
<Option29_Desc>아이콘 축소를 허용합니다.</Option29_Desc>
<Option30_Label>난자 수명 배수</Option30_Label>
<Option30_Desc>난자 수명을 늘립니다.&#10;이 설정에 관계없이 황체기가 끝나면 난자는 죽습니다.</Option30_Desc>
<Option31_Label>출산 이후 보지 변화 활성화</Option31_Label>
<Option31_Desc>출산 이후 보지가 영구적으로 늘어나게 합니다.&#10;만약 이 설정을 다루고있는 다른 모드가 있다면, 이 설정을 끄세요.</Option31_Desc>
<Option32_Label>변화 강도</Option32_Label>
<Option32_Desc>변화 강도를 설정합니다.</Option32_Desc>
<EstimatedCumLifespan>정자 예상수명</EstimatedCumLifespan>
<EstimatedEggLifespan>난자 예상수명</EstimatedEggLifespan>
<FertilityDesc>한시간 안에 수정될 확률: {0}%&#10;수정란이 임신으로 진행될 확률입니다.&#10;흰색 오버레이는 정자가 난자를 수정시킬 확률을 표시하는 것입니다.</FertilityDesc>
<FloatMenu_CleanSelf>질세척</FloatMenu_CleanSelf>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -24,6 +24,8 @@ namespace RJW_Menstruation
public const float NipplePermanentTransitionVarianceDefault = 0.02f;
public const float NippleMaximumTransitionDefault = 0.4f;
public const float NippleTransitionSpeedDefault = 0.035f;
public const float EggLifespanMultiplierDefault = 1.0f;
public const float VaginaMorphPowerDefault = 0.2f;
public static float ImplantationChance = ImplantationChanceDefault;
public static int ImplantationChanceAdjust = ImplantationChanceAdjustDefault;
@ -54,6 +56,9 @@ namespace RJW_Menstruation
public static bool UseHybridExtention = true;
public static bool MotherFirst = false;
public static bool AllowShrinkIcon = false;
public static float EggLifespanMultiplier = EggLifespanMultiplierDefault;
public static bool EnableBirthVaginaMorph = false;
public static float VaginaMorphPower = VaginaMorphPowerDefault;
public static float NippleTransitionVariance = NippleTransitionVarianceDefault;
public static float NipplePermanentTransitionVariance = NipplePermanentTransitionVarianceDefault;
@ -67,6 +72,29 @@ namespace RJW_Menstruation
}
}
public static void SettoDefault()
{
ImplantationChanceAdjust = ImplantationChanceAdjustDefault;
FertilizeChanceAdjust = FertilizeChanceAdjustDefault;
CumDecayRatioAdjust = CumDecayRatioAdjustDefault;
CumFertilityDecayRatioAdjust = CumFertilityDecayRatioAdjustDefault;
EnableWombIcon = true;
EnableAnimalCycle = false;
CycleAcceleration = CycleAccelerationDefault;
EnzygoticTwinsChanceAdjust = EnzygoticTwinsChanceAdjustDefault;
EnableEnzygoticTwins = true;
EnableHeteroOvularTwins = true;
UseMultiplePregnancy = true;
MaxEnzygoticTwins = MaxEnzygoticTwinsDefault;
BleedingAmount = BleedingAmountDefault;
MotherFirst = false;
NippleTransitionVariance = NippleTransitionVarianceDefault;
NipplePermanentTransitionVariance = NipplePermanentTransitionVarianceDefault;
NippleMaximumTransition = NippleMaximumTransitionDefault;
NippleTransitionSpeed = NippleTransitionSpeedDefault;
EggLifespanMultiplier = EggLifespanMultiplierDefault;
VaginaMorphPower = VaginaMorphPowerDefault;
}
public static List<HybridInformations> HybridOverride = new List<HybridInformations>();
@ -173,6 +201,9 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref NippleMaximumTransition, "NippleMaximumTransition", NippleMaximumTransition, true);
Scribe_Values.Look(ref NippleTransitionSpeed, "NippleTransitionSpeed", NippleTransitionSpeed, true);
Scribe_Values.Look(ref AllowShrinkIcon, "AllowShrinkIcon", AllowShrinkIcon, true);
Scribe_Values.Look(ref EggLifespanMultiplier, "EggLifespanMultiplier", EggLifespanMultiplier, true);
Scribe_Values.Look(ref EnableBirthVaginaMorph, "EnableBirthVaginaMorph", EnableBirthVaginaMorph, true);
Scribe_Values.Look(ref VaginaMorphPower, "VaginaMorphPower", VaginaMorphPower, true);
Scribe_Collections.Look(ref HybridOverride, saveDestroyedThings: true, label: "HybridOverride", lookMode: LookMode.Deep, ctorArgs: new object[0]);
base.ExposeData();
}
@ -226,8 +257,8 @@ namespace RJW_Menstruation
public override void DoSettingsWindowContents(Rect inRect)
{
Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f);
Rect mainRect = new Rect(0f, 0f, inRect.width - 30f, inRect.height + 480f);
Rect mainRect = new Rect(0f, 0f, inRect.width - 30f, inRect.height + 596f);
int Adjust;
Listing_Standard listmain = new Listing_Standard();
listmain.maxOneColumn = true;
Widgets.BeginScrollView(outRect, ref scroll, mainRect);
@ -297,7 +328,7 @@ namespace RJW_Menstruation
Configurations.ShowFlag ^= Configurations.PawnFlags.Hostile;
}
int Adjust = (int)(Configurations.NippleTransitionVariance * 1000);
Adjust = (int)(Configurations.NippleTransitionVariance * 1000);
wombsection.Label(Translations.Option24_Label + " " + Configurations.NippleTransitionVariance* 100 + " / 100", -1,Translations.Option24_Desc);
Adjust = (int)wombsection.Slider(Adjust,0,1000);
Configurations.NippleTransitionVariance = (float)Adjust / 1000;
@ -336,6 +367,14 @@ namespace RJW_Menstruation
Configurations.CumDecayRatioAdjust = (int)listmain.Slider(Configurations.CumDecayRatioAdjust, 0, 1000);
Configurations.CumDecayRatio = (float)Configurations.CumDecayRatioAdjust / 1000;
Adjust = (int)(Configurations.EggLifespanMultiplier * 20);
float lifespan = (24f / Configurations.CycleAcceleration * Configurations.EggLifespanMultiplier);
listmain.LabelDouble(Translations.Option30_Label + " x" + Configurations.EggLifespanMultiplier, Translations.EstimatedEggLifespan + String.Format(": {0:0}h {1:0}h {2:0}h", (int)lifespan, (int)(lifespan * 2), (int)(lifespan * 3)), Translations.Option30_Desc);
Adjust = (int)listmain.Slider(Adjust, 20, 1000);
Configurations.EggLifespanMultiplier = (float)Adjust / 20;
int semenlifespan = (int)(-5 / ((float)Math.Log10((1 - Configurations.CumFertilityDecayRatio)*10) - 1)) + 1;
string estimatedlifespan;
if (semenlifespan < 0)
@ -388,30 +427,28 @@ namespace RJW_Menstruation
listmain.EndSection(twinsection);
}
listmain.CheckboxLabeled(Translations.Option31_Label, ref Configurations.EnableBirthVaginaMorph, Translations.Option31_Desc);
if (Configurations.EnableBirthVaginaMorph)
{
float sectionheight = 48f;
Listing_Standard vmsection = listmain.BeginSection(sectionheight);
LabelwithTextfield(vmsection.GetRect(24f), Translations.Option32_Label, Translations.Option32_Desc, ref Configurations.VaginaMorphPower, 0, 100f);
Adjust = (int)(Configurations.VaginaMorphPower * 1000);
Adjust = (int)vmsection.Slider(Adjust, 0, 1000);
Configurations.VaginaMorphPower = Adjust / 1000f;
listmain.EndSection(vmsection);
}
Widgets.EndScrollView();
listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc);
if (listmain.ButtonText("reset to default"))
{
Configurations.ImplantationChanceAdjust = Configurations.ImplantationChanceAdjustDefault;
Configurations.FertilizeChanceAdjust = Configurations.FertilizeChanceAdjustDefault;
Configurations.CumDecayRatioAdjust = Configurations.CumDecayRatioAdjustDefault;
Configurations.CumFertilityDecayRatioAdjust = Configurations.CumFertilityDecayRatioAdjustDefault;
Configurations.EnableWombIcon = true;
Configurations.EnableAnimalCycle = false;
Configurations.CycleAcceleration = Configurations.CycleAccelerationDefault;
Configurations.EnzygoticTwinsChanceAdjust = Configurations.EnzygoticTwinsChanceAdjustDefault;
Configurations.EnableEnzygoticTwins = true;
Configurations.EnableHeteroOvularTwins = true;
Configurations.UseMultiplePregnancy = true;
Configurations.MaxEnzygoticTwins = Configurations.MaxEnzygoticTwinsDefault;
Configurations.BleedingAmount = Configurations.BleedingAmountDefault;
Configurations.MotherFirst = false;
Configurations.NippleTransitionVariance = Configurations.NippleTransitionVarianceDefault;
Configurations.NipplePermanentTransitionVariance = Configurations.NipplePermanentTransitionVarianceDefault;
Configurations.NippleMaximumTransition = Configurations.NippleMaximumTransitionDefault;
Configurations.NippleTransitionSpeed = Configurations.NippleTransitionSpeedDefault;
Configurations.SettoDefault();
}
@ -421,6 +458,17 @@ namespace RJW_Menstruation
}
public void LabelwithTextfield(Rect rect, string label, string tooltip, ref float value, float min, float max)
{
Rect textfieldRect = new Rect(rect.xMax - 100f, rect.y, 100f, rect.height);
string valuestr = value.ToString();
Widgets.Label(rect, label);
Widgets.TextFieldNumeric(textfieldRect, ref value, ref valuestr, min, max);
Widgets.DrawHighlightIfMouseover(rect);
TooltipHandler.TipRegion(rect, tooltip);
}
}

View File

@ -834,10 +834,21 @@ namespace RJW_Menstruation
{
avglittersize = 1;
}
ovarypower = (int)(((Props.ovaryPower * Utility.RandGaussianLike(0.70f, 1.30f) * parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy)
- (Math.Max(0, ageYear - RJWSettings.sex_minimum_age * parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy))
* (60 / (Props.folicularIntervalDays + Props.lutealIntervalDays) * Configurations.CycleAcceleration)) * avglittersize);
//Old one. Sex minimum age based.
//ovarypower = (int)(((Props.ovaryPower * Utility.RandGaussianLike(0.70f, 1.30f) * parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy)
// - (Math.Max(0, ageYear - RJWSettings.sex_minimum_age * parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy))
// * (60 / (Props.folicularIntervalDays + Props.lutealIntervalDays) * Configurations.CycleAcceleration)) * avglittersize);
//New one.
float fertendage, lifenormalized;
if (parent.pawn.IsAnimal()) fertendage = RJWPregnancySettings.fertility_endage_female_animal * 100f;
else fertendage = RJWPregnancySettings.fertility_endage_female_humanlike * 80f;
lifenormalized = parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy;
fertendage *= lifenormalized;
ovarypower = (int)((fertendage - parent.pawn.ageTracker.AgeBiologicalYearsFloat) * (60f / (Props.folicularIntervalDays + Props.lutealIntervalDays) * Configurations.CycleAcceleration) * avglittersize);
ovarypower = (int)Mathf.Max(0, Mathf.Min(Props.ovaryPower * Utility.RandGaussianLike(0.70f,1.30f) * lifenormalized,ovarypower));
if (ovarypower < 1)
{
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn);
@ -1626,7 +1637,7 @@ namespace RJW_Menstruation
public Egg()
{
fertilized = false;
lifespanhrs = 96;
lifespanhrs = (int)(96 * Configurations.EggLifespanMultiplier);
fertilizer = null;
position = 0;
}
@ -1634,7 +1645,7 @@ namespace RJW_Menstruation
public Egg(int lifespanhrs)
{
fertilized = false;
this.lifespanhrs = lifespanhrs;
this.lifespanhrs = (int)(lifespanhrs * Configurations.EggLifespanMultiplier);
fertilizer = null;
position = 0;
}

View File

@ -245,7 +245,10 @@ namespace RJW_Menstruation
relationWithExtraPawnChanceFactor: 0,
fixedMelanin: melanin,
fixedLastName: lastname,
kind: BabyPawnKindDecider(mother, father)
kind: BabyPawnKindDecider(mother, father),
fixedIdeo: mother.Ideo,
forbidAnyTitle: true,
forceNoBackstory:true
);
int division = 1;

View File

@ -1,7 +1,7 @@
using HarmonyLib;
using rjw;
using Verse;
using UnityEngine;
namespace RJW_Menstruation
{
@ -107,9 +107,44 @@ namespace RJW_Menstruation
}
}
[HarmonyPatch(typeof(JobDriver_Sex), "Orgasm")]
public static class Orgasm_Patch
{
public static void Postfix(JobDriver_Sex __instance, int ___sex_ticks, int ___orgasmstick, Pawn ___pawn, xxx.rjwSextype ___sexType, bool ___usedCondom)
{
if (___sex_ticks - 1 > ___orgasmstick) //~3s at speed 1
{
return;
}
if (___pawn.jobs?.curDriver is JobDriver_SexBaseInitiator)
{
if (___sexType == xxx.rjwSextype.Vaginal && !___usedCondom)
{
if (!___pawn.Dead && !__instance.Partner.Dead)
{
PregnancyHelper.impregnate(___pawn, __instance.Partner, ___sexType);
}
}
}
}
}
[HarmonyPatch(typeof(Hediff_BasePregnancy), "PostBirth")]
public static class RJW_Patch_PostBirth
{
public static void Postfix(Pawn mother, Pawn father, Pawn baby)
{
if (Configurations.EnableBirthVaginaMorph)
{
Hediff vagina = mother.health.hediffSet.hediffs.FirstOrFallback(x => x.def.defName.ToLower().Contains("vagina"));
float morph = Mathf.Max(baby.BodySize - Mathf.Pow(vagina.Severity * mother.BodySize,2), 0f);
vagina.Severity += morph * Configurations.VaginaMorphPower;
}
}
}

View File

@ -51,6 +51,9 @@
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>

View File

@ -98,8 +98,15 @@ namespace RJW_Menstruation
public static readonly string Option28_Tooltip = "Option28_Tooltip".Translate();
public static readonly string Option29_Label = "Option29_Label".Translate();
public static readonly string Option29_Desc = "Option29_Desc".Translate();
public static readonly string Option30_Label = "Option30_Label".Translate();
public static readonly string Option30_Desc = "Option30_Desc".Translate();
public static readonly string Option31_Label = "Option31_Label".Translate();
public static readonly string Option31_Desc = "Option31_Desc".Translate();
public static readonly string Option32_Label = "Option32_Label".Translate();
public static readonly string Option32_Desc = "Option32_Desc".Translate();
public static readonly string EstimatedCumLifespan = "EstimatedCumLifespan".Translate();
public static readonly string EstimatedEggLifespan = "EstimatedEggLifespan".Translate();
public static string FertilityDesc(string value) => "FertilityDesc".Translate(value);
public static readonly string FloatMenu_CleanSelf = "FloatMenu_CleanSelf".Translate();

View File

@ -343,7 +343,7 @@ namespace RJW_Menstruation
GUI.Box(rect, "", boxstyle);
pawn.DrawBreastIcon(BreastIconRect);
GUI.color = Color.white;
GUI.Label(BreastLabelRect, pawn.GetBreastLabel(), fontstylecenter);

View File

@ -237,7 +237,20 @@ namespace RJW_Menstruation
HediffComp_Breast comp = hediff.TryGetComp<HediffComp_Breast>();
string icon;
if (comp != null) icon = comp.Props.BreastTex ?? "Breasts/Breast_Breast";
else icon = "Breasts/Breast_Breast";
else
{
breast = ContentFinder<Texture2D>.Get("Breasts/Breast_Breast00", false);
nipple = ContentFinder<Texture2D>.Get("Breasts/Breast_Breast00_Nipple00", false);
areola = ContentFinder<Texture2D>.Get("Breasts/Breast_Breast00_Areola00", false);
GUI.color = pawn.story.SkinColor;
GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit);
GUI.color = Color.white;
GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);
GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
return;
}
if (hediff.Severity < 0.20f) icon += "_Breast00";
else if (hediff.Severity < 0.40f) icon += "_Breast01";
else if (hediff.Severity < 0.60f) icon += "_Breast02";
@ -264,6 +277,7 @@ namespace RJW_Menstruation
if (Configurations.Debug) TooltipHandler.TipRegion(rect, comp.DebugInfo());
}
else
{
@ -277,6 +291,8 @@ namespace RJW_Menstruation
GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);
GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
}
}
public static int GetNippleIndex(float nipplesize)

View File

@ -1,3 +1,10 @@
Version 1.0.5.3
- now impregnate on every orgasm
- added egg lifespan setting
- changed initial ovary calculation
- now use infertile age instead of minimum sex age
- added vagina morph option after birth
Version 1.0.5.2
- 1.3 support
- added tooltips on status window
@ -36,6 +43,8 @@ Version 1.0.4.2
- fixed errors on pregnancy
Version 1.0.4.1
- fixed errors when the race mods are uninstalled
- minor bug fixes
- removed mechanoids from hybrid table