mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Minor Comments and Refactoring - Letter for Mytosis Birth
This commit is contained in:
parent
8139991123
commit
63564a2761
9 changed files with 31 additions and 31 deletions
|
@ -13,19 +13,26 @@ using RJW_Genes;
|
|||
namespace RJW_BGS
|
||||
{
|
||||
[HarmonyPatch(typeof(PregnancyHelper))]
|
||||
public class PregnancyHelperPatcher
|
||||
public class Patch_RJW_PregnancyHelper_VanillaExpandedGenetics
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This Patch changes the pregnancy logic to check for possible hybridization.
|
||||
/// Iff the hybrdiization applies, this prefix skips the normal AddPregnancyHediff (by returning false).
|
||||
///
|
||||
/// Small Note: Below we use `Hediff_BasePregnancy.Create<Hediff_BestialPregnancy>(mother, father, DnaGivingParent.Mother);`
|
||||
/// This completely creates the pregnancy, it does not need to be assigned to anything or added to some hediffs.
|
||||
/// </summary>
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch("AddPregnancyHediff")]
|
||||
public static bool AddPregnancyHediffPrefix(Pawn mother, Pawn father)
|
||||
{
|
||||
if (!RJW_BGSSettings.rjw_bgs_VE_genetics) return true;
|
||||
if (mother == null || father == null) return true;
|
||||
bool humanMotherAndSupportedAnimal = mother.IsHuman() && BasePregnancyPatcher.supportedInitialAnimalRaces.Contains(father.kindDef.race.defName);
|
||||
bool humanMotherAndSupportedHybrid = mother.IsHuman() && BasePregnancyPatcher.supportedHybridRaces.Contains(father.kindDef.race.defName);
|
||||
bool humanFatherAndSupportedAnimal = father.IsHuman() && BasePregnancyPatcher.supportedInitialAnimalRaces.Contains(mother.kindDef.race.defName);
|
||||
bool humanFatherAndSupportedHybrid = father.IsHuman() && BasePregnancyPatcher.supportedHybridRaces.Contains(mother.kindDef.race.defName);
|
||||
bool humanMotherAndSupportedAnimal = mother.IsHuman() && Patch_RJW_BasePregnancy_VanillaExpandedGenetics.supportedInitialAnimalRaces.Contains(father.kindDef.race.defName);
|
||||
bool humanMotherAndSupportedHybrid = mother.IsHuman() && Patch_RJW_BasePregnancy_VanillaExpandedGenetics.supportedHybridRaces.Contains(father.kindDef.race.defName);
|
||||
bool humanFatherAndSupportedAnimal = father.IsHuman() && Patch_RJW_BasePregnancy_VanillaExpandedGenetics.supportedInitialAnimalRaces.Contains(mother.kindDef.race.defName);
|
||||
bool humanFatherAndSupportedHybrid = father.IsHuman() && Patch_RJW_BasePregnancy_VanillaExpandedGenetics.supportedHybridRaces.Contains(mother.kindDef.race.defName);
|
||||
|
||||
if (!(humanMotherAndSupportedAnimal || humanMotherAndSupportedHybrid||humanFatherAndSupportedAnimal|| humanFatherAndSupportedHybrid)) return true;
|
||||
if (humanMotherAndSupportedAnimal)
|
|
@ -10,10 +10,13 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// This Patch handles the changes to Fathers / Mothers when dealing with Femboys and Male/Male Pregnancies.
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(ParentRelationUtility))]
|
||||
public class PatchGetParents
|
||||
public class Patch_ParentRelationUtility_GetParents
|
||||
{
|
||||
// Token: 0x0600000F RID: 15
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("GetFather")]
|
||||
private static void FatherPostfix(ref Pawn __result, Pawn pawn)
|
||||
|
@ -38,7 +41,6 @@ namespace RJW_Genes
|
|||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000010 RID: 16
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("GetMother")]
|
||||
private static void MotherPostfix(ref Pawn __result, Pawn pawn)
|
||||
|
@ -58,7 +60,7 @@ namespace RJW_Genes
|
|||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600001F RID: 31
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("HasSameFather")]
|
||||
private static void HasSameFatherPostfix(ref bool __result, Pawn pawn, Pawn other)
|
||||
|
@ -92,7 +94,7 @@ namespace RJW_Genes
|
|||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000020 RID: 32
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("HasSameMother")]
|
||||
private static void HasSameMotherPostfix(ref bool __result, Pawn pawn, Pawn other)
|
|
@ -16,7 +16,6 @@ namespace RJW_Genes
|
|||
public class CompAbilityEffect_MatingCall : CompAbilityEffect
|
||||
{
|
||||
|
||||
bool fired = false;
|
||||
private new CompProperties_AbilityMatingCall Props
|
||||
{
|
||||
get
|
||||
|
|
|
@ -12,7 +12,6 @@ namespace RJW_Genes
|
|||
{
|
||||
public class CompAbilityEffect_PheromoneSpit : CompAbilityEffect
|
||||
{
|
||||
bool fired = false;
|
||||
private new CompProperties_AbilityPheromoneSpit Props
|
||||
{
|
||||
get
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
using Verse;
|
||||
|
||||
|
||||
// TODO: Re-Introduce this once Licentia is 1.5
|
||||
// It should be rather simple
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -20,8 +20,6 @@ namespace RJWLoveFeeding
|
|||
[HarmonyPostfix]
|
||||
public static void Postfix(ref bool __result, Pawn pawn, bool mustBeVisible)
|
||||
{
|
||||
|
||||
//Log.Message(xxx.get_pawnname(pawn) + " is in patch" + __result);
|
||||
bool isPregnant = __result;
|
||||
if (MultiPregnancy != null)
|
||||
{
|
||||
|
@ -31,7 +29,6 @@ namespace RJWLoveFeeding
|
|||
try
|
||||
{
|
||||
isPregnant = MultiplePregnancies.RJWMultiplePregnancy(isPregnant, pawn);
|
||||
//Log.Message(xxx.get_pawnname(pawn) + " is " + isPregnant);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -40,14 +37,11 @@ namespace RJWLoveFeeding
|
|||
}
|
||||
__result = isPregnant;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static bool RJWMultiplePregnancy(bool isPregnant, Pawn fucked)
|
||||
{
|
||||
|
||||
if ((fucked != null) && !xxx.is_animal(fucked))
|
||||
{
|
||||
|
||||
|
@ -59,18 +53,12 @@ namespace RJWLoveFeeding
|
|||
|
||||
if (setNoPreggo.NullOrEmpty())
|
||||
{
|
||||
//Log.Message("No other hediffs preventing pregnancy");
|
||||
Pawn_GeneTracker genes = fucked.genes;
|
||||
if (genes.HasActiveGene(RJW_Genes.GeneDefOf.RS_MultiPregnancy))
|
||||
{
|
||||
Log.Message(xxx.get_pawnname(fucked) + " has multipregnancy gene");
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Message(xxx.get_pawnname(fucked) + " has NOT multipreg gene");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -57,7 +57,9 @@ namespace RJW_Genes
|
|||
{
|
||||
if (RJW_Genes_Settings.rjw_genes_detailed_debug)
|
||||
{
|
||||
ModLog.Warning("Labor state for pawn " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID + ") is not null despite all checks passing for determining first instance of Hediff_Labor - this warning should never occur, and may indicate a bug in Hediff_LaborPushing of lingering labor state from a previous pregnancy");
|
||||
ModLog.Warning("Labor state for pawn " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID +
|
||||
") is not null despite all checks passing for determining first instance of Hediff_Labor - this warning should never occur, " +
|
||||
"and may indicate a bug in Hediff_LaborPushing of lingering labor state from a previous pregnancy");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -137,11 +139,15 @@ namespace RJW_Genes
|
|||
{
|
||||
ModLog.Message("Pawn " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID + ") is having random twins");
|
||||
}
|
||||
Find.LetterStack.ReceiveLetter("Twins!", __instance.pawn.NameShortColored + " is still in labor and is having twins!\n\nBe sure to gather your doctor and additional friends and family to ensure the other baby is also born healthy!", LetterDefOf.AnotherBaby, __instance.pawn);
|
||||
Find.LetterStack.ReceiveLetter("Twins!", __instance.pawn.NameShortColored + " is still in labor and is having twins!\n\n" +
|
||||
"Be sure to gather your doctor and additional friends and family to ensure the other baby is also born healthy!",
|
||||
LetterDefOf.AnotherBaby, __instance.pawn);
|
||||
return;
|
||||
}
|
||||
|
||||
Find.LetterStack.ReceiveLetter("Another baby!", __instance.pawn.NameShortColored + " is still in labor and is having another baby!\n\nBe sure to gather your doctor and additional friends and family to ensure the next baby is also born healthy!", LetterDefOf.AnotherBaby, __instance.pawn);
|
||||
Find.LetterStack.ReceiveLetter("Another baby!", __instance.pawn.NameShortColored + " is still in labor and is having another baby!\n\n" +
|
||||
"Be sure to gather your doctor and additional friends and family to ensure the next baby is also born healthy!",
|
||||
LetterDefOf.AnotherBaby, __instance.pawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,8 +131,6 @@ namespace RJW_Genes
|
|||
copy.equipment.DestroyAllEquipment();
|
||||
copy.apparel.DestroyAll();
|
||||
|
||||
//TODO: Make a letter on birth!
|
||||
|
||||
|
||||
PawnUtility.TrySpawnHatchedOrBornPawn(copy, toMultiply);
|
||||
// Move the copy in front of the origin, rather than on top
|
||||
|
@ -151,6 +149,9 @@ namespace RJW_Genes
|
|||
copy.story = CopyStoryTracker(copy, toMultiply.story);
|
||||
|
||||
|
||||
Find.LetterStack.ReceiveLetter("Orgasmic Mytosis", $"{toMultiply.NameShortColored} performed mytosis on orgasm! The pawn and its clone entered a regenerative state.",
|
||||
RimWorld.LetterDefOf.NeutralEvent, copy);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue