public static void AddPsyche(ref EdB.PrepareCarefully.CustomPawn __result, EdB.PrepareCarefully.SaveRecordPawnV3 record) { if (SaveRecordPawnV3Patch.savedPawns.Keys.Contains(record)) { Pawn pawn = __result.Pawn; if (pawn != null && pawn is PsychologyPawn) { PrepareCarefully.SaveRecordPsycheV3 psycheSave = SaveRecordPawnV3Patch.savedPawns[record]; PsychologyPawn realPawn = pawn as PsychologyPawn; realPawn.psyche.upbringing = psycheSave.upbringing; foreach (PersonalityNode node in realPawn.psyche.PersonalityNodes) { PersonalityNode savedNode = psycheSave.nodes.Find(n => n.def == node.def); if (savedNode != null) { node.rawRating = savedNode.rawRating; } } if (PsychologyBase.ActivateKinsey()) { realPawn.sexuality.sexDrive = psycheSave.sexDrive; realPawn.sexuality.romanticDrive = psycheSave.romanticDrive; realPawn.sexuality.kinseyRating = psycheSave.kinseyRating; } } } }
public static void AddPsyche(ref EdB.PrepareCarefully.CustomPawn __result, EdB.PrepareCarefully.SaveRecordPawnV4 record) { if (SaveRecordPawnV4Patch.savedPawns.Keys.Contains(record)) { Pawn pawn = __result.Pawn; if (pawn != null && PsycheHelper.PsychologyEnabled(pawn)) { PrepareCarefully.SaveRecordPsycheV4 psycheSave = SaveRecordPawnV4Patch.savedPawns[record]; PsycheHelper.Comp(pawn).Psyche.upbringing = psycheSave.upbringing; foreach (PersonalityNode node in PsycheHelper.Comp(pawn).Psyche.PersonalityNodes) { PersonalityNode savedNode = psycheSave.NodeDict[node.def]; if (savedNode != null) { node.rawRating = savedNode.rawRating; } } PsycheHelper.Comp(pawn).Sexuality.sexDrive = psycheSave.sexDrive; PsycheHelper.Comp(pawn).Sexuality.romanticDrive = psycheSave.romanticDrive; PsycheHelper.Comp(pawn).Sexuality.kinseyRating = psycheSave.kinseyRating; } } }