Compare commits

...

5 Commits

Author SHA1 Message Date
Vegapnk 47a78073bf New Patch for Egg Births - undetected Queen Parents :/ 2023-06-03 08:32:19 +02:00
Vegapnk cfa6078c12 Tweaks to Halamyr XMLs 2023-06-03 08:12:08 +02:00
Vegapnk 5159535400 Hardened Incubator Up-Ticking - seems smooth and robust now 2023-06-03 08:06:50 +02:00
Vegapnk b785ee518b Typo in Settings 2023-06-03 07:16:14 +02:00
Vegapnk 31a5ed2440 minor changes to scenario 2023-05-24 06:59:09 +02:00
8 changed files with 195 additions and 36 deletions

View File

@ -1,5 +1,10 @@
# 1.2
**Since beta-1**:
- Fix of icon-names (#36)
- Changes to the scenario (more building items, throne for start). Wealth is now at 12k, which is the same as crashlanded and lost tribe.
**Changes:**
- Cocoon Weaver Gene
@ -50,8 +55,8 @@ I disabled the specific gender and the oviparious reproduction (when you have rj
I recommend using alpha genes for the Hive-Playthroughs, as otherwise the Halamyr look a bit ... boring?
But i don't want to add a bunch of cosmetic genes on top of things.
*And what the fuck is a halamyr?* Well I had to name my little ants somehow. But I didn't want to call them `myr` as I maybe want to make some TiTs xenotypes separately.
And I am aware that the TiTs-Myr work different than the things I built now.
*And what the fuck is a halamyr?* Well I had to name my little ants somehow. But I didn't want to call them `myr` as I maybe want to make some [TiTs](https://www.fenoxo.com/play-games/) xenotypes separately.
And I am aware that the TiTs-Myr work different than the things I made now.
# 1.1.4

View File

@ -97,25 +97,27 @@
<canGenerateAsCombatant>false</canGenerateAsCombatant>
<combatPowerFactor>0.8</combatPowerFactor>
<description>The Halamyr breeders are the last backbone of the hive. Their special genes allow them to carry more eggs and hatch them faster, enabling a steady output of hivelings. To support their position in the hive, breeders spend most of their life in the queens cocoon, a task which they gladly accept.</description>
<description>The Halamyr breeders are the backbone of the hive. Their special genes allow them to carry more eggs and hatch them faster, enabling a steady output of hivelings. To support their position in the hive, breeders spend most of their life in the queens cocoon, a task which they gladly accept.</description>
<descriptionShort>Made for incubating Halamyr eggs, breeders spend most of their life in the queens cocoon.</descriptionShort>
<genes>
<li MayRequire="sarg.alphagenes" >AG_Spinnerets</li>
<li MayRequire="sarg.alphagenes" >AG_InsectBlood</li>
<li MayRequire="sarg.alphagenes" >AG_InsectJellyProduction</li>
<li MayRequire="sarg.alphagenes" >AG_FormicAntennas</li>
<li>Fertile</li>
<li MayRequire="sarg.alphagenes" >AG_FastGestation</li>
<li>FireTerror</li>
<li>VerySleepy</li>
<li>rjw_genes_bisexual</li>
<li MayRequire="sarg.alphagenes" >AG_BeeMandibles</li>
<li>Skin_DeepRed</li>
<li>AptitudeStrong_Social</li>
<li>rjw_genes_ovipositor_genitalia</li>
<li>rjw_genes_unbreakable</li>
<li>rjw_genes_drone</li>
<li>rjw_genes_female_only</li>
<li>rjw_genes_zealous_loyalty</li>
<li>rjw_genes_insectincubator</li>
<li>rjw_genes_zoophile</li>
<li>rjw_genes_no_vagina</li>
</genes>
</XenotypeDef>

View File

@ -47,7 +47,7 @@
<li>
<xenotype>Baseliner</xenotype>
<count>1</count>
<count>2</count>
</li>
</xenotypeCounts>
</li>
@ -80,12 +80,12 @@
<li Class="ScenPart_StartingThing_Defined">
<def>StartingThing_Defined</def>
<thingDef>Silver</thingDef>
<count>200</count>
<count>400</count>
</li>
<li Class="ScenPart_StartingThing_Defined">
<def>StartingThing_Defined</def>
<thingDef>Pemmican</thingDef>
<count>150</count>
<count>250</count>
</li>
<li Class="ScenPart_StartingThing_Defined">
<def>StartingThing_Defined</def>
@ -95,23 +95,14 @@
<li Class="ScenPart_StartingThing_Defined">
<def>StartingThing_Defined</def>
<thingDef>MedicineHerbal</thingDef>
<count>20</count>
<count>30</count>
</li>
<li Class="ScenPart_StartingThing_Defined">
<def>StartingThing_Defined</def>
<thingDef>MeleeWeapon_Club</thingDef>
<stuff>WoodLog</stuff>
</li>
<li Class="ScenPart_StartingThing_Defined">
<def>StartingThing_Defined</def>
<thingDef>MeleeWeapon_Knife</thingDef>
<stuff>Jade</stuff>
</li>
<li Class="ScenPart_StartingThing_Defined">
<def>StartingThing_Defined</def>
<thingDef>Pila</thingDef>
</li>
<li Class="ScenPart_StartingAnimal">
<def>StartingAnimal</def>
<animalKind>Spelopede</animalKind>
@ -141,6 +132,11 @@
<thingDef>Jade</thingDef>
<count>100</count>
</li>
<li Class="ScenPart_ScatterThingsNearPlayerStart">
<def>ScatterThingsNearPlayerStart</def>
<thingDef>Steel</thingDef>
<count>200</count>
</li>
<!-- Game start dialog -->
<li Class="ScenPart_GameStartDialog">

View File

@ -15,6 +15,8 @@ namespace RJW_Genes
/// 1. Is it fertilized ? => tick it down "extra".
/// 2. Is it not fertilized? => fertilize it with the Incubator as parent
///
/// To save performance, this gene fires (default) every 0.5h, which also means a slight delay until fertilization happens.
///
/// Important: The other half of the behavior for the gene (more egg-capacity) is in `Patch_InsectINcubator_PregnancyHelper`.
/// </summary>
public class Gene_InsectIncubator : Gene
@ -42,7 +44,8 @@ namespace RJW_Genes
egg.Fertilize(pawn);
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message($"Gene_InsectIncubator: fertilized egg {egg} in {pawn}");
}
else if (egg.fertilized)
// DevNote: There is an issue with Eggs reaching too much gestation progress (>100%), which causes DownStream bugs. To avoid this, there are some extra checks in place.
else if (egg.fertilized && egg.GestationProgress <= .93)
{
egg.lastTick += TICK_INTERVAL;
}

View File

@ -0,0 +1,153 @@
using HarmonyLib;
using RimWorld;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
namespace RJW_Genes
{
/// <summary>
/// Patches the method `ProcessHumanLikeInsectEgg` from `Hediff_InsectEgg`.
///
/// The 'ProcessHumanLikeInsectEgg' returns the finished baby, for which we alter the pawn according to our xenotypes.
/// </summary>
[HarmonyPatch(typeof(Hediff_InsectEgg), "ProcessHumanLikeInsectEgg")]
public class Patch_InsectEgg_BirthBaby_SetHiveGenes
{
[HarmonyPostfix]
static void HandleHiveBasedInheritance(ref Thing __result)
{
// Check: Was the born thing a pawn?
if (__result == null || !(__result is Pawn))
{
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message("There was a birth of something non-human - not entering logic for queen-drone-xenotype inheritance.");
return;
}
Pawn pawn = (Pawn)__result;
// Important: Not all pawns have mother/father. Some Pawns are born in Growth-Vats or born from mod.
bool hasQueenParent = TryFindParentQueenXenotype(pawn) != null;
bool hasDroneParent = TryFindParentDroneXenotype(pawn) != null;
if (hasQueenParent)
{
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message($"PostFix PregnancyUtility::ApplyBirthOutcome - Checking Hive Inheritance because {pawn} has a queen parent.");
XenotypeDef queenDef = TryFindParentQueenXenotype(pawn);
HiveOffspringChanceDef hiveOffspringChanceDef = HiveUtility.LookupHiveInheritanceChances(queenDef);
// Case 1: Mother is Queen, Father is something else. Produce Worker.
if (!hasDroneParent)
{
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message($"{pawn} was born as a worker, as it did not have Drone Father ({100}% chance)");
MakeWorker(pawn, queenDef);
}
// Case 2: Mother is Queen, Father is drone. Apply xenotype as per chance.
else
{
double roll = (new Random()).NextDouble();
// Case 2.a: New Queen born
if (roll < hiveOffspringChanceDef.queenChance)
{
pawn.genes.SetXenotype(queenDef);
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message($"{pawn} born as a new queen with xenotype {queenDef.defName} ({hiveOffspringChanceDef.queenChance * 100}% chance,rolled {roll})");
// TODO: Make a letter ?
}
// Case 2.b: New Drone born
else if (roll < hiveOffspringChanceDef.droneChance + hiveOffspringChanceDef.queenChance)
{
XenotypeDef droneDef = TryFindParentDroneXenotype(pawn);
pawn.genes.SetXenotype(droneDef);
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message($"{pawn} born as a new drone with xenotype {droneDef.defName} ({(hiveOffspringChanceDef.droneChance + hiveOffspringChanceDef.queenChance) * 100}% chance,rolled {roll}))");
}
// Case 2.c: Worker
else {
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message($"{pawn} born as a worker ({(hiveOffspringChanceDef.workerChance) * 100}% chance,rolled {roll}))");
MakeWorker(pawn, queenDef);
}
}
} else
{
if (RJW_Genes_Settings.rjw_genes_detailed_debug) ModLog.Message("There was an egg-birth without a (detected) queen-parent");
}
}
/// <summary>
/// Turns a given pawn into a worker, by looking up the relevant genes as per queen.
///
/// If the queen xenotype has no mapping, the "rjw_genes_default_worker_xenotype" are used instead.
/// The genes are added as endogenes, so the worker can still become a xenotype.
/// </summary>
/// <param name="pawnTobeWorker">The pawn for which the genes are added.</param>
/// <param name="queenDef">The xenotype of the queen, used for lookup.</param>
private static void MakeWorker(Pawn pawnTobeWorker, XenotypeDef queenDef)
{
if (pawnTobeWorker == null)
return;
var mappings = HiveUtility.GetQueenWorkerMappings();
var genes = mappings.TryGetValue(queenDef, HiveUtility.LookupDefaultWorkerGenes());
foreach (var gene in genes)
pawnTobeWorker.genes.AddGene(gene, false);
}
/// <summary>
/// Looks up if there is a Xenotype with Drone-Gene for the pawns parents.
/// This is to account that maybe father or mother are the drone (instead of hardcoding things for father).
/// If both are drones, the mothers is returned.
/// </summary>
/// <param name="pawn">The pawn for whichs parent the xenotypes is looked up.</param>
/// <returns>The Drone-Xenotype of a parent or null. If both are drones, mothers are preferred.</returns>
private static XenotypeDef TryFindParentDroneXenotype(Pawn pawn)
{
if (pawn == null)
return null;
var motherXenotype = HiveUtility.TryGetDroneXenotype(pawn.GetMother());
var fatherXenotype = HiveUtility.TryGetDroneXenotype(pawn.GetFather());
if (motherXenotype != null)
return motherXenotype;
if (fatherXenotype != null)
return fatherXenotype;
return null;
}
/// <summary>
/// Looks up if there is a Xenotype with Queen-Gene for the pawns parents.
/// This is to account that maybe father or mother are the queen (instead of hardcoding things for father).
/// If both are queens, the mothers is returned.
/// </summary>
/// <param name="pawn">The pawn for whichs parent the xenotypes is looked up.</param>
/// <returns>The Queen-Xenotype of a parent or null. If both are queens, mothers are preferred.</returns>
private static XenotypeDef TryFindParentQueenXenotype(Pawn pawn)
{
if (pawn == null)
return null;
var motherXenotype = HiveUtility.TryGetQueenXenotype(pawn.GetMother());
var fatherXenotype = HiveUtility.TryGetQueenXenotype(pawn.GetFather());
if (motherXenotype != null)
return motherXenotype;
if (fatherXenotype != null)
return fatherXenotype;
return null;
}
}
}

View File

@ -47,6 +47,7 @@
<Compile Include="Genes\Hive\Defs\HiveOffspringChanceDef.cs" />
<Compile Include="Genes\Hive\Genes\Gene_FerventOvipositor.cs" />
<Compile Include="Genes\Hive\Genes\Gene_InsectIncubator.cs" />
<Compile Include="Genes\Hive\Patches\Patch_InsectEggs_BirthBaby_SetHiveGenes.cs" />
<Compile Include="Genes\Hive\Patches\Patch_InsectBreeder_EggFertilization.cs" />
<Compile Include="Genes\Hive\Patches\Patch_InsectIncubator_PregnancyHelper.cs" />
<Compile Include="Genes\Cum\CumUtility.cs" />

View File

@ -17,7 +17,7 @@ namespace RJW_Genes
listing_Standard.ColumnWidth = rect.width / 2.05f;
listing_Standard.Begin(rect);
listing_Standard.Gap(24f);
listing_Standard.Label("Fertlin-Gain from Animals" + ": " +
listing_Standard.Label("Fertilin-Gain from Animals" + ": " +
Math.Round((double)(RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor * 100f), 0).ToString() + "%", -1f, "of fertilin gained (compared to human-baseline).");
RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor = listing_Standard.Slider(RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor, 0f, 3f);

View File

@ -20,11 +20,9 @@ Any help is very appreciated, even if it is just pointing me to existing similar
**Cum-Drugs** eating cum has an effect similar to Go-Juice (including (separate?) addiction)
**Self-Fertilizing Eggs** Pawns fertilize eggs that are put inside them (with themselves as a parent)
**Death-Rest** until the pawn is cumflated.
**Alpha / Beta Genes** that you can only have one alpha, and the alpha makes mostly beta children (1:10). This might fit with the xenotypes below. As this is an RJW mod, this should also somewhat affect sex (e.g. betas cannot impregnate betas).
**STD Immunity** & maybe a potential to be carrier, but not suffer effects.
## Planned Xenotypes
@ -39,17 +37,6 @@ Any help is very appreciated, even if it is just pointing me to existing similar
Can't help but think about Rexxar Porn now I am a bad person.
**Hive Mother:**
- [X] Spawn the small scarabs
- [X] Fertilise Eggs inside her
- [X] Produce cocoons
- [] Maybe: Insert "dropped" Insect eggs
- [] Very fragile, no use except breeding
- [] Maybe: can only eat insect jelly
- [X] Should look like a nice green-yellow alien as we all know fuckable insects would look like.
- [X] There can only be one Hive Mother, some penalties if there are others. This could be implement with an "Alpha Gene" that gives heavy penalties when other Alpha exists.
## Genes with Abilities and more Effects
There were some suggestions on the Discord I saved them somewhere else. I am far away from making that work, but to have them here:
@ -62,4 +49,16 @@ There were some suggestions on the Discord I saved them somewhere else. I am far
- Streamline Filenames / Names to either be LifeForce or Fertilin (e.g. `Hediffs_Fertilin.xml` but `Pawnkind_LifeForce.xml`). I think most things are called LifeForce.
- Similar cleanup for the patches, and make a note what to find where in the patches
- Change Project structure to the 1.3, 1.4 Structure of other mods
- Change Project structure to the 1.3, 1.4 Structure of other mods
## Split:
I plan to split this mod.
Namely, I want to make a
1. base-mod (with genitalia and size genes, anything alternating all base stats)
2. bonus-mod, with Fertilin and other complex genes
3. xenotype-mod (only xenotypes + scenarios)
4. animal genes inheritance (Yes, bit of a meme that it was separate mod earlier)
I first want to make a bit more content, and then I hope there will be a "breaking change" in RJW so I can also do a breaking change on top of that.