Compare commits

...

34 Commits

Author SHA1 Message Date
yiyuandian 7923597b02 Merge branch 'translate_ChineseSimplified_1.4' into 'main'
ChineseSimplified Translate

See merge request lutepickle/rjw_menstruation!5
2024-03-19 10:26:19 +00:00
lutepickle daeefe8218 Merge branch 'dev' 2024-03-17 16:33:09 -07:00
lutepickle e3647caf2a Build dll, change Rimworld reference in 1.4 to NuGet 2024-03-17 16:32:41 -07:00
lutepickle 9a6efaf37d Have pheromones apply in caravans 2024-03-13 10:07:25 -07:00
lutepickle cca7676bc0 Have ovulation and implant chance cache be nullable 2024-03-13 08:10:50 -07:00
lutepickle ba8801370f Have TotalFertCum account for destroyed pawns and animals 2024-03-13 08:03:02 -07:00
lutepickle c393ab45c0 Build 2024-03-11 16:48:26 -07:00
lutepickle f580d3232b Have breeder pawns boost implant chance for non-Biotech 2024-03-05 19:14:28 -08:00
lutepickle e964b2af93 Failsafe in the dialog window if a biotech pregnancy somehow gets a null mother (theoretically possible on implant error) 2024-03-05 16:01:33 -08:00
lutepickle 6e56664d41 Switch TickIntervalMinimum to being based on the named constant 2024-03-05 15:46:36 -08:00
lutepickle 4e88184f9b Add graphics to genes by Alpenglow 2024-03-05 09:06:02 -08:00
lutepickle 06ccb04a55 Clean up a bunch of unnecessary using statements 2024-03-04 18:25:44 -08:00
lutepickle 8bea56b65a Fix miscapitalization in CycleDisabledGenes.xml 2024-03-02 10:21:21 -08:00
lutepickle c6e4d81a20 Don't fertilize from destroyed pawns 2024-02-28 19:48:52 -08:00
lutepickle 1cdb12fd3a Replace some uses of Rand.Range with Utility.VariationRange 2024-02-27 21:56:59 -08:00
lutepickle 7e407a1cf9 Don't call Notify_UpdatedGenes if the gene isn't menstruation-related 2024-02-27 14:58:20 -08:00
lutepickle 32800a3499 Null check for apparel tracker in DirtyEffect 2024-02-22 22:09:12 -08:00
lutepickle ff95b8da39 It's safe and a bit quicker to unconditionally remove forced in CheckDirty 2024-02-17 15:37:14 -08:00
lutepickle 8306439576 Refactor allraces and allkinds 2024-02-16 22:03:03 -08:00
lutepickle ebb486179b Reformat RandomOvulationChance 2024-02-16 20:47:59 -08:00
lutepickle f79050483d Remove the originsize system. Nobody used it 2024-02-16 20:24:10 -08:00
lutepickle d483e22ac2 Little cleanup 2024-02-16 16:55:53 -08:00
lutepickle 7e5b2000da Mark the Conit fork of Birds & Bees as incompatible 2024-02-16 13:52:46 -08:00
lutepickle 836d3d69c8 Let CalculatedImpactChance return early to avoid unnecessarily hitting OvulationChance 2024-02-12 22:19:10 -08:00
lutepickle 50310988ca Be sure the periodic can go into anestrus if it initializes into ovulatory 2024-02-11 10:47:01 -08:00
lutepickle 82dea0f425 Always attempt to ovulate at least one egg 2024-02-11 07:30:25 -08:00
lutepickle bd39194fd1 Add Outland - Genetics' egglaying genes to the no cycle list 2024-02-11 06:43:56 -08:00
lutepickle 56b11069da Little refactor in GetBabyInfo and GetFatherInfo 2024-02-10 10:11:24 -08:00
lutepickle 02b0045fb3 Some input sanitization for the egg life span and ovulation genes 2024-02-08 21:33:39 -08:00
lutepickle fcbc19825e Move gene properties and cycle disabled genes to ModExtensions 2024-02-08 20:30:49 -08:00
lutepickle 7b00579969 Exclude Erin's Covyia egg genes from cycling 2024-02-08 16:00:13 -08:00
lutepickle cb8267bf0f Let a pawn be randomly initialized into their ovulatory stage 2024-02-04 19:49:20 -08:00
lutepickle 2dda753ab9 Be sure CheckDirty updates the stats if the old absorber had stats and the new doesn't 2024-02-04 17:07:10 -08:00
yiyuandian 6e86852f88 ChineseSimplified Translate 2023-09-10 22:57:30 +08:00
55 changed files with 510 additions and 246 deletions

Binary file not shown.

View File

@ -9,7 +9,8 @@
<GeneDef Name="Menstruation_EggLifetime" Abstract="True">
<displayCategory>Menstruation</displayCategory>
<exclusionTags>
<iconPath>UI/Genes/Placeholder</iconPath>
<exclusionTags>
<li>Menstruation_EggLifetime</li>
</exclusionTags>
</GeneDef>
@ -18,33 +19,49 @@
<defName>Menstruation_ShortEggLifetime</defName>
<label>short egg lifetime</label>
<description>Unfertilized eggs with this gene last three-quarters as long.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<iconPath>UI/Genes/ShortEggLifetime</iconPath>
<biostatMet>1</biostatMet>
<displayOrderInCategory>10</displayOrderInCategory>
<modExtensions>
<li Class ="RJW_Menstruation.MenstruationModExtension">
<eggLifeTimeFactor>0.75</eggLifeTimeFactor>
</li>
</modExtensions>
</GeneDef>
<GeneDef ParentName="Menstruation_EggLifetime">
<defName>Menstruation_DoubleEggLifetime</defName>
<label>double egg lifetime</label>
<description>Unfertilized eggs with this gene last twice as long.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<iconPath>UI/Genes/DoubleEggLifetime</iconPath>
<biostatMet>-1</biostatMet>
<displayOrderInCategory>12</displayOrderInCategory>
<modExtensions>
<li Class ="RJW_Menstruation.MenstruationModExtension">
<eggLifeTimeFactor>2.0</eggLifeTimeFactor>
</li>
</modExtensions>
</GeneDef>
<GeneDef ParentName="Menstruation_EggLifetime">
<defName>Menstruation_QuadEggLifetime</defName>
<label>quadrule egg lifetime</label>
<description>Eggs with this gene last four times as long.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<iconPath>UI/Genes/QuadEggLifetime</iconPath>
<biostatMet>-2</biostatMet>
<biostatCpx>1</biostatCpx>
<displayOrderInCategory>16</displayOrderInCategory>
<modExtensions>
<li Class ="RJW_Menstruation.MenstruationModExtension">
<eggLifeTimeFactor>4.0</eggLifeTimeFactor>
</li>
</modExtensions>
</GeneDef>
<GeneDef Name="Menstruation_Estrus" Abstract="True">
<displayCategory>Menstruation</displayCategory>
<exclusionTags>
<iconPath>UI/Genes/Placeholder</iconPath>
<exclusionTags>
<li>Menstruation_Estrus</li>
</exclusionTags>
</GeneDef>
@ -53,24 +70,35 @@
<defName>Menstruation_NeverEstrus</defName>
<label>never estrus</label>
<description>Carriers of this gene will never go into estrus.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<iconPath>UI/Genes/NeverEstrus</iconPath>
<biostatMet>1</biostatMet>
<displayOrderInCategory>20</displayOrderInCategory>
<modExtensions>
<li Class ="RJW_Menstruation.MenstruationModExtension">
<neverEstrus>true</neverEstrus>
</li>
</modExtensions>
</GeneDef>
<GeneDef ParentName="Menstruation_Estrus">
<defName>Menstruation_FullEstrus</defName>
<label>full estrus</label>
<description>Carriers of this gene will enter full estrus every menstrual cycle, regardless of vagina type.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<iconPath>UI/Genes/FullEstrus</iconPath>
<biostatMet>-1</biostatMet>
<biostatCpx>1</biostatCpx>
<displayOrderInCategory>25</displayOrderInCategory>
<modExtensions>
<li Class ="RJW_Menstruation.MenstruationModExtension">
<alwaysEstrus>true</alwaysEstrus>
</li>
</modExtensions>
</GeneDef>
<GeneDef Name="Menstruation_Ovulation" Abstract="True">
<displayCategory>Menstruation</displayCategory>
<exclusionTags>
<iconPath>UI/Genes/Placeholder</iconPath>
<exclusionTags>
<li>Menstruation_Ovulation</li>
</exclusionTags>
</GeneDef>
@ -79,18 +107,28 @@
<defName>Menstruation_DoubleOvulation</defName>
<label>double ovulation</label>
<description>Carriers of this gene will ovulate twice as many eggs.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<iconPath>UI/Genes/DoubleOvulation</iconPath>
<biostatMet>-1</biostatMet>
<displayOrderInCategory>30</displayOrderInCategory>
<modExtensions>
<li Class ="RJW_Menstruation.MenstruationModExtension">
<ovulationFactor>2</ovulationFactor>
</li>
</modExtensions>
</GeneDef>
<GeneDef ParentName="Menstruation_Ovulation">
<defName>Menstruation_QuadOvulation</defName>
<label>quadruple ovulation</label>
<description>Carriers of this gene will ovulate four times as many eggs.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<iconPath>UI/Genes/QuadOvulation</iconPath>
<biostatMet>-1</biostatMet>
<displayOrderInCategory>35</displayOrderInCategory>
<modExtensions>
<li Class ="RJW_Menstruation.MenstruationModExtension">
<ovulationFactor>4</ovulationFactor>
</li>
</modExtensions>
</GeneDef>
<GeneDef>
@ -98,9 +136,14 @@
<label>no bleeding</label>
<displayCategory>Menstruation</displayCategory>
<description>Carriers of this gene will not bleed at the end of their cycle.</description>
<iconPath>UI/Genes/Placeholder</iconPath>
<iconPath>UI/Genes/NoBleeding</iconPath>
<biostatMet>-1</biostatMet>
<displayOrderInCategory>40</displayOrderInCategory>
<modExtensions>
<li Class ="RJW_Menstruation.MenstruationModExtension">
<noBleeding>true</noBleeding>
</li>
</modExtensions>
</GeneDef>
<!-- Pheromones? -->

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<OvaryRegenerationPill.label>卵巢再生丸</OvaryRegenerationPill.label>
<OvaryRegenerationPill.description>恢复卵巢健康,恢复一定数量的卵子。&#10;对剩余卵子较少的卵巢效果较差。&#10;更年期无法恢复。</OvaryRegenerationPill.description>
<SuperovulationInducingAgent.label>超排卵诱导剂</SuperovulationInducingAgent.label>
<SuperovulationInducingAgent.description>诱发超排卵,使下次排卵多产生 1-4 个卵子&#10;&#10;可能会加速更年期的到来。</SuperovulationInducingAgent.description>
<PainReliever.label>止痛药</PainReliever.label>
<PainReliever.description>24 小时缓解经痛。&#10;&#10;对其他原因引起的疼痛也有效。</PainReliever.description>
<Cyclosporine.label>环孢素</Cyclosporine.label>
<Cyclosporine.description>一种免疫抑制剂。&#10; 可以治愈抗精子抗体,但会在 24 小时内降低人体抵抗感染和疾病的能力。</Cyclosporine.description>
</LanguageData>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<LanguageData>
<Menstruation.label>月经周期</Menstruation.label>
<Menstruation_ShortEggLifetime.label>短寿命卵子</Menstruation_ShortEggLifetime.label>
<Menstruation_ShortEggLifetime.description>带有这种基因的未受精卵存活时间为正常的四分之三。</Menstruation_ShortEggLifetime.description>
<Menstruation_DoubleEggLifetime.label>双倍卵子寿命</Menstruation_DoubleEggLifetime.label>
<Menstruation_DoubleEggLifetime.description>带有这种基因的未受精卵存活时间为正常的两倍。</Menstruation_DoubleEggLifetime.description>
<Menstruation_QuadEggLifetime.label>四倍卵子寿命</Menstruation_QuadEggLifetime.label>
<Menstruation_DoubleEggLifetime.description>带有这种基因的未受精卵存活时间为正常的四倍。</Menstruation_DoubleEggLifetime.description>
<Menstruation_NeverEstrus.label>永不发情</Menstruation_NeverEstrus.label>
<Menstruation_NeverEstrus.description>这种基因的携带者永远都不会发情。</Menstruation_NeverEstrus.description>
<Menstruation_FullEstrus.label>永远发情</Menstruation_FullEstrus.label>
<Menstruation_FullEstrus.description>这种基因的携带者在每个月经周期都会完全发情,与阴道类型无关。</Menstruation_FullEstrus.description>
<Menstruation_DoubleOvulation.label>双倍排卵</Menstruation_DoubleOvulation.label>
<Menstruation_DoubleOvulation.description>这种基因的携带者会排出双倍数量的卵子。</Menstruation_DoubleOvulation.description>
<Menstruation_QuadOvulation.label>四倍排卵</Menstruation_QuadOvulation.label>
<Menstruation_QuadOvulation.description>这种基因的携带者排出的卵子数量是正常人的四倍。</Menstruation_QuadOvulation.description>
<Menstruation_NoBleeding.label>不流血</Menstruation_NoBleeding.label>
<Menstruation_NoBleeding.description>这种基因的携带者在月经周期结束时不会出血。</Menstruation_NoBleeding.description>
</LanguageData>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<Hediff_ASA.label>抗精蛋白抗体</Hediff_ASA.label>
<Hediff_ASA.description>抗精子抗体。&#10; 增加精子的死亡率。</Hediff_ASA.description>
<Hediff_ForceFertile.label>繁殖力</Hediff_ForceFertile.label>
<Hediff_ForceFertile.description>繁殖力</Hediff_ForceFertile.description>
</LanguageData>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<Hediff_MenstrualCramp.label>经期</Hediff_MenstrualCramp.label>
<Hediff_MenstrualCramp.description>月经周期结束时阴道出血。&#10; 常有疼痛感。</Hediff_MenstrualCramp.description>
<Hediff_Estrus.label>发情期</Hediff_Estrus.label>
<Hediff_Estrus.description>子宫进入月经周期中最易受孕阶段所导致的一种情况。由于身体渴望怀孕,性兴奋和性欲会急剧增强。&#10;阴道性交发生的几率增加,在择偶时可能会降低标准。</Hediff_Estrus.description>
<Hediff_Estrus_Concealed.label>发情期(隐蔽)</Hediff_Estrus_Concealed.label>
<Hediff_Estrus_Concealed.description>子宫在月经周期中最易受孕的阶段所导致的症状。性兴奋和性欲略有增强。&#10; 阴道性交的机会略有增加。</Hediff_Estrus_Concealed.description>
<Hediff_AffectedByPheromones.label>受费洛蒙影响</Hediff_AffectedByPheromones.label>
<Hediff_AffectedByPheromones.description>与处于发情期的人相处而引起的一种症状。发情的气味会增强性欲和满足感。</Hediff_AffectedByPheromones.description>
<Hediff_PainReliever.label>止痛药</Hediff_PainReliever.label>
<Hediff_PainReliever.description>轻度缓解经痛(及其他)。</Hediff_PainReliever.description>
<Hediff_Cyclosporine.label>环孢素</Hediff_Cyclosporine.label>
<Hediff_Cyclosporine.description>在免疫抑制剂的作用下,阻碍人体抵抗感染和疾病的能力。</Hediff_Cyclosporine.description>
</LanguageData>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<VaginaWashing.reportString>清洗阴道</VaginaWashing.reportString>
</LanguageData>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<LactateSelf.reportString>挤自己的奶</LactateSelf.reportString>
</LanguageData>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<OpenStatusWindow.label>月经:打开状态窗口</OpenStatusWindow.label>
</LanguageData>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<Surgery_ExpandAreola.label>扩大乳晕</Surgery_ExpandAreola.label>
<Surgery_ExpandAreola.description>扩大乳晕.</Surgery_ExpandAreola.description>
<Surgery_ContractAreola.label>缩小乳晕</Surgery_ContractAreola.label>
<Surgery_ContractAreola.description>缩小乳晕.</Surgery_ContractAreola.description>
<Surgery_ExpandNipple.label>扩大乳头</Surgery_ExpandNipple.label>
<Surgery_ExpandNipple.description>扩大乳头.</Surgery_ExpandNipple.description>
<Surgery_ContractNipple.label>缩小乳头</Surgery_ContractNipple.label>
<Surgery_ContractNipple.description>缩小乳头。</Surgery_ContractNipple.description>
<Surgery_DarkenNipple.label>乳头变黑</Surgery_DarkenNipple.label>
<Surgery_DarkenNipple.description>乳头变黑.</Surgery_DarkenNipple.description>
<Surgery_LightenNipple.label>乳头变亮</Surgery_LightenNipple.label>
<Surgery_LightenNipple.description>乳头变亮.</Surgery_LightenNipple.description>
</LanguageData>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<AmountofCreampied.label>奶油</AmountofCreampied.label>
<AmountofCreampied.description>射进我子宫里的精液毫升量。</AmountofCreampied.description>
<AmountofFertilizedEggs.label>受精卵</AmountofFertilizedEggs.label>
<AmountofFertilizedEggs.description>精子与我的卵子受精的数量。</AmountofFertilizedEggs.description>
</LanguageData>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<MaxAbsorbable.label>可吸收性</MaxAbsorbable.label>
<MaxAbsorbable.description>该物品可吸收的最大液体量。</MaxAbsorbable.description>
</LanguageData>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<CameInside.label>内射</CameInside.label>
</LanguageData>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<Absorber.label>生殖器</Absorber.label>
</LanguageData>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<Absorber_Tampon.label>卫生棉条</Absorber_Tampon.label>
<Absorber_Tampon.description>用于吸收阴道内液体的卫生棉条。&#10; 佩戴时间过长可能会引起感染。</Absorber_Tampon.description>
<Absorber_Tampon_Dirty.label>肮脏的卫生棉条</Absorber_Tampon_Dirty.label>
<Absorber_Tampon_Dirty.description>用过的湿卫生棉条。&#10; 如果留在里面可能会引起感染。</Absorber_Tampon_Dirty.description>
<Absorber_Pad.label>卫生巾</Absorber_Pad.label>
<Absorber_Pad.description>一种用于吸收阴道内液体的垫子。</Absorber_Pad.description>
<Absorber_Pad_Dirty.label>湿卫生巾</Absorber_Pad_Dirty.label>
<Absorber_Pad_Dirty.description>一块用过的湿卫生巾</Absorber_Pad_Dirty.description>
</LanguageData>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<FilthMixture.label>混合物</FilthMixture.label>
</LanguageData>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<LeakingFluids.stages.0.label>滴落的液体</LeakingFluids.stages.0.label>
<LeakingFluids.stages.0.description>难道我就不能找点东西来吸收这些东西吗?</LeakingFluids.stages.0.description>
<HaterCameInsideM.stages.0.label>内射了 {0}</HaterCameInsideM.stages.0.label>
<HaterCameInsideM.stages.0.description>我内射我的敌人!</HaterCameInsideM.stages.0.description>
<CameInsideM.stages.0.label>内射了 {0}</CameInsideM.stages.0.label>
<CameInsideM.stages.0.description>真不错</CameInsideM.stages.0.description>
<CameInsideFFetish.stages.0.label>{0} 内射了我</CameInsideFFetish.stages.0.label>
<CameInsideFFetish.stages.0.description>好想为他生孩子</CameInsideFFetish.stages.0.description>
<HaterCameInsideF.stages.0.label>{0} 内射了我</HaterCameInsideF.stages.0.label>
<HaterCameInsideF.stages.0.description>我不想怀上他的孩子!</HaterCameInsideF.stages.0.description>
<HaterCameInsideFEstrus.stages.0.label>{0} 内射了我</HaterCameInsideFEstrus.stages.0.label>
<HaterCameInsideFEstrus.stages.0.description>我到底在想什么,让他这样做?</HaterCameInsideFEstrus.stages.0.description>
<CameInsideFLowFert.stages.0.label>{0} 内射了我</CameInsideFLowFert.stages.0.label>
<CameInsideFLowFert.stages.0.description>我担心我可能会怀孕。&#10; 机会不大,但...</CameInsideFLowFert.stages.0.description>
<CameInsideF.stages.0.label>{0} 内射了我</CameInsideF.stages.0.label>
<CameInsideF.stages.0.description>我担心自己会怀孕。</CameInsideF.stages.0.description>
<CameInsideFFetishSafe.stages.0.label>{0} 内射了我</CameInsideFFetishSafe.stages.0.label>
<CameInsideFFetishSafe.stages.0.description>我想我不会怀孕,但幻想一下还是很有趣的。</CameInsideFFetishSafe.stages.0.description>
<HaterCameInsideFSafe.stages.0.label>{0} 内射了我</HaterCameInsideFSafe.stages.0.label>
<HaterCameInsideFSafe.stages.0.description>我可能不会怀孕,但我还是不喜欢。</HaterCameInsideFSafe.stages.0.description>
<UnwantedPregnancy.stages.0.label>意外怀孕</UnwantedPregnancy.stages.0.label>
<UnwantedPregnancy.stages.0.description>我将如何照顾婴儿?我该怎么办?</UnwantedPregnancy.stages.0.description>
<UnwantedPregnancyMild.stages.0.label>意外怀孕</UnwantedPregnancyMild.stages.0.label>
<UnwantedPregnancyMild.stages.0.description>我要有孩子了。我希望我能处理好</UnwantedPregnancyMild.stages.0.description>
<TookContraceptivePill.stages.0.label>服用避孕药</TookContraceptivePill.stages.0.label>
<TookContraceptivePill.stages.0.description>现在一切都会好起来的</TookContraceptivePill.stages.0.description>
<HateTookContraceptivePill.stages.0.label>服用避孕药</HateTookContraceptivePill.stages.0.label>
<HateTookContraceptivePill.stages.0.description>我想要怀孕。</HateTookContraceptivePill.stages.0.description>
<EggRestorationReceived.stages.0.label>卵子修复</EggRestorationReceived.stages.0.label>
<EggRestorationReceived.stages.0.description>我现在可以再繁殖一段时间了。</EggRestorationReceived.stages.0.description>
<CameInsideMIdeo.stages.0.label>内射了 {0}</CameInsideMIdeo.stages.0.label>
<CameInsideMIdeo.stages.0.description>我有责任让她怀孕。</CameInsideMIdeo.stages.0.description>
<CameInsideFIdeo.stages.0.label>{0} 内射了我</CameInsideFIdeo.stages.0.label>
<CameInsideFIdeo.stages.0.description>我希望这能让我如愿怀孕。</CameInsideFIdeo.stages.0.description>
<HaterCameInsideFIdeo.stages.0.label>{0} 内射了我</HaterCameInsideFIdeo.stages.0.label>
<HaterCameInsideFIdeo.stages.0.description>我知道我应该怀孕,但必须是他的孩子吗?</HaterCameInsideFIdeo.stages.0.description>
<HateTookContraceptivePillIdeo.stages.0.label>服用避孕药</HateTookContraceptivePillIdeo.stages.0.label>
<HateTookContraceptivePillIdeo.stages.0.description>我的信仰要求我必须怀孕。</HateTookContraceptivePillIdeo.stages.0.description>
</LanguageData>

View File

@ -1,18 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
<Mod_Title>RJW Menstruation Cycle</Mod_Title>
<Mod_Title>RJW 月经周期</Mod_Title>
<Menstrual_Blood>月经血</Menstrual_Blood>
<Info_noCum></Info_noCum>
<Stage_Follicular>卵泡期</Stage_Follicular>
<Stage_Ovulatory>排卵</Stage_Ovulatory>
<Stage_Ovulatory>排卵</Stage_Ovulatory>
<Stage_Luteal>黄体期</Stage_Luteal>
<Stage_Bleeding>月经来潮</Stage_Bleeding>
<Stage_Pregnant>怀孕</Stage_Pregnant>
<Stage_Recover>产后恢复</Stage_Recover>
<Stage_None></Stage_None>
<Stage_Climacteric>更年期</Stage_Climacteric>
<Stage_Menopause>绝经</Stage_Menopause>
<Stage_Anestrus>非发情期</Stage_Anestrus>
<Stage_Follicular_Desc>卵巢正准备排出卵子。排卵将在这一阶段结束时发生。</Stage_Follicular_Desc>
<Stage_Follicular_Induced_Desc>卵巢正准备排出卵子。如果精液进入子宫,就会排卵。</Stage_Follicular_Induced_Desc>
<Stage_Ovulatory_Desc>卵巢正在将卵子排入子宫。</Stage_Ovulatory_Desc>
<Stage_Luteal_Desc>子宫准备好接受受精卵。如果受精卵在这一阶段结束前着床,就会怀孕。</Stage_Luteal_Desc>
<Stage_Bleeding_Desc>子宫内膜和未能着床的卵子正在脱落。</Stage_Bleeding_Desc>
<Stage_Pregnant_Desc>婴儿正在子宫内成长。在时间和呵护下,他将成为这个世界的新居民。</Stage_Pregnant_Desc>
<Stage_Recover_Desc>子宫正在从最近的妊娠中恢复。</Stage_Recover_Desc>
<Stage_None_Desc>子宫没有生育能力,无法怀孕。</Stage_None_Desc>
<Stage_Climacteric_Desc>卵巢已接近衰竭,月经周期变得不规律。</Stage_Climacteric_Desc>
<Stage_Menopause_Desc>卵巢已经衰竭,子宫无法再产生卵子。</Stage_Menopause_Desc>
<Stage_Anestrus_Desc>子宫已过繁殖期。一旦条件得到满足,月经周期就会恢复。</Stage_Anestrus_Desc>
<Button_HealthTab>状态</Button_HealthTab>
<Button_MilkTooltip>挤自己奶</Button_MilkTooltip>
<Dialog_WombInfo01>状态</Dialog_WombInfo01>
@ -24,49 +36,62 @@
<Dialog_WombInfo07>排卵</Dialog_WombInfo07>
<Dialog_WombInfo08></Dialog_WombInfo08>
<Dialog_WombInfo09></Dialog_WombInfo09>
<Option1_Label>激活子宫图标</Option1_Label>
<Option1_Desc>激活子宫图标框</Option1_Desc>
<Dialog_FatherUnknown>未知</Dialog_FatherUnknown>
<Option1_Label_1>激活子宫图标</Option1_Label_1>
<Option1_Label_2>启用健康选项卡中的“状态”按钮</Option1_Label_2>
<Option2_Label>激活动物经期</Option2_Label>
<Option2_Desc>仿真动物的经期.&#10;此选项将在保存读取后生效&#10;不推荐开启此选项</Option2_Desc>
<Option3_Label>植入机会</Option3_Label>
<Option3_Desc>设置受精卵的植入机会</Option3_Desc>
<Option4_Label>受精的机会</Option4_Label>
<Option4_Desc>设置每小时受精的机会</Option4_Desc>
<Option2_Desc>模拟动物的经期。&#10;不推荐开启此选项</Option2_Desc>
<Option3_Label>着床几率</Option3_Label>
<Option3_Desc>受精卵的基本着床几率&#10;该值影响受孕几率。</Option3_Desc>
<Option4_Label>受精的几率</Option4_Label>
<Option4_Desc>每毫升精子每小时的受精几率&#10;该值影响受孕几率。</Option4_Desc>
<Option5_Label>每小时阴道中的精液量衰减率</Option5_Label>
<Option5_Desc>阴道中的精液量将以这个比率减少</Option5_Desc>
<Option5_Desc>子宫内的精液量每小时会减少这个数值&#10;这个数值会影响受孕几率。</Option5_Desc>
<Option6_Label>每小时生育率衰减率</Option6_Label>
<Option6_Desc>精液列表的生育率将以这个比率减少</Option6_Desc>
<Option7_Label>循环加速</Option7_Label>
<Option7_Desc>加快月经周期</Option7_Desc>
<Option6_Desc>精子每小时会损失这个数量&#10;这个数值会间接影响受精几率。</Option6_Desc>
<Option7_Label>月经周期加速</Option7_Label>
<Option7_Desc>加速月经周期&#10;这会导致更年期提前和不孕症。&#10;建议将其设置为小于 x12。&#10;Rimworld 的时间刻度x6默认值</Option7_Desc>
<Option_ColonistUpdateInterval_Label>殖民者更新间隔</Option_ColonistUpdateInterval_Label>
<Option_ColonistUpdateInterval_Desc>殖民者、囚犯和奴隶的子宫更新频率。&#10;降低该值可以提高准确性,提高该值可以提高性能。</Option_ColonistUpdateInterval_Desc>
<Option_NonColonistUpdateInterval_Label>非殖民者更新时间间隔</Option_NonColonistUpdateInterval_Label>
<Option_NonColonistUpdateInterval_Desc>你无法控制的人类子宫的更新频率。&#10;降低该值可提高准确性,提高该值可提高性能。</Option_NonColonistUpdateInterval_Desc>
<Option_AnimalUpdateInterval_Label>动物更新间隔</Option_AnimalUpdateInterval_Label>
<Option_AnimalUpdateInterval_Desc>动物子宫的更新频率。&#10;降低此项可以提高准确性,提高此项可以提高性能。</Option_AnimalUpdateInterval_Desc>
<Option8_Label>调试</Option8_Label>
<Option8_Desc>显示调试信息</Option8_Desc>
<Option9_Label>子宫状态</Option9_Label>
<Option9_Desc>在状态窗口中绘制子宫图标</Option9_Desc>
<Option10_Label>阴道状态</Option10_Label>
<Option10_Label>阴道和乳房状况</Option10_Label>
<Option10_Desc>在状态窗口中绘制阴道和肛门图标</Option10_Desc>
<Option11_Label>胎儿信息级别</Option11_Label>
<Option11_Desc_1>显示有关胎儿的所有信息</Option11_Desc_1>
<Option11_Desc_2>显示妊娠后胎儿的所有信息</Option11_Desc_2>
<Option11_Desc_3>不显示有关胎儿的信息,但显示怀孕後胎儿的图象</Option11_Desc_3>
<Option11_Desc_4>不显示胎儿图象和信息</Option11_Desc_4>
<Option12_Label>激活更年期</Option12_Label>
<Option12_Desc>激活更年期效果,使小人随着时间的推移而变得不育&#10;如果您较长寿的外星人种族有碰到任何问题,请关闭此选项.&#10;此选项将在保存读取后生效</Option12_Desc>
<Option13_Label>多重怀孕</Option13_Label>
<Option13_Desc>使用多重怀孕代替RJW的默认怀孕</Option13_Desc>
<Option12_Label>启用更年期</Option12_Label>
<Option12_Desc>启用更年期效果,使小人随着时间的推移而变得不育&#10;如果您较长寿的外星人种族有碰到任何问题,请关闭此选项.&#10;此选项将在保存读取后生效</Option12_Desc>
<Option_EnablePheromones_Label>启用信息素</Option_EnablePheromones_Label>
<Option_EnablePheromones_Desc>允许类人动物处于明显的发情期,以增强附近类人雄性的性欲。</Option_EnablePheromones_Desc>
<Option_AnimalPheromoneEffect_Label>动物信息素效应</Option_AnimalPheromoneEffect_Label>
<Option_AnimalPheromoneEffect_Desc>设定明显发情的动物对人类的影响。</Option_AnimalPheromoneEffect_Desc>
<Option13_Label>多胎怀孕</Option13_Label>
<Option13_Desc>使用多胎怀孕代替 RJW 的默认怀孕&#10;如果您在RJW怀孕遇到困难请禁用此选项&#10;应开启RJW 怀孕</Option13_Desc>
<Option14_Label>激活异卵双胞胎</Option14_Label>
<Option14_Desc>激活复数个卵子可以个别受精</Option14_Desc>
<Option15_Label>激活双胞胎</Option15_Label>
<Option14_Desc>允许多个卵子同时受孕。</Option14_Desc>
<Option15_Label>激活同卵双胞胎</Option15_Label>
<Option15_Desc>允许单个卵子生成多个后代</Option15_Desc>
<Option16_Label>双胞胎出现率</Option16_Label>
<Option16_Desc>设置双胞胎的出现率</Option16_Desc>
<Option17_Label>最大双胞胎数量</Option17_Label>
<Option17_Desc>设置最大双胞胎数量</Option17_Desc>
<Option18_Label>启用卵子图标</Option18_Label>
<Option18_Desc>启用覆盖在子宫图标上的卵子图标</Option18_Desc>
<Option18_Desc>在子宫图标上启用卵子叠加功能</Option18_Desc>
<Option19_Label_1>经血数量</Option19_Label_1>
<Option19_Label_2>预计经血总量</Option19_Label_2>
<Option19_Desc>设置经血量&#10;根据阴道不同出血量有变化&#10;通常人类女性的经血量为20-80ml左右每月</Option19_Desc>
<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>
@ -75,18 +100,16 @@
<Option21_Label>目标小人</Option21_Label>
<Option21_Desc>按钮和图标会出现在这些人物上</Option21_Desc>
<Option22_Label>使用杂交扩展</Option22_Label>
<Option22_Desc>覆盖RJW and RaceSupport的杂交定义&#10;主杂交决定了谁的定义用在前面,不建议改变此项</Option22_Desc>
<Option22_Desc>覆盖RJW RaceSupport的杂交定义&#10;主杂交决定了谁的定义用在前面,不建议改变此项</Option22_Desc>
<Option23_Label>主杂交扩展</Option23_Label>
<Option23_Label_1>母方</Option23_Label_1>
<Option23_Label_2>父方</Option23_Label_2>
<Option24_Label>怀孕后乳头动态变化</Option24_Label>
<Option24_Desc>设定每次怀孕,乳头/乳晕变得更深色/宽大的程度。</Option24_Desc>
<Option25_Label>怀孕后乳头固定变化</Option25_Label>
<Option25_Desc>设定每次怀孕,乳头/乳晕永久性变得更深色/宽大的程度。</Option25_Desc>
<Option26_Label>最大变化</Option26_Label>
<Option26_Desc>乳头/乳晕不会变得比这个值更深色/宽大。</Option26_Desc>
<Option27_Label>乳头变化速度</Option27_Label>
<Option27_Desc>设定乳头/乳晕的变化速度。&#10;1 = 立刻变化</Option27_Desc>
<Option_MaxBreastIncrementFactor_Label>怀孕期间乳房膨大</Option_MaxBreastIncrementFactor_Label>
<Option_MaxBreastIncrementFactor_Desc>改变怀孕小人的胸部在怀孕时的增大程度。有些小人会比其他人长得更多。</Option_MaxBreastIncrementFactor_Desc>
<Option_MaxNippleIncrementFactor_Label>怀孕期间乳头的变化</Option_MaxNippleIncrementFactor_Label>
<Option_MaxNippleIncrementFactor_Desc>改变怀孕小人的乳头在怀孕期间的变化程度。</Option_MaxNippleIncrementFactor_Desc>
<Option_PermanentNippleChange_Label>怀孕后乳头永久性改变</Option_PermanentNippleChange_Label>
<Option_PermanentNippleChange_Desc>调整怀孕小人的乳头在妊娠结束后大约会保持多少变化。</Option_PermanentNippleChange_Desc>
<Option28_Label>自定义杂交</Option28_Label>
<Option28_Tooltip>打开自定义杂交编辑器&#10;该项会覆盖XML文件定义的杂交。</Option28_Tooltip>
<Option29_Label>允许缩放图标</Option29_Label>
@ -94,17 +117,36 @@
<Option30_Label>卵子生命周期倍增</Option30_Label>
<Option30_Desc>倍增卵子生命周期。&#10;在已受精阶段结束后,卵子将无视该选项死去。</Option30_Desc>
<Option31_Label>启用产后阴道变化</Option31_Label>
<Option31_Desc>启用产后永久阴道扩张。&#10;如果你在用另一mod处理该项关闭该选项。</Option31_Desc>
<Option31_Desc>启用产后永久阴道扩张。&#10;如果你在用其它mod处理该项关闭本选项。</Option31_Desc>
<Option32_Label>变形力度</Option32_Label>
<Option32_Desc>设置变形力度。</Option32_Desc>
<Option_EstrusOverride_Label>发情期机制覆盖 RJW 爬床设置</Option_EstrusOverride_Label>
<Option_EstrusOverride_Desc>如果启用,处于显性发情期的小人将使用这些设置,而不是 RJW 设置来进行潜在的受孕挂钩。&#10;所有设置默认为 RJW 对应设置。</Option_EstrusOverride_Desc>
<Option_EstrusFuckability_Label>发情期的最低性交能力</Option_EstrusFuckability_Label>
<Option_EstrusAttractability_Label>发情期的最低吸引力</Option_EstrusAttractability_Label>
<Option_EstrusRelationship_Label>发情期的勾搭最低态度</Option_EstrusRelationship_Label>
<EstimatedCumLifespan>预计精子生命周期</EstimatedCumLifespan>
<EstimatedEggLifespan>预计卵子生命周期</EstimatedEggLifespan>
<FertilityDesc>1小时内受精几率: {0}%&#10;受精卵着床几率。&#10;白色覆盖层表示子宫内精子受精的几率。</FertilityDesc>
<OvulationChanceLabel>排卵 {0}</OvulationChanceLabel>
<OvulationChanceDesc>排卵期间每个卵子排出的几率。</OvulationChanceDesc>
<FertilityDesc>受精卵着床几率。&#10;本小时受精几率: {0}%</FertilityDesc>
<Option_PregnancyFromBaseRJW_Label>使用基础 RJW 怀孕</Option_PregnancyFromBaseRJW_Label>
<Option_PregnancyFromMultiplePregnancy_Label>使用月经多胎妊娠</Option_PregnancyFromMultiplePregnancy_Label>
<Option_PregnancyFromBiotech_Label>使用生物技术怀孕</Option_PregnancyFromBiotech_Label>
<Option_EnableBiotechTwins_Label>(实验)在一次生物技术妊娠中,可产生多个婴儿/双胞胎。</Option_EnableBiotechTwins_Label>
<Option_EnableBiotechTwins_Desc>启用该选项将允许同卵双胞胎和异卵双胞胎使用生物技术。&#10;也允许混合系统,但两个人类同类不能产生动物。</Option_EnableBiotechTwins_Desc>
<Option_EnableDraftedIcon_Label>征召时显示子宫状态</Option_EnableDraftedIcon_Label>
<Option_EnableDraftedIcon_Desc>为已征召的小人绘制子宫图标</Option_EnableDraftedIcon_Desc>
<Button_ResetToDefault>重置为默认</Button_ResetToDefault>
<FloatMenu_CleanSelf>清洗阴道</FloatMenu_CleanSelf>
<CustomHybrid_List_Title>自定义杂交编辑器</CustomHybrid_List_Title>
<CustomHybrid_Title>{0}的杂交种</CustomHybrid_Title>
<CustomHybrid_Tooltip>当{0}与{1}交配,将有{3}几率生出{2}。&#10;如果两个种族都有对方的杂交定义,将会使用父方的定义。</CustomHybrid_Tooltip>
<CannotNoEggs>没有卵子</CannotNoEggs>
<CannotNoWomb>必须有一个子宫</CannotNoWomb>
<EggRestorationCompleted>{PAWN_labelShort}已完成{PAWN_possessive}卵子恢复周期。</EggRestorationCompleted>
</LanguageData>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>
<Operation Class="PatchOperationFindMod">
<mods>
<li>Alpha Genes</li>
</mods>
<match Class="PatchOperationAddModExtension">
<xpath>/Defs/GeneDef[defName="AG_EggLaying"]</xpath>
<value>
<li Class="RJW_Menstruation.MenstruationModExtension">
<disableCycle>true</disableCycle>
</li>
</value>
</match>
</Operation>
<Operation Class="PatchOperationFindMod">
<mods>
<li>Vanilla Races Expanded - Saurid</li>
</mods>
<match Class="PatchOperationAddModExtension">
<xpath>/Defs/GeneDef[defName="VRESaurids_Oviparous"]</xpath>
<value>
<li Class="RJW_Menstruation.MenstruationModExtension">
<disableCycle>true</disableCycle>
</li>
</value>
</match>
</Operation>
<Operation Class="PatchOperationFindMod">
<mods>
<li>Vanilla Races Expanded - Phytokin</li>
</mods>
<match Class="PatchOperationAddModExtension">
<xpath>/Defs/GeneDef[defName="VRE_SaplingBirth"]</xpath>
<value>
<li Class="RJW_Menstruation.MenstruationModExtension">
<disableCycle>true</disableCycle>
</li>
</value>
</match>
</Operation>
<Operation Class="PatchOperationFindMod">
<mods>
<li>Erin's Corvyia</li>
</mods>
<match Class="PatchOperationAddModExtension">
<xpath>/Defs/GeneDef[defName="ERN_EggLayer"]</xpath>
<value>
<li Class="RJW_Menstruation.MenstruationModExtension">
<disableCycle>true</disableCycle>
</li>
</value>
</match>
</Operation>
<Operation Class="PatchOperationFindMod">
<mods>
<li>Outland - Genetics</li>
</mods>
<match Class="PatchOperationAddModExtension">
<xpath>/Defs/GeneDef[defName="Outland_EggLayer"]</xpath>
<value>
<li Class="RJW_Menstruation.MenstruationModExtension">
<disableCycle>true</disableCycle>
</li>
</value>
</match>
</Operation>
</Patch>

View File

@ -144,11 +144,5 @@
</li>
</comps>
</value>
</Operation>
</Operation>
</Patch>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,5 +1,4 @@
using AlienRace;
using System;
using System.Collections.Generic;
using UnityEngine;
using Verse;

View File

@ -21,7 +21,7 @@ namespace RJW_Menstruation
public const int ColonistTickIntervalDefault = GenDate.TicksPerHour;
public const int NonColonistTickIntervalDefault = GenDate.TicksPerHour;
public const int AnimalTickIntervalDefault = GenDate.TicksPerHour;
public const int TickIntervalMinimum = 20;
public const int TickIntervalMinimum = GenTicks.TicksPerRealSecond / 3;
public const int TickIntervalMaximum = 4 * GenDate.TicksPerHour;
public const float EnzygoticTwinsChanceDefault = 0.002f;
public const int EnzygoticTwinsChanceAdjustDefault = 2;

View File

@ -1,7 +1,6 @@
using RimWorld;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using UnityEngine;
using Verse;

View File

@ -1,5 +1,4 @@
using RimWorld;
using rjw;
using System.Collections.Generic;
using Verse;

View File

@ -109,5 +109,7 @@ namespace RJW_Menstruation
if (curStage == Stage.Luteal && !hadOvulatoryStage) return false;
else return base.ShouldBeInEstrus();
}
protected override float RandomOvulationChance => 0;
}
}

View File

@ -123,11 +123,10 @@ namespace RJW_Menstruation
protected string customwombtex = null;
protected string customvagtex = null;
protected bool estrusflag = false;
protected float ovulationChanceCache = -1.0f; // Dirtied every simulation
protected float implantationChanceCache = -1.0f;
protected float? ovulationChanceCache = null; // Dirtied every simulation
protected float? implantationChanceCache = null;
protected int opcache = -1;
protected float antisperm = 0.0f;
protected float? originvagsize = null;
// RJW pregnancy, or Biotech pregnancy/labor/laborpushing
protected Hediff pregnancy = null;
@ -179,7 +178,8 @@ namespace RJW_Menstruation
public float HoursBetweenSimulations => (float)TickInterval / GenDate.TicksPerHour;
public Hediff Pregnancy {
public Hediff Pregnancy
{
get
{
if (pregnancy == null) return null;
@ -255,11 +255,11 @@ namespace RJW_Menstruation
public float TotalCum
{
get => cums?.Sum(cum => cum.Volume) ?? 0;
get => cums?.Sum(cum => cum.Volume) ?? 0;
}
public float TotalFertCum
{
get => cums?.Sum(cum => cum.FertVolume) ?? 0;
get => cums?.Where(cum => CumCanFertilize(cum)).Sum(cum => cum.FertVolume) ?? 0;
}
public float TotalCumPercent
{
@ -289,7 +289,7 @@ namespace RJW_Menstruation
private bool calculatingOvulationChance = false;
public bool CalculatingOvulationChance { get => calculatingOvulationChance; }
protected float CalculatedOvulationChance()
private float CalculatedOvulationChance()
{
float ovulationChance = 1.0f;
if (EggHealth <= 0.0f) return 0.0f;
@ -315,19 +315,20 @@ namespace RJW_Menstruation
return ovulationChance;
}
protected float CalculatedImplantChance()
private float CalculatedImplantChance()
{
if (ModsConfig.BiotechActive && xxx.is_human(Pawn))
{
// Implant factor will be based solely on pawn age, plus any rollover from ovulation chance
float factor = 1.0f;
StatDefOf.Fertility.GetStatPart<StatPart_FertilityByGenderAge>()?.TransformValue(StatRequest.For(Pawn), ref factor);
if (factor <= 0.0f) return 0.0f;
if (OvulationChance > 1.0f) factor *= OvulationChance;
return Props.baseImplantationChanceFactor * FertilityModifier * factor;
}
else
{
return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * FertilityModifier;
return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * FertilityModifier * (Pawn.IsBreeder() ? 10.0f : 1.0f);
}
}
@ -335,8 +336,8 @@ namespace RJW_Menstruation
{
get
{
if (ovulationChanceCache < 0.0f) ovulationChanceCache = CalculatedOvulationChance();
return ovulationChanceCache;
if (ovulationChanceCache == null) ovulationChanceCache = CalculatedOvulationChance();
return ovulationChanceCache.Value;
}
}
@ -345,8 +346,8 @@ namespace RJW_Menstruation
{
get
{
if (implantationChanceCache < 0.0f) implantationChanceCache = CalculatedImplantChance();
return implantationChanceCache;
if (implantationChanceCache == null) implantationChanceCache = CalculatedImplantChance();
return implantationChanceCache.Value;
}
}
@ -356,7 +357,7 @@ namespace RJW_Menstruation
{
if (cums.NullOrEmpty()) yield return Translations.Info_noCum;
else foreach (Cum cum in cums)
yield return string.Format("{0}: {1:0.##}ml", cum.notcum ? cum.notcumLabel : cum.pawn?.Label, cum.Volume);
yield return string.Format("{0}: {1:0.##}ml", cum.notcum ? cum.notcumLabel : cum.pawn?.Label, cum.Volume);
}
}
public Color GetCumMixtureColor
@ -563,19 +564,6 @@ namespace RJW_Menstruation
}
}
public float OriginVagSize
{
get
{
if (originvagsize == null)
{
originvagsize = parent.Severity;
}
return originvagsize ?? 0.1f;
}
set => originvagsize = value;
}
public int CurStageIntervalTicks
{
get => currentIntervalTicks;
@ -608,7 +596,7 @@ namespace RJW_Menstruation
else if (Pawn.story?.bodyType == BodyTypeDefOf.Female) discoveryTime = 0.35f;
// Estimated; there's no way to get the exact value after the fact without writing it into the save
float lutealProgressWhenImplanted = Math.Min(0.5f, maxImplantDelayHours / (Props.lutealIntervalDays * GenDate.HoursPerDay));
return GenMath.LerpDouble(0, discoveryTime, lutealProgressWhenImplanted, 1.0f, pregnancy.Severity);
}
}
@ -656,7 +644,6 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref ovarypower, "ovarypower", ovarypower, true);
Scribe_Values.Look(ref eggstack, "eggstack", 0);
Scribe_Values.Look(ref estrusflag, "estrusflag", false);
Scribe_Values.Look(ref originvagsize, "originvagsize", originvagsize, true);
Scribe_Values.Look(ref DoCleanWomb, "DoCleanWomb", false);
Scribe_References.Look(ref pregnancy, "pregnancy");
if (Scribe.mode == LoadSaveMode.PostLoadInit)
@ -679,23 +666,18 @@ namespace RJW_Menstruation
ovulationFactor = 1f;
noBleeding = false;
opcache = -1;
if (Pawn.genes == null || !ModsConfig.BiotechActive) return;
foreach (GeneDef geneDef in Pawn.genes.GenesListForReading.Select(gene => gene.def))
foreach (MenstruationModExtension extension in Pawn.genes.GenesListForReading.Select(gene => gene.def.GetModExtension<MenstruationModExtension>()).Where(ext => ext != null))
{
if (geneDef == VariousDefOf.ShortEggLifetime) eggLifeSpanTicks = eggLifeSpanTicks * 3 / 4;
else if (geneDef == VariousDefOf.DoubleEggLifetime) eggLifeSpanTicks *= 2;
else if (geneDef == VariousDefOf.QuadEggLifetime) eggLifeSpanTicks *= 4;
else if (geneDef == VariousDefOf.NeverEstrus) estrusLevel = EstrusLevel.None;
else if (geneDef == VariousDefOf.FullEstrus) estrusLevel = EstrusLevel.Visible;
else if (geneDef == VariousDefOf.DoubleOvulation) ovulationFactor = 2f;
else if (geneDef == VariousDefOf.QuadOvulation) ovulationFactor = 4f;
else if (geneDef == VariousDefOf.NoBleeding) noBleeding = true;
eggLifeSpanTicks = (int)(eggLifeSpanTicks * extension.eggLifeTimeFactor);
if (extension.alwaysEstrus) estrusLevel = EstrusLevel.Visible;
else if (extension.neverEstrus) estrusLevel = EstrusLevel.None;
ovulationFactor *= extension.ovulationFactor;
if (extension.noBleeding) noBleeding = true;
}
if (eggLifeSpanTicks < 0) eggLifeSpanTicks = 0;
if (ovulationFactor < 0f) ovulationFactor = 0f;
}
public bool ShouldSimulate()
@ -724,7 +706,7 @@ namespace RJW_Menstruation
{
if (Pawn.IsHashIntervalTick(recalculateTickInterval)) TickInterval = -1; // Every so often, force TickInterval to be recalculated in case the pawn's status changed.
if (!Pawn.IsHashIntervalTick(TickInterval)) return;
if (!ShouldSimulate()) return;
// Initialize immediately if needed, but if there's an error, then don't spam it every tick
@ -733,7 +715,7 @@ namespace RJW_Menstruation
Log.Warning($"{Pawn}'s womb is ticking, but was not initialized first");
Initialize();
}
if (initError) Log.Warning($"Attempting to process {Pawn}'s womb uninitialized");
if (Pregnancy != null && curStage != Stage.Pregnant)
@ -743,7 +725,7 @@ namespace RJW_Menstruation
}
BeforeSimulator();
if (ShouldBeInfertile()) GoNextStage(Stage.Infertile);
switch (curStage)
{
@ -820,7 +802,7 @@ namespace RJW_Menstruation
tip.Append(": ");
tip.Append(GetCurStageLabel);
string fertInfo = GetFertilizingInfo;
if(CurrentVisibleStage == Stage.Luteal && fertInfo.Length > 0)
if (CurrentVisibleStage == Stage.Luteal && fertInfo.Length > 0)
{
tip.AppendLine();
tip.Append(fertInfo);
@ -831,7 +813,7 @@ namespace RJW_Menstruation
protected virtual int TicksToNextStage()
{
return Math.Max(0,(currentIntervalTicks - curStageTicks) / Configurations.CycleAcceleration);
return Math.Max(0, (currentIntervalTicks - curStageTicks) / Configurations.CycleAcceleration);
}
public override string CompDebugString()
@ -1176,7 +1158,7 @@ namespace RJW_Menstruation
if (cycleSpeed < 0f) cycleSpeed = Utility.RandGaussianLike(0.8f, 1.2f);
if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent();
InitOvary();
if (currentIntervalTicks < 0)
@ -1284,8 +1266,8 @@ namespace RJW_Menstruation
protected virtual void BeforeSimulator()
{
ovulationChanceCache = -1.0f;
implantationChanceCache = -1.0f;
ovulationChanceCache = null;
implantationChanceCache = null;
CumOut();
}
@ -1353,10 +1335,18 @@ namespace RJW_Menstruation
}
}
public bool CumCanFertilize(Cum cum)
{
return !cum.notcum &&
cum.FertVolume > 0 &&
!(cum.pawn?.Destroyed ?? true) &&
(RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(Pawn) == xxx.is_animal(cum.pawn));
}
protected Pawn Fertilize()
{
if (cums.NullOrEmpty()) return null;
List<Cum> eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && cum.pawn != null && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(Pawn) == xxx.is_animal(cum.pawn)));
List<Cum> eligibleCum = cums.FindAll(cum => CumCanFertilize(cum));
if (eligibleCum.Count == 0) return null;
float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume);
@ -1364,7 +1354,7 @@ namespace RJW_Menstruation
//float fertFailChancePerHour = Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor);
//float fertFailChancePerInterval = Mathf.Pow(fertFailChancePerHour, (float)TickInterval / GenDate.TicksPerHour);
float fertFailChancePerInterval = Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor * HoursBetweenSimulations);
if (Rand.Chance(fertFailChancePerInterval)) return null;
Pawn.records.AddTo(VariousDefOf.AmountofFertilizedEggs, 1);
@ -1494,7 +1484,7 @@ namespace RJW_Menstruation
float interspeciesFactor = InterspeciesImplantFactor(egg.fertilizer);
float implantChance = Configurations.ImplantationChance * ImplantChance * interspeciesFactor;
Log.Message($"Fertilized egg of {Pawn} failed to implant (chance {implantChance.ToStringPercent()}, " +
(interspeciesFactor < 1.0f ? $"interspecies factor {interspeciesFactor.ToStringPercent()}, " : "" ) +
(interspeciesFactor < 1.0f ? $"interspecies factor {interspeciesFactor.ToStringPercent()}, " : "") +
$"father {egg.fertilizer})");
}
deadeggs.Add(egg);
@ -1525,7 +1515,7 @@ namespace RJW_Menstruation
protected void BleedOut()
{
// ~1.5 per hour times acceleration
float bledAmount = 0.03f * Configurations.BleedingAmount * Configurations.CycleAcceleration * Rand.Range(0.5f, 1.5f) * HoursBetweenSimulations;
float bledAmount = Utility.VariationRange(0.03f * Configurations.BleedingAmount * Configurations.CycleAcceleration * HoursBetweenSimulations, 0.5f);
CumIn(Pawn, bledAmount, Translations.Menstrual_Blood, -5.0f, Pawn.RaceProps?.BloodDef ?? ThingDefOf.Filth_Blood);
Cum blood = GetNotCum(Translations.Menstrual_Blood);
if (blood != null) blood.Color = BloodColor;
@ -1580,9 +1570,6 @@ namespace RJW_Menstruation
return amount;
}
protected void EggDecay()
{
HashSet<Egg> deadeggs = new HashSet<Egg>();
@ -1602,7 +1589,7 @@ namespace RJW_Menstruation
protected void AddCrampPain()
{
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, Pawn);
hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f);
hediff.Severity = Utility.VariationRange(crampPain, 0.1f);
HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props;
Prop.severityPerDay = -hediff.Severity / (currentIntervalTicks / GenDate.TicksPerDay) * Configurations.CycleAcceleration;
Pawn.health.AddHediff(hediff, parent.Part);
@ -1659,7 +1646,7 @@ namespace RJW_Menstruation
eggnum = 1f;
}
eggnum *= ovulationFactor;
int toOvulate = (int)eggnum + eggstack;
int toOvulate = Math.Max(1, (int)eggnum + eggstack);
int ovulated = 0;
for (int i = 0; i < toOvulate; i++)
@ -1670,7 +1657,7 @@ namespace RJW_Menstruation
}
ovarypower -= ovulated;
eggstack = 0;
if (Configurations.Debug && ovulated != toOvulate)
if (Configurations.Debug && ovulated < toOvulate)
Log.Message($"{Pawn} ovulated {ovulated}/{toOvulate} eggs ({OvulationChance.ToStringPercent()} chance)");
GoNextStage(Stage.Luteal);
@ -1817,10 +1804,10 @@ namespace RJW_Menstruation
}
else pawnMemories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer);
}
else if (Pawn.relations.OpinionOf(cummer) <= -5)
pawnMemories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
else if (Pawn.IsInEstrus() && Pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
pawnMemories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer);
else if (Pawn.relations.OpinionOf(cummer) <= -5)
pawnMemories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
else if (Pawn.IsInEstrus() && Pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
pawnMemories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer);
else if (!Pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, cummer) && !Pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, cummer))
{
if (Pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) pawnMemories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer);
@ -1881,15 +1868,15 @@ namespace RJW_Menstruation
switch (stage)
{
case Stage.Follicular:
return (int)(Props.follicularIntervalDays * GenDate.TicksPerDay * (1 + Rand.Range(-cycleVariability, cycleVariability) * 1.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 1.5f));
return (int)(Utility.VariationRange(Props.follicularIntervalDays * GenDate.TicksPerDay, cycleVariability * 1.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 1.5f));
case Stage.Ovulatory:
return Props.ovulationIntervalHours * GenDate.TicksPerHour; // No variability for now
case Stage.Luteal:
return (int)(Props.lutealIntervalDays * GenDate.TicksPerDay * (1 + Rand.Range(-cycleVariability, cycleVariability) * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
return (int)(Utility.VariationRange(Props.lutealIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
case Stage.Bleeding:
return (int)(Props.bleedingIntervalDays * GenDate.TicksPerDay * (1 + Rand.Range(-cycleVariability, cycleVariability) * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
return (int)(Utility.VariationRange(Props.bleedingIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
case Stage.Recover:
return (int)(Props.recoveryIntervalDays * GenDate.TicksPerDay * Rand.Range(0.95f, 1.05f));
return (int)Utility.VariationRange(Props.recoveryIntervalDays * GenDate.TicksPerDay, 0.05f);
case Stage.Pregnant:
return (int)(MenstruationUtility.GestationHours(pregnancy) * GenDate.TicksPerHour);
default:
@ -1917,10 +1904,13 @@ namespace RJW_Menstruation
else return Rand.Range(0.6f, 1.0f);
}
protected virtual float RandomOvulationChance => (float)Props.ovulationIntervalHours / GenDate.HoursPerDay;
protected Stage RandomStage()
{
Stage stage = Rand.ElementByWeight(
Stage.Follicular, Props.follicularIntervalDays - Props.bleedingIntervalDays,
Stage.Ovulatory, RandomOvulationChance,
Stage.Luteal, Props.lutealIntervalDays,
Stage.Bleeding, Props.bleedingIntervalDays);
@ -1929,6 +1919,9 @@ namespace RJW_Menstruation
case Stage.Follicular:
curStageTicks = Rand.Range(0, (Props.follicularIntervalDays - Props.bleedingIntervalDays) * GenDate.TicksPerDay);
break;
case Stage.Ovulatory:
curStageTicks = Rand.Range(0, Props.ovulationIntervalHours * GenDate.TicksPerHour);
break;
case Stage.Luteal:
curStageTicks = Rand.Range(0, Props.lutealIntervalDays * GenDate.TicksPerDay);
break;
@ -2029,28 +2022,6 @@ namespace RJW_Menstruation
public class HediffComp_Anus : HediffComp
{
protected float? originanussize;
public float OriginAnusSize
{
get
{
if (originanussize == null)
{
originanussize = parent.Severity;
}
return originanussize ?? 0.1f;
}
}
public override void CompExposeData()
{
base.CompExposeData();
Scribe_Values.Look(ref originanussize, "originanussize", originanussize, true);
}
public override void CompPostTick(ref float severityAdjustment)
{
}
public CompProperties_Anus Props => (CompProperties_Anus)props;
}
}

View File

@ -1,5 +1,4 @@
using RimWorld;
using System.Linq;
using Verse;
namespace RJW_Menstruation
@ -29,14 +28,14 @@ namespace RJW_Menstruation
protected override void InitializeExtraValues()
{
base.InitializeExtraValues();
base.InitializeExtraValues();
if (averageCycleIntervalTicks < 0)
{
averageCycleIntervalTicks = (int)(Props.cycleIntervalDays.RandomInRange * GenDate.TicksPerDay / cycleSpeed);
if (ticksToNextCycle < -50000)
ticksToNextCycle = Rand.Range(0, averageCycleIntervalTicks);
// Make the cutoff halfway into cycle, just to be sure there isn't a double-cycle the first time
if ((curStage == Stage.Follicular || curStage == Stage.Luteal || curStage == Stage.Bleeding)
if ((curStage == Stage.Follicular || curStage == Stage.Ovulatory || curStage == Stage.Luteal || curStage == Stage.Bleeding)
&& (averageCycleIntervalTicks - ticksToNextCycle) / 2 >= GenDate.TicksPerDay * (Props.follicularIntervalDays + Props.lutealIntervalDays) / cycleSpeed)
GoNextStage(Stage.Anestrus);
}
@ -99,14 +98,14 @@ namespace RJW_Menstruation
base.PregnantAction();
if (curStage != Stage.Pregnant)
// Go halfway into the cycle
ticksToNextCycle = (int)(averageCycleIntervalTicks * (1 + Rand.Range(-cycleVariability, cycleVariability))) / 2;
ticksToNextCycle = (int)Utility.VariationRange(averageCycleIntervalTicks, cycleVariability) / 2;
}
protected override void AnestrusAction()
{
if (ticksToNextCycle <= 0 && IsBreedingSeason())
{
ticksToNextCycle = (int)(averageCycleIntervalTicks * (1 + Rand.Range(-cycleVariability, cycleVariability)));
ticksToNextCycle = (int)Utility.VariationRange(averageCycleIntervalTicks, cycleVariability);
GoNextStage(Stage.Follicular);
}
}

View File

@ -1,6 +1,7 @@

using RimWorld;
using RimWorld.Planet;
using rjw;
using System;
using System.Collections.Generic;
@ -46,6 +47,8 @@ namespace RJW_Menstruation
protected IEnumerable<Pawn> AffectedPawns()
{
if(Pawn.GetCaravan() is Caravan caravan)
foreach (Pawn p in caravan.PawnsListForReading.Where(p => p != Pawn)) yield return p;
Map mapHeld = Pawn.MapHeld;
if (mapHeld == null) yield break;
foreach (Pawn pawn in mapHeld.mapPawns.AllPawnsSpawned)

View File

@ -1,5 +1,4 @@
using HarmonyLib;
using Mono.Cecil.Cil;
using RimWorld;
using rjw;
using System;
@ -203,7 +202,7 @@ namespace RJW_Menstruation
if (comp?.HasBaby ?? false)
{
OutcomeChance thisOutcome = outcome;
Precept_Ritual precept_Ritual = (Precept_Ritual)comp.Pawn.Ideo.GetPrecept(PreceptDefOf.ChildBirth);
Precept_Ritual precept_Ritual = (Precept_Ritual)comp.Pawn.Ideo.GetPrecept(RimWorld.PreceptDefOf.ChildBirth);
float birthQuality = PregnancyUtility.GetBirthQualityFor(mother);
do
{

View File

@ -1,14 +1,10 @@
using RimWorld;
using RimWorld.Planet;
using rjw;
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Text;
using UnityEngine;
using Verse;
using Verse.AI;
namespace RJW_Menstruation
{
@ -141,7 +137,7 @@ namespace RJW_Menstruation
else if (gestationProgress < 0.8f) icon = fetustex + "04";
else icon = fetustex + "05";
return TryGetTwinsIcon(icon, babycount) ?? ContentFinder<Texture2D>.Get((icon), true);
return TryGetTwinsIcon(icon, babycount) ?? ContentFinder<Texture2D>.Get(icon, true);
}
public static Texture2D TryGetTwinsIcon(string path, int babycount)
@ -160,7 +156,7 @@ namespace RJW_Menstruation
List<Hediff_InsectEgg> insectEggs = new List<Hediff_InsectEgg>();
comp.Pawn.health.hediffSet.GetHediffs(ref insectEggs);
if (!insectEggs.NullOrEmpty() && insectEggs.Sum(hediff => hediff.eggssize) > 1.0f) return null; // same logic as "Stuffed" in GetInsectEggedIcon
if (insectEggs?.Sum(hediff => hediff.eggssize) > 1.0f) return null; // same logic as "Stuffed" in GetInsectEggedIcon
string icon = comp.WombTex;
float cumpercent = comp.TotalCumPercent;
@ -183,7 +179,7 @@ namespace RJW_Menstruation
else if (cumpercent < 0.89f) icon += "_Cum_15";
else if (cumpercent < 0.95f) icon += "_Cum_16";
else icon += "_Cum_17";
Texture2D cumtex = ContentFinder<Texture2D>.Get((icon), true);
Texture2D cumtex = ContentFinder<Texture2D>.Get(icon, true);
return cumtex;
}
public static Texture2D GetInsectEggedIcon(this HediffComp_Menstruation comp)
@ -306,15 +302,13 @@ namespace RJW_Menstruation
}
public static Texture2D GetGenitalIcon(this Pawn pawn, HediffComp_Menstruation comp, bool drawOrigin = false)
public static Texture2D GetGenitalIcon(this Pawn pawn, HediffComp_Menstruation comp)
{
Hediff hediff = comp?.parent;
if (hediff == null) return ContentFinder<Texture2D>.Get("Genitals/Vagina00", true);
//HediffComp_Menstruation comp = hediff.GetMenstruationComp();
string icon;
float severity;
if (drawOrigin) severity = comp.OriginVagSize;
else severity = hediff.Severity;
float severity = hediff.Severity;
if (comp != null) icon = comp.VagTex;
else icon = "Genitals/Vagina";
@ -331,30 +325,18 @@ namespace RJW_Menstruation
else if (severity < 1.01f) icon += "10"; //cavernous
else icon += "11"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
return ContentFinder<Texture2D>.Get(icon, true);
}
public static Texture2D GetAnalIcon(this Pawn pawn, bool drawOrigin = false)
public static Texture2D GetAnalIcon(this Pawn pawn)
{
Hediff hediff = pawn.health.hediffSet.hediffs.FirstOrDefault(h => VariousDefOf.AllAnuses.Contains(h.def)) ??
pawn.health.hediffSet.hediffs.FirstOrDefault(h => h.def.defName.ToLower().Contains("anus"));
if (hediff == null) return ContentFinder<Texture2D>.Get(("Genitals/Anal00"), true);
if (hediff == null) return ContentFinder<Texture2D>.Get("Genitals/Anal00", true);
string icon = ((CompProperties_Anus)hediff.GetAnusComp()?.props)?.analTex ?? "Genitals/Anal";
float severity = hediff.Severity;
string icon;
float severity;
HediffComp_Anus comp = hediff.GetAnusComp();
if (comp != null)
{
CompProperties_Anus Props = (CompProperties_Anus)comp.props;
icon = Props.analTex ?? "Genitals/Anal";
if (drawOrigin) severity = comp.OriginAnusSize;
else severity = hediff.Severity;
}
else
{
icon = "Genitals/Anal";
severity = hediff.Severity;
}
if (severity < 0.20f) icon += "00"; //micro
else if (severity < 0.40f) icon += "01"; //tight
else if (severity < 0.60f) icon += "02"; //average
@ -362,7 +344,7 @@ namespace RJW_Menstruation
else if (severity < 1.01f) icon += "04"; //cavernous
else icon += "05"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
return ContentFinder<Texture2D>.Get(icon, true);
}
public static float GestationHours(this Hediff hediff)
@ -398,7 +380,8 @@ namespace RJW_Menstruation
if (!Configurations.EnableAnimalCycle && pawn.IsAnimal()) return false;
if (pawn.GetComp<CompEggLayer>() != null) return false;
if (pawn.RaceHasOviPregnancy()) return false;
if (ModsConfig.BiotechActive && pawn.genes != null &&
if (ModsConfig.BiotechActive && pawn.genes != null &&
pawn.genes.GenesListForReading.Select(gene => gene.def).Intersect(VariousDefOf.EggLayerGenes).Any()) return false;
return true;
@ -452,7 +435,7 @@ namespace RJW_Menstruation
if (precept != null) return true;
else return pawn.IsBreeder() ||
pawn.HasImpregnationFetish();
pawn.HasImpregnationFetish();
}
public static float DamagePants(this Pawn pawn, float fluidAmount)

View File

@ -1,5 +1,4 @@
using RimWorld;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Verse;

View File

@ -1,10 +1,7 @@
using RimWorld;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Verse;
namespace RJW_Menstruation

View File

@ -0,0 +1,15 @@
using Verse;
namespace RJW_Menstruation
{
public class MenstruationModExtension : DefModExtension
{
public float eggLifeTimeFactor = 1.0f;
public bool neverEstrus = false;
public bool alwaysEstrus = false;
public float ovulationFactor = 1.0f;
public bool noBleeding = false;
public bool disableCycle = false;
}
}

View File

@ -1,11 +1,11 @@
using HarmonyLib;
using System.Linq;
using RimWorld;
using Verse;
using System.Collections.Generic;
using System.Reflection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using Verse;
namespace RJW_Menstruation
{
@ -195,8 +195,9 @@ namespace RJW_Menstruation
[HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")]
public class Notify_GenesChanged_Patch
{
public static void Postfix(Pawn_GeneTracker __instance)
public static void Postfix(Pawn_GeneTracker __instance, GeneDef addedOrRemovedGene)
{
if (!addedOrRemovedGene.HasModExtension<MenstruationModExtension>()) return;
foreach (HediffComp_Menstruation comp in __instance.pawn.GetMenstruationComps())
comp.Notify_UpdatedGenes();
}

View File

@ -2,7 +2,6 @@
using RimWorld;
using rjw;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using Verse;

View File

@ -1,5 +1,4 @@
using AlienRace;
using HarmonyLib;
using HarmonyLib;
using rjw;
using rjw.Modules.Interactions.Internals.Implementation;
using rjw.Modules.Interactions.Rules.PartKindUsageRules;

View File

@ -1,6 +1,5 @@
using HarmonyLib;
using RimWorld;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -20,9 +20,8 @@ namespace RJW_Menstruation
StringBuilder res = new StringBuilder();
IEnumerable<Pawn> babiesdistinct = babies.Distinct(new RaceComparer());
int iteration = 0;
foreach (Pawn baby in babiesdistinct)
foreach (Pawn baby in babies.Distinct(new RaceComparer()))
{
int num = babies.Where(x => x.def.Equals(baby.def)).Count();
if (iteration > 0) res.Append(", ");
@ -43,9 +42,8 @@ namespace RJW_Menstruation
if (!is_parent_known && Configurations.InfoDetail != Configurations.DetailLevel.All)
return res.Append(Translations.Dialog_FatherUnknown).ToString();
IEnumerable<Pawn> babiesdistinct = babies.Distinct(new FatherComparer(mother));
int iteration = 0;
foreach (Pawn baby in babiesdistinct)
foreach (Pawn baby in babies.Distinct(new FatherComparer(mother)))
{
if (iteration > 0) res.Append(", ");
res.Append(Utility.GetFather(baby, mother)?.LabelShort ?? Translations.Dialog_FatherUnknown);

View File

@ -74,6 +74,7 @@
<Compile Include="HediffComps\MenstruationUtility.cs" />
<Compile Include="Hediff_Estrus.cs" />
<Compile Include="IngestionOutcomeDoers.cs" />
<Compile Include="MenstruationModExtension.cs" />
<Compile Include="Patch\Biotech_Patch.cs" />
<Compile Include="Patch\GC_Patch.cs" />
<Compile Include="Patch\Gizmo_Patch.cs" />
@ -108,10 +109,6 @@
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\2830943477\1.4\Assemblies\AnimalGenetics.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">
<HintPath>..\..\..\..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
@ -172,6 +169,9 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref">
<Version>1.4.3901</Version>
</PackageReference>
<PackageReference Include="Lib.Harmony">
<Version>2.2.2</Version>
<ExcludeAssets>runtime</ExcludeAssets>

View File

@ -219,14 +219,14 @@ namespace RJW_Menstruation
public void CheckDirty()
{
if (absorbedfluids > this.GetStatValue(VariousDefOf.MaxAbsorbable) && !(Wearer?.apparel?.IsLocked(this) ?? false))
if (absorbedfluids > this.GetStatValue(VariousDefOf.MaxAbsorbable) && !(Wearer?.apparel?.IsLocked(this) ?? false) && DirtyDef != def && DirtyDef != null)
{
bool oldHasStats = !def.equippedStatOffsets.NullOrEmpty();
bool newHasStats = !DirtyDef.equippedStatOffsets.NullOrEmpty();
def = DirtyDef;
dirty = true;
OutfitForcedHandler forcedHandler = Wearer.outfits?.forcedHandler;
if (forcedHandler?.IsForced(this) ?? false)
forcedHandler.SetForced(this, false);
if (!def.equippedStatOffsets.NullOrEmpty())
Wearer.outfits?.forcedHandler?.SetForced(this, false);
if (oldHasStats || newHasStats)
Wearer.health.capacities.Notify_CapacityLevelsDirty();
Wearer.apparel.Notify_ApparelChanged();
}
@ -272,7 +272,7 @@ namespace RJW_Menstruation
public override void DirtyEffect(int tickInterval)
{
if (wearTicks > MinHrstoDirtyEffect * GenDate.TicksPerHour && Rand.MTBEventOccurs(100.0f, GenDate.TicksPerHour, tickInterval) && !Wearer.apparel.IsLocked(this))
if (wearTicks > MinHrstoDirtyEffect * GenDate.TicksPerHour && Rand.MTBEventOccurs(100.0f, GenDate.TicksPerHour, tickInterval) && !(Wearer.apparel?.IsLocked(this) ?? false))
{
Wearer.health.AddHediff(HediffDefOf.WoundInfection, Genital_Helper.get_genitalsBPR(Wearer));
}

View File

@ -227,7 +227,7 @@ namespace RJW_Menstruation
string feinfo = PregnancyCommon.GetBabyInfo(babiescomp?.babies);
string fainfo = PregnancyCommon.GetFatherInfo(babiescomp?.babies, babiescomp.Pawn, true) + " "; // Keep all parents known, for now
if (feinfo == "Null") feinfo = "1 " + p.Mother.def.label + " " + Translations.Dialog_WombInfo02;
if (feinfo == "Null") feinfo = "1 " + (p.Mother ?? pawn).def.label + " " + Translations.Dialog_WombInfo02;
if (fainfo == "Null ")
{
string father = p.Father?.LabelShort ?? Translations.Dialog_FatherUnknown;
@ -388,10 +388,9 @@ namespace RJW_Menstruation
Rect genitalIconRect = new Rect(rect.x, rect.y + fontheight, genitalRectWidth, genitalRectHeight);
Rect genitalVaginaLabelRect = new Rect(rect.x, rect.y + 10f, genitalRectWidth, fontheight);
Rect genitalAnusLabelRect = new Rect(rect.x, rect.y + fontheight + genitalRectHeight, genitalRectWidth, fontheight);
bool showOrigin = Mouse.IsOver(genitalIconRect) && Input.GetMouseButton(0);
vagina = pawn.GetGenitalIcon(comp, showOrigin);
anal = pawn.GetAnalIcon(showOrigin);
vagina = pawn.GetGenitalIcon(comp);
anal = pawn.GetAnalIcon();
GUI.color = new Color(1.00f, 0.47f, 0.47f, 1);
GUI.Box(rect, "", boxstyle);
GUI.color = Utility.SafeSkinColor(pawn);

View File

@ -80,7 +80,7 @@ namespace RJW_Menstruation
try
{
res = part.FluidAmmount * part.FluidModifier * pawn.BodySize / pawn.RaceProps.baseBodySize * Rand.Range(0.8f, 1.2f);
res = VariationRange(part.FluidAmmount * part.FluidModifier * pawn.BodySize / pawn.RaceProps.baseBodySize, 0.2f);
}
catch (NullReferenceException)
{

View File

@ -45,14 +45,6 @@ namespace RJW_Menstruation
public static readonly RecordDef AmountofCreampied = DefDatabase<RecordDef>.GetNamed("AmountofCreampied");
public static readonly RecordDef AmountofFertilizedEggs = DefDatabase<RecordDef>.GetNamed("AmountofFertilizedEggs");
public static readonly TaleDef TaleCameInside = DefDatabase<TaleDef>.GetNamed("CameInside");
public static readonly GeneDef ShortEggLifetime = DefDatabase<GeneDef>.GetNamed("Menstruation_ShortEggLifetime");
public static readonly GeneDef DoubleEggLifetime = DefDatabase<GeneDef>.GetNamed("Menstruation_DoubleEggLifetime");
public static readonly GeneDef QuadEggLifetime = DefDatabase<GeneDef>.GetNamed("Menstruation_QuadEggLifetime");
public static readonly GeneDef NeverEstrus = DefDatabase<GeneDef>.GetNamed("Menstruation_NeverEstrus");
public static readonly GeneDef FullEstrus = DefDatabase<GeneDef>.GetNamed("Menstruation_FullEstrus");
public static readonly GeneDef DoubleOvulation = DefDatabase<GeneDef>.GetNamed("Menstruation_DoubleOvulation");
public static readonly GeneDef QuadOvulation = DefDatabase<GeneDef>.GetNamed("Menstruation_QuadOvulation");
public static readonly GeneDef NoBleeding = DefDatabase<GeneDef>.GetNamed("Menstruation_NoBleeding");
private static List<ThingDef> allraces = null;
private static List<PawnKindDef> allkinds = null;
@ -66,9 +58,8 @@ namespace RJW_Menstruation
get
{
if (allraces != null) return allraces;
allraces = DefDatabase<ThingDef>.AllDefsListForReading.Where(thingdef => thingdef.race?.IsFlesh ?? false).ToList();
List<ThingDef> allThings = DefDatabase<ThingDef>.AllDefsListForReading;
allraces = allThings.FindAll(x => x.race != null && x.race.IsFlesh);
return allraces;
}
}
@ -77,9 +68,8 @@ namespace RJW_Menstruation
get
{
if (allkinds != null) return allkinds;
allkinds = DefDatabase<PawnKindDef>.AllDefsListForReading.Where(pawnkinddef => pawnkinddef.race != null).ToList();
List<PawnKindDef> allKinds = DefDatabase<PawnKindDef>.AllDefsListForReading;
allkinds = allKinds.FindAll(x => x.race != null);
return allkinds;
}
}
@ -157,13 +147,7 @@ namespace RJW_Menstruation
get
{
if (egglayergenes != null) return egglayergenes;
egglayergenes = new HashSet<GeneDef>
{
DefDatabase<GeneDef>.GetNamedSilentFail("AG_EggLaying"), // Alpha Genes
DefDatabase<GeneDef>.GetNamedSilentFail("VRESaurids_Oviparous"), // VE Saurid
DefDatabase<GeneDef>.GetNamedSilentFail("VRE_SaplingBirth"), // VE Phytokin
};
egglayergenes.Remove(null);
egglayergenes = DefDatabase<GeneDef>.AllDefsListForReading.Where(geneDef => geneDef.GetModExtension<MenstruationModExtension>()?.disableCycle ?? false).ToHashSet();
return egglayergenes;
}

View File

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<packageId>rjw.menstruation</packageId>
<name>RJW Menstruation Cycle</name>
<author>lutepickle</author>
<url>https://gitgud.io/lutepickle/rjw_menstruation/</url>
<supportedVersions>
<li>1.2</li>
<li>1.3</li>
@ -28,13 +30,17 @@
<li>Abraxas.RJW.RaceSupport</li>
<li>rjw.milk.humanoid</li>
</loadAfter>
<packageId>rjw.menstruation</packageId>
<incompatibleWithByVersion>
<v1.4>
<li>conit.thebirdsandthebees</li> <!--Breaks fertility calculations-->
</v1.4>
</incompatibleWithByVersion>
<description>Adds menstruation mechanics to vaginas:
Wombs cycle between follicular, luteal, and bleeding phases
Tracks eggs ovulated and cum in wombs to determine pregnancy
Womb icon and status window
Estrus effects
Estrus and pheromone effects
Race-specific fetus images for many vanilla animals
Pregnancies from multiple eggs and different fathers
Identical siblings

View File

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

View File

@ -1,3 +1,8 @@
Version 1.0.9.4
- Added graphics for the menstruation genes with thanks to Alpenglow.
- Pawns in estrus now give their pheromones to their caravan-mates.
- Pawns with the egglaying genes from Erin's Corvyia and Outland - Genetics no longer have a menstrual cycle.
Version 1.0.9.3
- The biosculptor egg restoration cycle will now give more eggs to races that ovulate more than one egg at a time.
- All pawns can now use all menstruation genes, regardless of gender or having a womb.