Minor Comments and Refactoring - Letter for Mytosis Birth

This commit is contained in:
Vegapnk 2024-06-05 11:50:25 +02:00
parent 8139991123
commit 63564a2761
9 changed files with 31 additions and 31 deletions

View file

@ -16,7 +16,6 @@ namespace RJW_Genes
public class CompAbilityEffect_MatingCall : CompAbilityEffect
{
bool fired = false;
private new CompProperties_AbilityMatingCall Props
{
get

View file

@ -12,7 +12,6 @@ namespace RJW_Genes
{
public class CompAbilityEffect_PheromoneSpit : CompAbilityEffect
{
bool fired = false;
private new CompProperties_AbilityPheromoneSpit Props
{
get

View file

@ -2,8 +2,6 @@
using Verse;
// TODO: Re-Introduce this once Licentia is 1.5
// It should be rather simple
namespace RJW_Genes
{
/// <summary>

View file

@ -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
{

View file

@ -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);
}
}
}

View file

@ -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;
}