diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6ff0057..df95576 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/Common/Defs/GeneDefs/Xenotype_Hive.xml b/Common/Defs/GeneDefs/Xenotype_Hive.xml
index 91f6023..7d8b31b 100644
--- a/Common/Defs/GeneDefs/Xenotype_Hive.xml
+++ b/Common/Defs/GeneDefs/Xenotype_Hive.xml
@@ -97,25 +97,27 @@
false
0.8
- 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.
+ 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.
Made for incubating Halamyr eggs, breeders spend most of their life in the queens cocoon.
AG_Spinnerets
AG_InsectBlood
AG_InsectJellyProduction
+ AG_FormicAntennas
+ Fertile
+ AG_FastGestation
FireTerror
VerySleepy
rjw_genes_bisexual
- AG_BeeMandibles
Skin_DeepRed
AptitudeStrong_Social
- rjw_genes_ovipositor_genitalia
- rjw_genes_unbreakable
rjw_genes_drone
rjw_genes_female_only
rjw_genes_zealous_loyalty
rjw_genes_insectincubator
+ rjw_genes_zoophile
+ rjw_genes_no_vagina
diff --git a/Common/Defs/Scenarios/Halamyr_Hive.xml b/Common/Defs/Scenarios/Halamyr_Hive.xml
index 338a611..0c9387a 100644
--- a/Common/Defs/Scenarios/Halamyr_Hive.xml
+++ b/Common/Defs/Scenarios/Halamyr_Hive.xml
@@ -47,7 +47,7 @@
Baseliner
- 1
+ 2
@@ -80,12 +80,12 @@
StartingThing_Defined
Silver
- 200
+ 400
StartingThing_Defined
Pemmican
- 150
+ 250
StartingThing_Defined
@@ -95,23 +95,14 @@
StartingThing_Defined
MedicineHerbal
- 20
+ 30
StartingThing_Defined
MeleeWeapon_Club
WoodLog
-
- StartingThing_Defined
- MeleeWeapon_Knife
- Jade
-
-
- StartingThing_Defined
- Pila
-
StartingAnimal
Spelopede
@@ -141,6 +132,11 @@
Jade
100
+
+ ScatterThingsNearPlayerStart
+ Steel
+ 200
+
diff --git a/Source/Genes/Hive/Genes/Gene_InsectIncubator.cs b/Source/Genes/Hive/Genes/Gene_InsectIncubator.cs
index d102a8a..559ec2c 100644
--- a/Source/Genes/Hive/Genes/Gene_InsectIncubator.cs
+++ b/Source/Genes/Hive/Genes/Gene_InsectIncubator.cs
@@ -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`.
///
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;
}
diff --git a/Source/Genes/Hive/Patches/Patch_InsectEggs_BirthBaby_SetHiveGenes.cs b/Source/Genes/Hive/Patches/Patch_InsectEggs_BirthBaby_SetHiveGenes.cs
new file mode 100644
index 0000000..e65986e
--- /dev/null
+++ b/Source/Genes/Hive/Patches/Patch_InsectEggs_BirthBaby_SetHiveGenes.cs
@@ -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
+{
+ ///
+ /// Patches the method `ProcessHumanLikeInsectEgg` from `Hediff_InsectEgg`.
+ ///
+ /// The 'ProcessHumanLikeInsectEgg' returns the finished baby, for which we alter the pawn according to our xenotypes.
+ ///
+
+ [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");
+ }
+ }
+
+ ///
+ /// 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.
+ ///
+ /// The pawn for which the genes are added.
+ /// The xenotype of the queen, used for lookup.
+ 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);
+
+ }
+
+ ///
+ /// 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.
+ ///
+ /// The pawn for whichs parent the xenotypes is looked up.
+ /// The Drone-Xenotype of a parent or null. If both are drones, mothers are preferred.
+ 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;
+ }
+
+
+ ///
+ /// 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.
+ ///
+ /// The pawn for whichs parent the xenotypes is looked up.
+ /// The Queen-Xenotype of a parent or null. If both are queens, mothers are preferred.
+ 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;
+ }
+ }
+}
diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj
index 21e7967..ff8360b 100644
--- a/Source/Rjw-Genes.csproj
+++ b/Source/Rjw-Genes.csproj
@@ -47,6 +47,7 @@
+
diff --git a/Source/Settings/RJW_Genes_Settings.cs b/Source/Settings/RJW_Genes_Settings.cs
index 71cf028..f6e2f83 100644
--- a/Source/Settings/RJW_Genes_Settings.cs
+++ b/Source/Settings/RJW_Genes_Settings.cs
@@ -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);
diff --git a/TODOS.md b/TODOS.md
index cdd40a5..c28f2ac 100644
--- a/TODOS.md
+++ b/TODOS.md
@@ -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
\ No newline at end of file
+- 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.
\ No newline at end of file