Added a Twinkification Draft

This commit is contained in:
Vegapnk 2024-07-11 11:37:10 +02:00
parent 420e14f7af
commit c82b81011f
4 changed files with 95 additions and 24 deletions

View file

@ -66,6 +66,33 @@ Any gene can give immunity against any genetic disease using an extension:
These extensions can be slapped on any gene,
but they are meant mostly to have infectors immune against their own diseases.
**Twinkification / Feminization**:
Both approaches follow the same general logic.
- Pawn `A` has Twinkifier Gene and fucks Pawn `B`
- `B` receives a `twinkification progress` hediff with some effects
- Upon having ANY sex, `B` can gain genes from a relevant genepool.
- Genes can be minor or major, depending on the progress of twinkification.
Pawn `B` might be immune against twinkifier as normal immunity logic against diseases.
But once the hediff is there, the twinkification can happen unless you wait for it to cool down.
Gene additions are subject to an application chance (25% for minor, 10% for major)
and might try to add a gene that already exists - then nothing happens.
*Twink Genepool*:
- (Minor) Body_Thin
- (Minor) Homosexual
- (Minor) Beard_NoBeardOnly
- (Minor) Small male genitalia
- (Major) Minor Vulnerability
- (Major) Infectious Homosexuality
- (Major) Delicate
- (Major) Beauty Pretty
- (Major) Fertile Anus
These are currently hardcoded but I can change them on popular demand.
## Changelog
**Additions:**
@ -83,6 +110,7 @@ but they are meant mostly to have infectors immune against their own diseases.
- 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.
- Gene: Twinkification. Pawns turn their (male) sexual partners into breedable twinks.
- 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

View file

@ -224,7 +224,7 @@
<li Class="RJW_Genes.HediffIncreaseOnSexExtension">
<hediffDef>rjw_genes_twinkification_progress</hediffDef>
<canCreateHediff>true</canCreateHediff>
<severityIncrease>0.99</severityIncrease>
<severityIncrease>0.01</severityIncrease>
<applicationChance>1.00</applicationChance>
<applicableForWomen>false</applicableForWomen>
<applicableForMen>true</applicableForMen>

View file

@ -17,7 +17,7 @@
</li>
</comps>
<stages>
<!-- DevNote: The labels and their effects can be changed, but the logic triggers at >0.6 for minor and >0.8 for major ! -->
<li>
<label>neglectable</label>
<becomeVisible>false</becomeVisible>
@ -89,7 +89,7 @@
</li>
</comps>
<stages>
<!-- DevNote: The labels and their effects can be changed, but the logic triggers at >0.6 for minor and >0.8 for major ! -->
<li>
<label>neglectable</label>
<becomeVisible>false</becomeVisible>

View file

@ -37,42 +37,85 @@ namespace RJW_Genes
if (hediff == null) return;
var Random = new Random();
switch (hediff.SeverityLabel)
// DevNote: I first had a switch (hediff.SeverityLabel) but SeverityLabel was null.
// So now I have this approach which feels a bit more robust.
// I was thinking about looking for strings in the label, but I think that will break the logic in case of translations.
switch (hediff.Severity)
{
case "severe":
case "critical":
case float f when f > 0.8f:
{
if (Random.NextDouble() < MAJOR_APPLICATION_CHANCE)
majorChange(pawn);
MajorChange(pawn);
} break;
case "minor":
case float f when f > 0.6f:
{
if (Random.NextDouble() < MINOR_APPLICATION_CHANCE)
minorChange(pawn);
MinorChange(pawn);
} break;
default:
{
ModLog.Debug($"Tried to twinkify {pawn} - severity of twinkification was too low ({hediff.def} @ {hediff.Severity} - {hediff.Label})") ;
} break;
}
}
private static void minorChange(Pawn pawn)
private static void MinorChange(Pawn pawn)
{
// Minor Infectious Vulnerability
// Smaller Genitalia
// Remove Beard
// Thin Body Type
List<GeneDef> possibleGenes = new List<GeneDef>() {
GeneDefOf.rjw_genes_small_male_genitalia,
DefDatabase<GeneDef>.GetNamed("Beard_NoBeardOnly"),
DefDatabase<GeneDef>.GetNamed("Body_Thin"),
GeneDefOf.rjw_genes_homosexual
};
GeneDef chosen = possibleGenes.RandomElement();
if (chosen == null)
{
ModLog.Warning($"Error in retrieving a minor-twinkification gene for twinkifying {pawn}");
return;
}
private static void majorChange(Pawn pawn)
// DevNote: I could do "hasActiveGene" but that could lead to the gene being there but not active.
if (!pawn.genes.GenesListForReading.Any(p => p.def == chosen))
{
// Final Gene-Pool should have:
// - Fragile (?)
// - Infectious Vulnerability
// - Infectious Homosexuality
// - Beauty
// - Fertile Anus
ModLog.Debug($"{pawn} experienced a minor twinkification change; {pawn} got new gene {chosen}.");
pawn.genes.AddGene(chosen, !RJW_Genes_Settings.rjw_genes_genetic_disease_as_endogenes);
} else
{
ModLog.Debug($"Tryed a minor twinkification for {pawn} - {pawn} already had {chosen}");
}
}
pawn.genes.AddGene(GeneDefOf.rjw_genes_fertile_anus, !RJW_Genes_Settings.rjw_genes_genetic_disease_as_endogenes);
pawn.genes.AddGene(GeneDefOf.rjw_genes_infectious_homosexuality, !RJW_Genes_Settings.rjw_genes_genetic_disease_as_endogenes);
private static void MajorChange(Pawn pawn)
{
List<GeneDef> possibleGenes = new List<GeneDef>() {
GeneDefOf.rjw_genes_fertile_anus,
DefDatabase<GeneDef>.GetNamed("Beauty_Pretty"),
DefDatabase<GeneDef>.GetNamed("Delicate"),
GeneDefOf.rjw_genes_minor_vulnerability,
GeneDefOf.rjw_genes_infectious_homosexuality
};
GeneDef chosen = possibleGenes.RandomElement();
if (chosen == null)
{
ModLog.Warning($"Error in retrieving a minor-twinkification gene for twinkifying {pawn}");
return;
}
// DevNote: I could do "hasActiveGene" but that could lead to the gene being there but not active.
if (!pawn.genes.GenesListForReading.Any(p => p.def == chosen))
{
ModLog.Debug($"{pawn} experienced a major twinkification change; {pawn} got new gene {chosen}.");
pawn.genes.AddGene(chosen, !RJW_Genes_Settings.rjw_genes_genetic_disease_as_endogenes);
}
else
{
ModLog.Debug($"Tryed a major twinkification for {pawn} - {pawn} already had {chosen}");
ModLog.Debug($"Trying minor twinkification for {pawn} instead ...");
MinorChange(pawn);
}
}
}
}