Letter on Queen Birth

This commit is contained in:
Vegapnk 2023-06-04 17:03:11 +02:00
parent 1471eeea62
commit 2ad91a1076

View file

@ -50,8 +50,7 @@ namespace RJW_Genes
{ {
pawn.genes.SetXenotype(queenDef); 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})"); 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 ? Letter doesn't show :( MakeQueenBornLetter(pawn);
Find.LetterStack.ReceiveLetter("New Queen", "A new Queen was born! Make sure to adress inheritance before the new queen reaches adolesence.", LetterDefOf.BabyBirth, (LookTargets)(Thing)pawn);
} }
// Case 2.b: New Drone born // Case 2.b: New Drone born
else if (roll < hiveOffspringChanceDef.droneChance + hiveOffspringChanceDef.queenChance) else if (roll < hiveOffspringChanceDef.droneChance + hiveOffspringChanceDef.queenChance)
@ -115,6 +114,16 @@ namespace RJW_Genes
return null; return null;
} }
public static void MakeQueenBornLetter(Pawn bornQueen)
{
if (bornQueen == null) return;
var letter= LetterMaker.MakeLetter(
"New Queen", "A new Queen was born! Make sure to adress inheritance before the new queen reaches adolesence.", LetterDefOf.NeutralEvent, bornQueen
);
//letter.Start();
Find.LetterStack.ReceiveLetter(letter);
}
/// <summary> /// <summary>
/// Looks up if there is a Xenotype with Queen-Gene for the pawns parents. /// Looks up if there is a Xenotype with Queen-Gene for the pawns parents.