public override void Interacted(Pawn initiator, Pawn recipient, List <RulePackDef> extraSentencePacks, out string letterText, out string letterLabel, out LetterDef letterDef) { if (lastInitiator != initiator || lastRecipient != recipient) { AttractionUtility.CalculateAttraction(initiator, recipient, false, true, out veryLowInitiatorReasons, out lowInitiatorReasons, out highInitiatorReasons, out veryHighInitiatorReasons, out AttractionFactorDef reasonForInstantFailure); } if (Rand.Value < this.SuccessChance(initiator, recipient)) { RelationshipUtility.AdvanceRelationship(initiator, recipient, PawnRelationDefOf.Lover); LovePartnerRelationUtility.TryToShareBed(initiator, recipient); //TODO Add Move In tale if (PawnUtility.ShouldSendNotificationAbout(initiator) || PawnUtility.ShouldSendNotificationAbout(recipient)) { letterText = "MoveInLetterText".Translate(initiator.Named("PAWN1"), recipient.Named("PAWN2")); letterText += AttractionUtility.WriteReasonsParagraph(initiator, recipient, veryHighInitiatorReasons, highInitiatorReasons, lowInitiatorReasons, veryLowInitiatorReasons); letterText += AttractionUtility.WriteReasonsParagraph(recipient, initiator, veryHighRecipientReasons, highRecipientReasons, lowRecipientReasons, veryLowRecipientReasons); letterLabel = "MoveInLetterTitle".Translate(); letterDef = LetterDefOf.PositiveEvent; } else { letterText = null; letterLabel = null; letterDef = null; } //extraSentencePacks.Add(RulePackDefOf.Sentence_RomanceAttemptAccepted); } else { //extraSentencePacks.Add(RulePackDefOf.Sentence_RomanceAttemptRejected); letterText = null; letterLabel = null; letterDef = null; } }
public override void Interacted(Pawn initiator, Pawn recipient, List <RulePackDef> extraSentencePacks, out string letterText, out string letterLabel, out LetterDef letterDef) { if (lastInitiator != initiator || lastRecipient != recipient) { AttractionUtility.CalculateAttraction(initiator, recipient, false, true, out veryLowInitiatorReasons, out lowInitiatorReasons, out highInitiatorReasons, out veryHighInitiatorReasons, out AttractionFactorDef reasonForInstantFailure); } if (Rand.Value < this.SuccessChance(initiator, recipient)) { List <Pawn> list; this.BreakLoverAndFianceRelations(initiator, out list); List <Pawn> list2; this.BreakLoverAndFianceRelations(recipient, out list2); for (int i = 0; i < list.Count; i++) { BreakupUtility.TryAddCheaterThought(list[i], initiator, recipient); } for (int j = 0; j < list2.Count; j++) { BreakupUtility.TryAddCheaterThought(list2[j], recipient, initiator); } initiator.relations.TryRemoveDirectRelation(PawnRelationDefOf.ExLover, recipient); initiator.relations.TryRemoveDirectRelation(PawnRelationDefOfGR.ExLovefriend, recipient); RelationshipUtility.AdvanceRelationship(recipient, initiator, PawnRelationDefOfGR.Lovefriend); //TODO Change record tale TaleRecorder.RecordTale(TaleDefOf.BecameLover, new object[] { initiator, recipient }); initiator.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.BrokeUpWithMe, recipient); recipient.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.BrokeUpWithMe, initiator); initiator.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.FailedRomanceAttemptOnMe, recipient); initiator.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.FailedRomanceAttemptOnMeLowOpinionMood, recipient); recipient.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.FailedRomanceAttemptOnMe, initiator); recipient.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.FailedRomanceAttemptOnMeLowOpinionMood, initiator); if (PawnUtility.ShouldSendNotificationAbout(initiator) || PawnUtility.ShouldSendNotificationAbout(recipient)) { this.GetNewLoversLetter(initiator, recipient, list, list2, out letterText, out letterLabel, out letterDef); letterText += AttractionUtility.WriteReasonsParagraph(initiator, recipient, veryHighInitiatorReasons, highInitiatorReasons, lowInitiatorReasons, veryLowInitiatorReasons); letterText += AttractionUtility.WriteReasonsParagraph(recipient, initiator, veryHighRecipientReasons, highRecipientReasons, lowRecipientReasons, veryLowRecipientReasons); } else { letterText = null; letterLabel = null; letterDef = null; } extraSentencePacks.Add(RulePackDefOf.Sentence_RomanceAttemptAccepted); } else { initiator.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.RebuffedMyRomanceAttempt, recipient); recipient.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.FailedRomanceAttemptOnMe, initiator); if (recipient.relations.OpinionOf(initiator) <= 0) { recipient.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.FailedRomanceAttemptOnMeLowOpinionMood, initiator); } extraSentencePacks.Add(RulePackDefOf.Sentence_RomanceAttemptRejected); letterText = null; letterLabel = null; letterDef = null; } }