mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Compare commits
6 commits
ebf7efb730
...
75950b6864
Author | SHA1 | Date | |
---|---|---|---|
|
75950b6864 | ||
|
3f6904aa8e | ||
|
980458e4fa | ||
|
991edfdff0 | ||
|
832c3aa0b8 | ||
|
7339bd41a1 |
16 changed files with 265 additions and 194 deletions
22
CHANGELOG.md
22
CHANGELOG.md
|
@ -22,6 +22,8 @@ Most of the genes so far were positive or neutral,
|
|||
so I got some fair requests to introduce negative genes to keep xenotypes balanced.
|
||||
I know that this is some overlap with the STD mod, but well ... you are free to turn things off?
|
||||
|
||||
In theory, you can specify and gene of any kind to be spreadable by sex, not only ones written by this mod.
|
||||
|
||||
**Genetic Infectors**:
|
||||
|
||||
These Genes can apply a genetic disease, but are not genetic diseases themselves.
|
||||
|
@ -80,12 +82,20 @@ but they are meant mostly to have infectors immune against their own diseases.
|
|||
- Gene: Hardwired Progenity. Pawns with this get a malus on having no-children, and bonus on having a lot.
|
||||
- Gene: Sexual Genetic Swap. Pawns have a chance to switch a random gene with their sexpartner.
|
||||
- (Archite) Gene: Sexual Genetic Thief. Pawns have a chance to steal a gene from their sexpartner. Genetic Disease Immunity shields against this.
|
||||
- Gene: Sperm Displacement. Pawns might overwrite an existing pregnancy, becoming the new father. The pregnancy will stay in its gestation progress.
|
||||
- Pawns will have negative thoughts about pawns with more genetic diseases than themselves.
|
||||
- Faction Penalties for spreading diseases, stealing genes and aging pawns with age transfer
|
||||
- Patch for [Imphilee Xeno](https://steamcommunity.com/sharedfiles/filedetails/?id=2990674516) by @Bunuffin
|
||||
|
||||
**Changes**::
|
||||
|
||||
- Cum-Amount-Changing genes now are XML Adjustable and share a single `.cs`-class
|
||||
- Incubi are now Bisexual too, as they should be.
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Fixed an Issue where pawns would always get the Pheromone social boost, unless they had the pheromone (#113)
|
||||
- Fixed two hidden dependencies on Ideology and Royalty (#115)
|
||||
|
||||
**Internal:**
|
||||
|
||||
|
@ -93,6 +103,18 @@ but they are meant mostly to have infectors immune against their own diseases.
|
|||
- Introduced a `ModLog.Debug` Function that checks for the settings before printing - trying to spread it over the whole project.
|
||||
- Removed TODO File. I have enough to do.
|
||||
|
||||
**Notes:**
|
||||
|
||||
The changes to the cum-gene will give a 1-time warning on loading the save. The warning looks like this:
|
||||
```
|
||||
Could not find class RJW_Genes.Gene_MuchCum while resolving node li. Trying to use Verse.Gene instead. Full node: <li Class="RJW_Genes.Gene_MuchCum"><def>rjw_genes_much_cum</def><pawn>Thing_Human697</pawn><overriddenByGene>null</overriddenByGene><loadID>82</loadID></li>
|
||||
UnityEngine.StackTraceUtility:ExtractStackTrace ()
|
||||
Verse.Log:Error (string)
|
||||
...
|
||||
```
|
||||
|
||||
This is not dangerous.
|
||||
|
||||
# 2.1.0 (27-06-2024)
|
||||
|
||||
**Additions**:
|
||||
|
|
|
@ -153,15 +153,4 @@
|
|||
<biostatMet>0</biostatMet>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="BreedingBase">
|
||||
<defName>rjw_genes_pregnancy_overwrite</defName>
|
||||
<label>Sperm Displacement</label>
|
||||
<description>Carriers of this gene can 'overwrite' an existing pregnancy, keeping the progress but effectively replacing the father.</description>
|
||||
<iconPath>Genes/Icons/RJW_Genes_PheromoneSpit</iconPath>
|
||||
<displayOrderInCategory>75</displayOrderInCategory>
|
||||
|
||||
<biostatCpx>4</biostatCpx>
|
||||
<biostatMet>-2</biostatMet>
|
||||
</GeneDef>
|
||||
|
||||
</Defs>
|
|
@ -21,10 +21,15 @@
|
|||
<label>no cum</label>
|
||||
<description>Males of these species have no fluid.</description>
|
||||
<iconPath>Genes/Icons/No_Cum</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NoCum</geneClass>
|
||||
<geneClass>RJW_Genes.Gene_ChangeCumAmount</geneClass>
|
||||
<displayOrderInCategory>533</displayOrderInCategory>
|
||||
<biostatCpx>0</biostatCpx>
|
||||
<biostatMet>1</biostatMet>
|
||||
<modExtensions>
|
||||
<li Class="RJW_Genes.MultiplierExtension">
|
||||
<multiplier>0.0</multiplier>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneCumAmount">
|
||||
|
@ -32,10 +37,15 @@
|
|||
<label>much cum</label>
|
||||
<description>Males of this species produce a lot of fluid.</description>
|
||||
<iconPath>Genes/Icons/Much_Cum</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_MuchCum</geneClass>
|
||||
<geneClass>RJW_Genes.Gene_ChangeCumAmount</geneClass>
|
||||
<displayOrderInCategory>534</displayOrderInCategory>
|
||||
<biostatCpx>1</biostatCpx>
|
||||
<biostatMet>-1</biostatMet>
|
||||
<biostatMet>0</biostatMet>
|
||||
<modExtensions>
|
||||
<li Class="RJW_Genes.MultiplierExtension">
|
||||
<multiplier>3.0</multiplier>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneCumAmount">
|
||||
|
@ -44,10 +54,15 @@
|
|||
<description>Males of this species produce a whole lot of fluid. They are like fountains
|
||||
basically.</description>
|
||||
<iconPath>Genes/Icons/Very_Much_Cum</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_VeryMuchCum</geneClass>
|
||||
<geneClass>RJW_Genes.Gene_ChangeCumAmount</geneClass>
|
||||
<displayOrderInCategory>535</displayOrderInCategory>
|
||||
<biostatCpx>1</biostatCpx>
|
||||
<biostatMet>-2</biostatMet>
|
||||
<biostatMet>-1</biostatMet>
|
||||
<modExtensions>
|
||||
<li Class="RJW_Genes.MultiplierExtension">
|
||||
<multiplier>15.0</multiplier>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</GeneDef>
|
||||
|
||||
</Defs>
|
|
@ -115,7 +115,6 @@
|
|||
</li>
|
||||
</forcedTraits>
|
||||
<exclusionTags>
|
||||
|
||||
<li>rjw_genes_homosexuality_trait_giver</li>
|
||||
<li>rjw_genes_sexual_orientation</li>
|
||||
</exclusionTags>
|
||||
|
@ -144,7 +143,7 @@
|
|||
</li>
|
||||
</forcedTraits>
|
||||
<exclusionTags>
|
||||
<li>rjw_genes_sexual_orientation</li>
|
||||
<li>rjw_genes_sexual_orientation</li>
|
||||
<li>rjw_genes_bisexuality_trait_giver</li>
|
||||
</exclusionTags>
|
||||
|
||||
|
@ -207,4 +206,28 @@
|
|||
</exclusionTags>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_pregnancy_overwrite</defName>
|
||||
<label>Sperm Displacement</label>
|
||||
<displayCategory>Reproduction</displayCategory>
|
||||
<description>Carriers of this gene can 'overwrite' an existing pregnancy, keeping the
|
||||
progress but effectively replacing the father.</description>
|
||||
<iconPath>Genes/Icons/RJW_Genes_PheromoneSpit</iconPath>
|
||||
<displayOrderInCategory>120</displayOrderInCategory>
|
||||
|
||||
<biostatCpx>4</biostatCpx>
|
||||
<biostatMet>-2</biostatMet>
|
||||
<modExtensions>
|
||||
<!-- DevNote: The chance will be multiplied by both pawns' Fertility! -->
|
||||
<li Class="RJW_Genes.ChanceExtension">
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
<li MayRequire="OskarPotocki.VanillaFactionsExpanded.Core"
|
||||
Class="VanillaGenesExpanded.GeneExtension">
|
||||
<backgroundPathEndogenes>Genes/Icons/RJW_Genes_Endogene_Background</backgroundPathEndogenes>
|
||||
<backgroundPathXenogenes>Genes/Icons/RJW_Genes_Xenogene_Background</backgroundPathXenogenes>
|
||||
</li>
|
||||
</modExtensions>
|
||||
</GeneDef>
|
||||
|
||||
</Defs>
|
|
@ -75,6 +75,7 @@
|
|||
</doubleXenotypeChances>
|
||||
<genes>
|
||||
<li>rjw_genes_hypersexual</li>
|
||||
<li>rjw_genes_bisexual</li>
|
||||
<li>rjw_genes_male_only</li>
|
||||
<li>rjw_genes_lifeforce</li>
|
||||
<li>rjw_genes_lifeforce_drain</li>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Defs>
|
||||
|
||||
|
||||
<HediffDef>
|
||||
<defName>rjw_genes_fertilin_lost</defName>
|
||||
<hediffClass>Hediff_HemogenCraving</hediffClass>
|
||||
|
@ -19,12 +19,13 @@
|
|||
</li>
|
||||
</stages>
|
||||
</HediffDef>
|
||||
|
||||
|
||||
<HediffDef>
|
||||
<defName>rjw_genes_succubus_drained</defName>
|
||||
<hediffClass>HediffWithComps</hediffClass>
|
||||
<label>Drained</label>
|
||||
<description>The vitality of this pawn has been drained. Cannot be drained again until fully recovered.</description>
|
||||
<description>The vitality of this pawn has been drained. Cannot be drained again until fully
|
||||
recovered.</description>
|
||||
<defaultLabelColor>(1,0,0.5)</defaultLabelColor>
|
||||
<maxSeverity>1.0</maxSeverity>
|
||||
<initialSeverity>1.0</initialSeverity>
|
||||
|
@ -74,13 +75,13 @@
|
|||
<statOffsets>
|
||||
<WorkSpeedGlobal>-0.2</WorkSpeedGlobal>
|
||||
</statOffsets>
|
||||
<vomitMtbDays>0.4</vomitMtbDays>
|
||||
<vomitMtbDays>0.4</vomitMtbDays>
|
||||
<hungerRateFactorOffset>0.1</hungerRateFactorOffset>
|
||||
<restFallFactorOffset>0.35</restFallFactorOffset>
|
||||
</li>
|
||||
</stages>
|
||||
</HediffDef>
|
||||
|
||||
|
||||
<HediffDef>
|
||||
<defName>rjw_genes_fertilin_craving</defName>
|
||||
<label>fertilin craving</label>
|
||||
|
@ -90,77 +91,78 @@
|
|||
<maxSeverity>1.0</maxSeverity>
|
||||
<initialSeverity>0.01</initialSeverity>
|
||||
<stages>
|
||||
<li>
|
||||
<label>minor</label>
|
||||
<painOffset>0.05</painOffset>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<setMax>0.9</setMax>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
<li>
|
||||
<label>moderate</label>
|
||||
<minSeverity>0.35</minSeverity>
|
||||
<painOffset>0.1</painOffset>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<setMax>0.8</setMax>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
<li>
|
||||
<label>major</label>
|
||||
<minSeverity>0.7</minSeverity>
|
||||
<painOffset>0.15</painOffset>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<setMax>0.5</setMax>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
<li>
|
||||
<label>minor</label>
|
||||
<painOffset>0.05</painOffset>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<setMax>0.9</setMax>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
<li>
|
||||
<label>moderate</label>
|
||||
<minSeverity>0.35</minSeverity>
|
||||
<painOffset>0.1</painOffset>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<setMax>0.8</setMax>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
<li>
|
||||
<label>major</label>
|
||||
<minSeverity>0.7</minSeverity>
|
||||
<painOffset>0.15</painOffset>
|
||||
<capMods>
|
||||
<li>
|
||||
<capacity>Consciousness</capacity>
|
||||
<setMax>0.5</setMax>
|
||||
</li>
|
||||
</capMods>
|
||||
</li>
|
||||
</stages>
|
||||
<comps>
|
||||
<li Class="RJW_Genes.HediffCompProperties_SeverityFromFertilin">
|
||||
<severityPerHourEmpty>0.05</severityPerHourEmpty>
|
||||
<severityPerHourHemogen>-0.1</severityPerHourHemogen>
|
||||
</li>
|
||||
<li Class="RJW_Genes.HediffCompProperties_SeverityFromFertilin">
|
||||
<severityPerHourEmpty>0.05</severityPerHourEmpty>
|
||||
<severityPerHourHemogen>-0.1</severityPerHourHemogen>
|
||||
</li>
|
||||
</comps>
|
||||
</HediffDef>
|
||||
|
||||
<HediffDef ParentName="RoleStatBuff">
|
||||
<defName>rjw_genes_naked_prowess</defName>
|
||||
<label>naked prowss</label>
|
||||
<description>Driven by fertilin, this person has greatly increased strength and resilience.</description>
|
||||
<hediffClass>HediffWithComps</hediffClass>
|
||||
<stages>
|
||||
<li>
|
||||
<!--Maybe a bit to much, but they are supposed to be strong-->
|
||||
<statOffsets>
|
||||
<ArmorRating_Sharp>0.5</ArmorRating_Sharp>
|
||||
<ArmorRating_Blunt>0.5</ArmorRating_Blunt>
|
||||
<ArmorRating_Heat>0.5</ArmorRating_Heat>
|
||||
<!-- <Insulation_Cold>10</Insulation_Cold>
|
||||
<Insulation_Heat>10</Insulation_Heat> -->
|
||||
</statOffsets>
|
||||
<statFactors>
|
||||
<IncomingDamageFactor>0.5</IncomingDamageFactor>
|
||||
<MeleeDamageFactor>1.5</MeleeDamageFactor>
|
||||
</statFactors>
|
||||
</li>
|
||||
</stages>
|
||||
<comps>
|
||||
<li Class="HediffCompProperties_Disappears">
|
||||
<showRemainingTime>True</showRemainingTime>
|
||||
<disappearsAfterTicks>5000</disappearsAfterTicks> <!-- 2 hours -->
|
||||
</li>
|
||||
<li Class="HediffCompProperties_DisappearsOnDeath"/>
|
||||
<!--TODO: Make hediff disappear if pawn is nolonger naked-->
|
||||
</comps>
|
||||
<isBad>false</isBad>
|
||||
</HediffDef>
|
||||
<HediffDef>
|
||||
<defName>rjw_genes_naked_prowess</defName>
|
||||
<defaultLabelColor>(0.52, 1, 0.95)</defaultLabelColor>
|
||||
<label>naked prowss</label>
|
||||
<description>Driven by fertilin, this person has greatly increased strength and resilience.</description>
|
||||
<hediffClass>HediffWithComps</hediffClass>
|
||||
<stages>
|
||||
<li>
|
||||
<!--Maybe
|
||||
a bit to much, but they are supposed to be strong-->
|
||||
<statOffsets>
|
||||
<ArmorRating_Sharp>0.5</ArmorRating_Sharp>
|
||||
<ArmorRating_Blunt>0.5</ArmorRating_Blunt>
|
||||
<ArmorRating_Heat>0.5</ArmorRating_Heat>
|
||||
</statOffsets>
|
||||
<statFactors>
|
||||
<IncomingDamageFactor>0.5</IncomingDamageFactor>
|
||||
<MeleeDamageFactor>1.5</MeleeDamageFactor>
|
||||
</statFactors>
|
||||
</li>
|
||||
</stages>
|
||||
<comps>
|
||||
<li Class="HediffCompProperties_Disappears">
|
||||
<showRemainingTime>True</showRemainingTime>
|
||||
<disappearsAfterTicks>5000</disappearsAfterTicks> <!-- 2 hours -->
|
||||
</li>
|
||||
<li Class="HediffCompProperties_DisappearsOnDeath" />
|
||||
<!--TODO:
|
||||
Make hediff disappear if pawn is nolonger naked-->
|
||||
</comps>
|
||||
<isBad>false</isBad>
|
||||
</HediffDef>
|
||||
|
||||
</Defs>
|
||||
</Defs>
|
|
@ -13,7 +13,7 @@
|
|||
<li>
|
||||
<minSeverity>0</minSeverity>
|
||||
<statOffsets>
|
||||
<SlaveSuppressionOffset>0.40</SlaveSuppressionOffset>
|
||||
<SlaveSuppressionOffset MayRequire="Ideology">0.40</SlaveSuppressionOffset>
|
||||
<Vulnerability>3.0</Vulnerability>
|
||||
</statOffsets>
|
||||
<capMods>
|
||||
|
|
|
@ -10,4 +10,9 @@
|
|||
<label>Youthed a pawn with youth fountain</label>
|
||||
</HistoryEventDef>
|
||||
|
||||
<HistoryEventDef>
|
||||
<defName>rjw_genes_GoodwillChangedReason_OverwritePregnancy</defName>
|
||||
<label>Replaced a pregnancy</label>
|
||||
</HistoryEventDef>
|
||||
|
||||
</Defs>
|
36
Common/Patches/Xenotypes/PatchImphileeXeno.xml
Normal file
36
Common/Patches/Xenotypes/PatchImphileeXeno.xml
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Patch>
|
||||
<Operation Class="PatchOperationSequence">
|
||||
<operations>
|
||||
<li Class="PatchOperationFindMod">
|
||||
<mods>
|
||||
<li>Imphilee Xeno</li>
|
||||
</mods>
|
||||
<match Class="PatchOperationAdd">
|
||||
<xpath>Defs/XenotypeDef[defName="LD_Imphilee"]/genes</xpath>
|
||||
<value>
|
||||
<li>rjw_genes_tight_female_genitalia</li>
|
||||
<li>rjw_genes_small_breasts</li>
|
||||
<li MayRequire="LustLicentia.RJWLabs">rjw_genes_elasticity</li>
|
||||
<li>rjw_genes_demonic_genitalia</li>
|
||||
</value>
|
||||
</match>
|
||||
</li>
|
||||
<li Class="PatchOperationFindMod">
|
||||
<mods>
|
||||
<li>Imphilee Xeno</li>
|
||||
</mods>
|
||||
<match Class="PatchOperationAdd">
|
||||
<xpath>Defs/XenotypeDef[defName="LD_Imphilee_Overlord"]/genes</xpath>
|
||||
<value>
|
||||
<li>rjw_genes_tight_female_genitalia</li>
|
||||
<li>rjw_genes_small_breasts</li>
|
||||
<li MayRequire="LustLicentia.RJWLabs">rjw_genes_elasticity</li>
|
||||
<li>rjw_genes_demonic_genitalia</li>
|
||||
<li>rjw_genes_rapist</li>
|
||||
</value>
|
||||
</match>
|
||||
</li>
|
||||
</operations>
|
||||
</Operation>
|
||||
</Patch>
|
14
Source/Common/Defs/MultiplierExtension.cs
Normal file
14
Source/Common/Defs/MultiplierExtension.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class MultiplierExtension : DefModExtension
|
||||
{
|
||||
public float multiplier;
|
||||
}
|
||||
}
|
|
@ -34,8 +34,23 @@ namespace RJW_Genes
|
|||
|
||||
}
|
||||
|
||||
//Get total fluidamount a person has.
|
||||
public static float GetTotalFluidAmount(Pawn pawn, float multiplier = 1f)
|
||||
/// <summary>
|
||||
/// Looks up the "MultiplierExtensions" Value for a given Gene, with a fall back.
|
||||
/// Returns the fallback if there is no Extension, or if the Multiplier is smaller than 0.
|
||||
/// </summary>
|
||||
|
||||
public static float LookupCumMultiplier(Gene gene, float FALLBACK = 3.0f) => LookupCumMultiplier(gene.def,FALLBACK);
|
||||
public static float LookupCumMultiplier(GeneDef def, float FALLBACK = 3.0f)
|
||||
{
|
||||
MultiplierExtension multiplier = def.GetModExtension<MultiplierExtension>();
|
||||
if (multiplier == null || multiplier.multiplier < 0)
|
||||
return FALLBACK;
|
||||
else return multiplier.multiplier;
|
||||
}
|
||||
|
||||
|
||||
//Get total fluidamount a person has.
|
||||
public static float GetTotalFluidAmount(Pawn pawn, float multiplier = 1f)
|
||||
{
|
||||
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
|
||||
var parts = Genital_Helper.get_PartsHediffList(pawn, partBPR);
|
||||
|
|
|
@ -1,36 +1,38 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_MuchCum : RJW_Gene
|
||||
public class Gene_ChangeCumAmount : RJW_Gene
|
||||
{
|
||||
bool has_been_fired = false;
|
||||
|
||||
float multiplier_much_cum = 3f;
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum);
|
||||
float multipier = CumUtility.LookupCumMultiplier(this);
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, multipier);
|
||||
has_been_fired = true;
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
if (!has_been_fired) {
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum);
|
||||
if (!has_been_fired)
|
||||
{
|
||||
float multipier = CumUtility.LookupCumMultiplier(this);
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, multipier);
|
||||
has_been_fired = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void PostRemove()
|
||||
{
|
||||
base.PostAdd();
|
||||
|
||||
if (has_been_fired)
|
||||
{
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, 1/multiplier_much_cum);
|
||||
float multipier = CumUtility.LookupCumMultiplier(this);
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, 1/ multipier);
|
||||
has_been_fired = false;
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_NoCum : RJW_Gene
|
||||
{
|
||||
bool has_been_fired = false;
|
||||
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, 0f);
|
||||
has_been_fired = true;
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
if (!has_been_fired) {
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, 0f);
|
||||
has_been_fired = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void PostRemove()
|
||||
{
|
||||
// Cum Removal does not do at the moment :/ I would need to safe the old cum amount but I don't want to at the moment
|
||||
base.PostAdd();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_VeryMuchCum : RJW_Gene
|
||||
{
|
||||
bool has_been_fired = false;
|
||||
|
||||
float multiplier_much_cum = 10f;
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum);
|
||||
has_been_fired = true;
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
if (!has_been_fired) {
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum);
|
||||
has_been_fired = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void PostRemove()
|
||||
{
|
||||
base.PostAdd();
|
||||
|
||||
if (has_been_fired)
|
||||
{
|
||||
CumUtility.MultiplyFluidAmountBy(pawn, 1/multiplier_much_cum);
|
||||
has_been_fired = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -40,8 +40,6 @@ namespace RJW_Genes
|
|||
if (!pawn.IsPregnant() && !partner.IsPregnant())
|
||||
return;
|
||||
|
||||
ModLog.Debug("Firing Pregnancy Overwrite Patch - Passed Simple NullChecks");
|
||||
|
||||
if (pawn.IsPregnant()
|
||||
&& GeneUtility.HasGeneNullCheck(partner, GeneDefOf.rjw_genes_pregnancy_overwrite))
|
||||
TryReplacePregnancy(partner, pawn);
|
||||
|
@ -51,29 +49,52 @@ namespace RJW_Genes
|
|||
TryReplacePregnancy(pawn, partner);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to replace an existing pregnancy with a new pregnancy at the same gestation process.
|
||||
/// The new pregnancy will have the same mother, but a new father and a new set of genes.
|
||||
///
|
||||
/// There is a check for pregnancy that checks for the general fertility (using Vanilla Functions) and multiplies it with a xml-configurable chance.
|
||||
/// If anything is replaced, there will be a faction penalty applied.
|
||||
/// </summary>
|
||||
/// <param name="replacer"></param>
|
||||
/// <param name="pregnant"></param>
|
||||
public static void TryReplacePregnancy(Pawn replacer, Pawn pregnant)
|
||||
{
|
||||
// TODO: This mostly works, but needs some more checks.
|
||||
// - Check if there is a pregnancy occurring
|
||||
// - Check for Disease Immunity
|
||||
// - Add Faction Penalties
|
||||
|
||||
ModLog.Debug($"Firing Pregnancy Overwrite for {replacer} and {pregnant}");
|
||||
|
||||
// The "CanImpregnate" does not work as I want, as the pawn is already pregnant, so it wont allow to be pregnated.
|
||||
//PregnancyHelper.CanImpregnate(pawn, partner, props.sexType)
|
||||
|
||||
// DevNote:
|
||||
// There are some issues with just checking PregnancyUtility.PregnancyChanceForPartners or rjw.PregnancyHelper.CanImpregnate
|
||||
// Both do give 0.0 chance when the pawn is already pregnant, which does not help me :/
|
||||
Hediff pregnancyHediff = PregnancyUtility.GetPregnancyHediff(pregnant);
|
||||
if (pregnancyHediff == null)
|
||||
return;
|
||||
|
||||
float gestationProgress = pregnancyHediff.Severity;
|
||||
if (DiseaseHelper.IsImmuneAgainstGeneticDisease(pregnant, GeneDefOf.rjw_genes_pregnancy_overwrite))
|
||||
{
|
||||
ModLog.Debug($"{pregnant} is immune against rjw_genes_pregnancy_overwrite from {replacer}");
|
||||
return;
|
||||
}
|
||||
|
||||
PregnancyUtility.ForceEndPregnancy(pregnant);
|
||||
ChanceExtension chanceExt = GeneDefOf.rjw_genes_pregnancy_overwrite.GetModExtension<ChanceExtension>();
|
||||
float chance = chanceExt != null ? chanceExt.chance : 0.25f;
|
||||
float replacerFert = replacer.GetStatValueForPawn(StatDefOf.Fertility, replacer);
|
||||
chance *= replacerFert ;
|
||||
double roll = (new Random()).NextDouble();
|
||||
if (roll < chance)
|
||||
{
|
||||
ModLog.Debug($"Pregnancy-Overwrite for {replacer} and {pregnant}.");
|
||||
float gestationProgress = pregnancyHediff.Severity;
|
||||
|
||||
PregnancyHelper.StartVanillaPregnancy(pregnant, replacer);
|
||||
Hediff replacementPregnancyHediff = PregnancyUtility.GetPregnancyHediff(pregnant);
|
||||
replacementPregnancyHediff.Severity = gestationProgress;
|
||||
PregnancyUtility.ForceEndPregnancy(pregnant);
|
||||
|
||||
PregnancyHelper.StartVanillaPregnancy(pregnant, replacer);
|
||||
Hediff replacementPregnancyHediff = PregnancyUtility.GetPregnancyHediff(pregnant);
|
||||
replacementPregnancyHediff.Severity = gestationProgress;
|
||||
|
||||
FactionUtility.HandleFactionGoodWillPenalties(replacer, pregnant, "rjw_genes_GoodwillChangedReason_OverwritePregnancy", FACTION_GOODWILL_CHANGE);
|
||||
} else
|
||||
{
|
||||
ModLog.Debug($"Did not Pregnancy-Overwrite for {replacer} and {pregnant}. Failed: Rolled {roll} <({chanceExt.chance}[XML-Chance] x {replacerFert} [Fert:{replacer}])");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
<Compile Include="Common\Defs\ChanceExtension.cs" />
|
||||
<Compile Include="Common\Defs\DistanceExtension.cs" />
|
||||
<Compile Include="Common\Defs\ModExtensionHelper.cs" />
|
||||
<Compile Include="Common\Defs\MultiplierExtension.cs" />
|
||||
<Compile Include="Common\Defs\TickBasedChanceExtension.cs" />
|
||||
<Compile Include="Common\Either.cs" />
|
||||
<Compile Include="Common\Helpers\FactionUtility.cs" />
|
||||
|
@ -105,9 +106,7 @@
|
|||
<Compile Include="Genes\Gender\Genes\Gene_GenderFluid.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_EvergrowingGenitalia.cs" />
|
||||
<Compile Include="Genes\Cum\CumUtility.cs" />
|
||||
<Compile Include="Genes\Cum\Gene_VeryMuchCum.cs" />
|
||||
<Compile Include="Genes\Cum\Gene_MuchCum.cs" />
|
||||
<Compile Include="Genes\Cum\Gene_NoCum.cs" />
|
||||
<Compile Include="Genes\Cum\Gene_ChangeCumAmount.cs" />
|
||||
<Compile Include="Genes\Cum\Patch_TransferNutrition.cs" />
|
||||
<Compile Include="Genes\Damage\Gene_Unbreakable.cs" />
|
||||
<Compile Include="Genes\Cum\Patch_CumflationImmunity.cs" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue