public static void Married(Pawn firstPawn, Pawn secondPawn)
 {
     LovePartnerRelationUtility.ChangeSpouseRelationsToExSpouse(firstPawn);
     LovePartnerRelationUtility.ChangeSpouseRelationsToExSpouse(secondPawn);
     firstPawn.relations.RemoveDirectRelation(PawnRelationDefOf.Fiance, secondPawn);
     firstPawn.relations.TryRemoveDirectRelation(PawnRelationDefOf.ExSpouse, secondPawn);
     firstPawn.relations.AddDirectRelation(PawnRelationDefOf.Spouse, secondPawn);
     AddNewlyMarriedThoughts(firstPawn, secondPawn);
     AddNewlyMarriedThoughts(secondPawn, firstPawn);
     if (firstPawn.needs.mood != null)
     {
         firstPawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.DivorcedMe, secondPawn);
     }
     if (secondPawn.needs.mood != null)
     {
         secondPawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.DivorcedMe, firstPawn);
     }
     if (firstPawn.relations.nextMarriageNameChange != secondPawn.relations.nextMarriageNameChange)
     {
         Log.Warning("Marriage name change is different on marrying pawns. This is weird, but not harmful.");
     }
     SpouseRelationUtility.ChangeNameAfterMarriage(firstPawn, secondPawn, firstPawn.relations.nextMarriageNameChange);
     LovePartnerRelationUtility.TryToShareBed(firstPawn, secondPawn);
     TaleRecorder.RecordTale(TaleDefOf.Marriage, firstPawn, secondPawn);
 }
예제 #2
0
 public override void Interacted(Pawn initiator, Pawn recipient, List <RulePackDef> extraSentencePacks, out string letterText, out string letterLabel, out LetterDef letterDef)
 {
     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++)
         {
             this.TryAddCheaterThought(list[i], initiator);
         }
         for (int j = 0; j < list2.Count; j++)
         {
             this.TryAddCheaterThought(list2[j], recipient);
         }
         initiator.relations.TryRemoveDirectRelation(PawnRelationDefOf.ExLover, recipient);
         initiator.relations.AddDirectRelation(PawnRelationDefOf.Lover, recipient);
         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);
         }
         else
         {
             letterText  = null;
             letterLabel = null;
             letterDef   = null;
         }
         extraSentencePacks.Add(RulePackDefOf.Sentence_RomanceAttemptAccepted);
         LovePartnerRelationUtility.TryToShareBed(initiator, recipient);
     }
     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;
     }
 }
        // Token: 0x0600001E RID: 30 RVA: 0x000027A0 File Offset: 0x000009A0
        public virtual void Interacted(Pawn initiator, Pawn recipient, List <RulePackDef> extraSentencePacks)
        {
            bool flag = Rand.Value < this.SuccessChance(initiator, recipient);

            if (flag)
            {
                List <Pawn> list;
                this.BreakLoverAndFianceRelations(initiator, out list);
                List <Pawn> list2;
                this.BreakLoverAndFianceRelations(recipient, out list2);
                for (int i = 0; i < list.Count; i++)
                {
                    this.TryAddCheaterThought(list[i], initiator);
                }
                for (int j = 0; j < list2.Count; j++)
                {
                    this.TryAddCheaterThought(list2[j], recipient);
                }
                initiator.relations.TryRemoveDirectRelation(PawnRelationDefOf.ExLover, recipient);
                initiator.relations.AddDirectRelation(PawnRelationDefOf.Lover, recipient);
                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);
                bool flag2 = initiator.IsColonist || recipient.IsColonist;
                if (flag2)
                {
                    this.SendNewLoversLetter(initiator, recipient, list, list2);
                }
                extraSentencePacks.Add(RulePackDefOf.Sentence_RomanceAttemptAccepted);
                LovePartnerRelationUtility.TryToShareBed(initiator, recipient);
            }
            else
            {
                initiator.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.RebuffedMyRomanceAttempt, recipient);
                recipient.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.FailedRomanceAttemptOnMe, initiator);
                bool flag3 = recipient.relations.OpinionOf(initiator) <= 0;
                if (flag3)
                {
                    recipient.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.FailedRomanceAttemptOnMeLowOpinionMood, initiator);
                }
                extraSentencePacks.Add(RulePackDefOf.Sentence_RomanceAttemptRejected);
            }
        }
예제 #4
0
 public static void Married(Pawn firstPawn, Pawn secondPawn)
 {
     LovePartnerRelationUtility.ChangeSpouseRelationsToExSpouse(firstPawn);
     LovePartnerRelationUtility.ChangeSpouseRelationsToExSpouse(secondPawn);
     firstPawn.relations.RemoveDirectRelation(PawnRelationDefOf.Fiance, secondPawn);
     firstPawn.relations.TryRemoveDirectRelation(PawnRelationDefOf.ExSpouse, secondPawn);
     firstPawn.relations.AddDirectRelation(PawnRelationDefOf.Spouse, secondPawn);
     AddNewlyMarriedThoughts(firstPawn, secondPawn);
     AddNewlyMarriedThoughts(secondPawn, firstPawn);
     firstPawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.DivorcedMe, secondPawn);
     secondPawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(ThoughtDefOf.DivorcedMe, firstPawn);
     LovePartnerRelationUtility.TryToShareBed(firstPawn, secondPawn);
     TaleRecorder.RecordTale(TaleDefOf.Marriage, firstPawn, secondPawn);
 }
예제 #5
0
 public static void Married(Pawn firstPawn, Pawn secondPawn)
 {
     LovePartnerRelationUtility.ChangeSpouseRelationsToExSpouse(firstPawn);
     LovePartnerRelationUtility.ChangeSpouseRelationsToExSpouse(secondPawn);
     firstPawn.relations.RemoveDirectRelation(PawnRelationDefOf.Fiance, secondPawn);
     firstPawn.relations.TryRemoveDirectRelation(PawnRelationDefOf.ExSpouse, secondPawn);
     firstPawn.relations.AddDirectRelation(PawnRelationDefOf.Spouse, secondPawn);
     MarriageCeremonyUtility.AddNewlyMarriedThoughts(firstPawn, secondPawn);
     MarriageCeremonyUtility.AddNewlyMarriedThoughts(secondPawn, firstPawn);
     firstPawn.needs.mood.thoughts.RemoveSocialThoughts(ThoughtDefOf.DivorcedMe, secondPawn);
     secondPawn.needs.mood.thoughts.RemoveSocialThoughts(ThoughtDefOf.DivorcedMe, firstPawn);
     LovePartnerRelationUtility.TryToShareBed(firstPawn, secondPawn);
     TaleRecorder.RecordTale(TaleDefOf.Marriage, new object[]
     {
         firstPawn,
         secondPawn
     });
 }