eebasso / Rimworld-Psychology-unofficial-v1.1-1.4

This is an unofficial update of The Word-Mule's Psychology mod for Rimworld. It's a complex overhaul to social interactions and adds a psyche system where each pawn is unique.
2 stars 5 forks source link

Marriage rejection thoughts applied wrong #5

Open Weak1 opened 1 year ago

Weak1 commented 1 year ago

When a marriage proposal is rejected, it results in the pawn who is doing the rejecting gaining both the mood for rejecting and being rejected, as well as sometimes thinking the other cheated on them.

I think the first is caused by a mistake in line 225 of Harmony/RomanceAndFamily/BreakupHelperMethods.cs in GainRejectedMyProposal, where TryGainMood(otherPawn, pawn, ThoughtDefOf.RejectedMyProposalMood); should be TryGainMood(pawn, otherPawn, ThoughtDefOf.RejectedMyProposalMood);

There should then be an conditional statement checking for codependent status so the pawn doesn't gain the mood for both. Here's my quick fix:

    public static void GainRejectedMyProposal(Pawn pawn, Pawn otherPawn)
    {
        TryGainOpinion(pawn, otherPawn, ThoughtDefOf.RejectedMyProposal);
        if (pawn.story.traits.HasTrait(TraitDefOfPsychology.Codependent))
        {
            pawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOfPsychology.RejectedMyProposalCodependent, otherPawn);
        }
        else
        {
            TryGainMood(pawn, otherPawn, ThoughtDefOf.RejectedMyProposalMood);
        }
        TryGainMood(otherPawn, pawn, ThoughtDefOfPsychology.IRejectedTheirProposalMood);
    }

Also in that file, the function GainIRejectedTheirProposal contains the same code as GainCheatedOnMe. It should be something like

    public static void GainIRejectedTheirProposal(Pawn pawn, Pawn otherPawn)
    {
        TryGainOpinion(pawn, otherPawn, ThoughtDefOf.IRejectedTheirProposal);
        pawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOf.IRejectedTheirProposal, otherPawn);
    }

It might be reasonable to move the line giving IRejectedTheirProposalMood from the first to the second function, but I haven't tested that